|
Public Member Functions |
| UIBaseWindow (UserInterface *ui) |
| Constructor.
|
| ~UIBaseWindow () |
| Destructor.
|
virtual void | SetPosition (int x, int y) |
| Changes the window's current position (top left corner). 0,0 represents the top left window's corner. Max values depend on the window's size (in pixel).
|
virtual void | SetSize (int x, int y) |
| Changes the window's current size. 0,0 represents the top left window's corner. Max values depend on the window's size (in pixel).
|
virtual int | GetWidth () |
| Returns the window's X size.
|
virtual int | GetHeight () |
| Returns the window's Y size.
|
virtual int | GetPositionX () |
| Returns the left window's border position. 0 is the left border of the window. Max values depend on the window's size (in pixel).
|
virtual int | GetPositionY () |
| Returns the top window's border position. 0 is the top border of the window. Max values depend on the window's size (in pixel).
|
void | Close () |
| Asks the window to close itself. Note that this will effect just before next draw, and the window's memory will be freed by the user interface.
|
Protected Member Functions |
virtual void | OnDisplay () |
| Event called when the window needs to be displayed. Override it if you want custom graphics for your window (and you probably will).
|
virtual void | OnWindowResized (int width, int height) |
| This function is called each time the windows is resized, or the window is switched between fullscreen and windowed mode.
|
virtual bool | OnMouseButton (const MouseInformations *mouseInfo, MouseButton button, bool buttonDown) |
| This function is called when a mouse button is pressed or released inside the window's borders. When this happens, the user interface will check (in focus order) if one of the windows can handle the event. This is why the function must return a bool : once the interface has found a window that handles the click, it stops it search (so every window is not checked) and returns true. If no window handles the click, then the Window instance triggers an event (OnMouseButton) to its event manager (i.e. Application).
|
virtual bool | OnMouseMove (const MouseInformations *mouseInfo) |
| This function is called when the mouse is moved inside the window's borders. When this happens, the user interface will check (in focus order) if one of the windows can handle the event. This is why the function must return a bool : once the interface has found a window that handles the move, it stops it search (so every window is not checked) and returns true. If no window handles the click, then the Window instance triggers an event (OnMouseButton) to its event manager (i.e. Application).
|
virtual void | OnMouseDrag (const MouseInformations *mouseInfo) |
| This function is called when the mouse is dragging inside the window's borders. Dragging means having the left button down while moving the mouse. When this happens, the user interface will check (in focus order) if one of the windows can handle the event. This is why the function must return a bool : once the interface has found a window that handles the move, it stops it search (so every window is not checked). If no window handles the move, then it triggers an event to the application (OnMouseMove).
|
virtual void | OnGetsFocus () |
| This function is called when the current window gets the focus, i.e. is on top of all the other windows. For instance is called when the uses selects the window, or the window is added to the user interface, as adding a window puts it in the first position.
|
virtual void | OnLosesFocus () |
| This function is called when the current window loses the focus, i.e. is no more on top of all the other windows. This may happen if a window is added to the interface, or the uses selects another window.
|
virtual void | AddComponent (UIBaseComponent *component) |
| Adds a component to the current window.
|
virtual bool | IsMouseInbound (const MouseInformations *mouseInfo) |
| checks if the mouse is above the window or not. You might want to change the algorithm if you want non-rectangular windows.
|
virtual bool | WasMouseInbound (const MouseInformations *mouseInfo) |
| checks if the mouse was above the window or not. You might want to change the algorithm if you want non-rectangular windows.
|
virtual void | OnReceiveMessage (UIBaseComponent *trigger, UICMessage message, int infos) |
| This function is called whenever a component sends a message to its parent window.
|
Private Attributes |
bool | m_IsDragging |
| This variable remembers if we're dragging the window.
|
int | m_WindowWidth |
| User Window's width and height. TODO : need to find a better solution someday. But I don't like m_UserInterface->GetWidth() either.
|
int | m_WindowHeight |
int | m_PosX |
| Current X and Y position of the window. 0,0 represents the top left window's corner. Max values depend on the window's size (in pixel).
|
int | m_PosY |
int | m_Width |
| Current X and Y size of the window.
|
int | m_Height |
UserInterface * | m_UserInterface |
| user interface that holds this window.
|
vector< UIBaseComponent * > | m_Components |
| list of components held by the window.
|
UIBaseComponent * | m_ActiveComponent |
| Last component that's been manipulated by the user.
|
Friends |
class | UIBaseComponent |
class | UserInterface |