WindowHandler

Handles windows as well as PopUpElements.

class WindowHandler : InputListener, MouseListener, PopUpHandler {}

Constructors

this
this(int sW, int sH, int rW, int rH, ISpriteLayer sl)

Default CTOR. sW and sH set the screen width and height. rW and rH set the raster width and height. ISpriteLayer sets the SpriteLayer, that will display the windows and popups as sprites.

Members

Aliases

PopUpSet
alias PopUpSet = LinkedList!(PopUpElement, false, "a is b")
Undocumented in source.
WindowSet
alias WindowSet = LinkedList!(Window, false, "a is b")
Undocumented in source.

Functions

addBackground
void addBackground(ABitmap b)

Adds a background.

addPopUpElement
void addPopUpElement(PopUpElement p)

Adds a popup element and moves it to the current cursor position.

addPopUpElement
void addPopUpElement(PopUpElement p, int x, int y)
Undocumented in source. Be warned that the author may not have intended to support it.
addWindow
void addWindow(Window w)

Adds a window to the handler.

axisEvent
void axisEvent(uint id, BindingCode code, uint timestamp, float value)

Called when an axis is being operated. The id should be generated from a string, usually the name of the binding. code is a duplicate of the code used for fast lookup of the binding, which also contains other info (deviceID, etc). timestamp is the time lapsed since the start of the program, can be used to measure time between keypresses. value is the current position of the axis normalized between -1.0 and +1.0 for joysticks, and 0.0 and +1.0 for analog triggers.

closePopUp
void closePopUp(PopUpElement p)
Undocumented in source. Be warned that the author may not have intended to support it.
closeWindow
void closeWindow(Window sender)

Closes the given window.

endPopUpSession
void endPopUpSession(PopUpElement p)
Undocumented in source. Be warned that the author may not have intended to support it.
getCursor
CursorType getCursor()

Returns the current cursor type.

getDefaultStyleSheet
StyleSheet getDefaultStyleSheet()
Undocumented in source. Be warned that the author may not have intended to support it.
getStyleSheet
StyleSheet getStyleSheet()

Returns the default stylesheet.

initDragEvent
void initDragEvent(MouseEventReceptor dragEventSrc)

Initializes drag event. Used to avoid issues from stray mouse release, etc.

keyEvent
void keyEvent(uint id, BindingCode code, uint timestamp, bool isPressed)

Called when a keybinding event is generated. The id should be generated from a string, usually the name of the binding. code is a duplicate of the code used for fast lookup of the binding, which also contains other info (deviceID, etc). timestamp is the time lapsed since the start of the program, can be used to measure time between keypresses. NOTE: Hat events on joysticks don't generate keyReleased events, instead they generate keyPressed events on release.

message
void message(dstring title, dstring message, int width)

Adds a DefaultDialog as a message box

mouseClickEvent
void mouseClickEvent(MouseEventCommons mec, MouseClickEvent mce)

Called on mouse click events.

mouseMotionEvent
void mouseMotionEvent(MouseEventCommons mec, MouseMotionEvent mme)

Called on mouse motion events.

mouseWheelEvent
void mouseWheelEvent(MouseEventCommons mec, MouseWheelEvent mwe)

Called on mouse wheel events.

refreshWindow
void refreshWindow(Window sender)

Replaces the window's old sprite in the spritelayer's display list with the new one.

setBaseWindow
Window setBaseWindow(Window w)

Sets the BaseWindow to the given object.

setCursor
CursorType setCursor(CursorType type)

Sets the cursor to the given type.

setWindowToTop
void setWindowToTop(Window w)

Sets sender to be top priority.

updateSpriteOrder
void updateSpriteOrder()

Updates the sprite order by removing everything, then putting them back again.

updateWindowCoord
void updateWindowCoord(Window sender)

Updates the sender's coordinates.

Variables

background
ABitmap background;
Undocumented in source.
baseWindow
Window baseWindow;

A window that is used for top-level stuff, like elements in the background, or an integrated window.

cursor
CursorType cursor;

The type of the current cursor

defaultStyle
StyleSheet defaultStyle;

Sets the default style for the windowhandler. If null, the global default will be used instead.

dragEventSrc
MouseEventReceptor dragEventSrc;
Undocumented in source.
mouseConvX
double mouseConvX;
mouseConvY
double mouseConvY;
mouseX
int mouseX;
mouseY
int mouseY;
moveX
int moveX;
moveY
int moveY;
Undocumented in source.
popUpElements
PopUpSet popUpElements;
rasterHeight
int rasterHeight;
rasterWidth
int rasterWidth;
screenHeight
int screenHeight;
Undocumented in source.
screenWidth
int screenWidth;
Undocumented in source.
sdlCursor
SDL_Cursor* sdlCursor;

SDL cursor pointer to operate it

windows
WindowSet windows;
Undocumented in source.

Meta