Allows GuiElements to be grouped together into a "window". More...
#include <gui.h>
Public Member Functions | |
GuiWindow () | |
Constructor. | |
GuiWindow (int w, int h) | |
~GuiWindow () | |
Destructor. | |
void | Append (GuiElement *e) |
void | Insert (GuiElement *e, u32 i) |
void | Remove (GuiElement *e) |
void | RemoveAll () |
Removes all GuiElements. | |
GuiElement * | GetGuiElementAt (u32 index) const |
u32 | GetSize () |
void | SetVisible (bool v) |
void | ResetState () |
Resets the window's state to STATE_DEFAULT. | |
void | SetState (int s) |
void | DisableChildren () |
Disables all of the window's children. | |
int | GetSelected () |
void | SetFocus (int f) |
void | ChangeFocus (GuiElement *e) |
void | ToggleFocus (GuiTrigger *t) |
void | MoveSelectionHor (int d) |
void | MoveSelectionVert (int d) |
void | Draw () |
Draws all the elements in this GuiWindow. | |
void | Update (GuiTrigger *t) |
Protected Attributes | |
std::vector< GuiElement * > | _elements |
Contains all elements within the GuiWindow. |
Allows GuiElements to be grouped together into a "window".
Definition at line 425 of file gui.h.
GuiWindow::GuiWindow | ( | int | w, | |
int | h | |||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
w | Width of window | |
h | Height of window |
Definition at line 20 of file gui_window.cpp.
void GuiWindow::Append | ( | GuiElement * | e | ) |
Appends a GuiElement to the GuiWindow
e | The GuiElement to append. If it is already in the GuiWindow, it is removed first |
Definition at line 31 of file gui_window.cpp.
void GuiWindow::ChangeFocus | ( | GuiElement * | e | ) |
Change the focus to the specified element This is intended for the primary GuiWindow only
e | GuiElement that should have focus |
Definition at line 153 of file gui_window.cpp.
GuiElement * GuiWindow::GetGuiElementAt | ( | u32 | index | ) | const |
Returns the GuiElement at the specified index
index | The index of the element |
Definition at line 71 of file gui_window.cpp.
int GuiWindow::GetSelected | ( | ) | [virtual] |
Gets the index of the GuiElement inside the window that is currently selected
Reimplemented from GuiElement.
Definition at line 244 of file gui_window.cpp.
u32 GuiWindow::GetSize | ( | ) |
Returns the size of the list of elements
Definition at line 78 of file gui_window.cpp.
void GuiWindow::Insert | ( | GuiElement * | e, | |
u32 | i | |||
) |
Inserts a GuiElement into the GuiWindow at the specified index
e | The GuiElement to insert. If it is already in the GuiWindow, it is removed first | |
i | Index in which to insert the element |
Definition at line 41 of file gui_window.cpp.
void GuiWindow::MoveSelectionHor | ( | int | d | ) |
Moves the selected element to the element to the left or right
d | Direction to move (-1 = left, 1 = right) |
Definition at line 265 of file gui_window.cpp.
void GuiWindow::MoveSelectionVert | ( | int | d | ) |
Moves the selected element to the element above or below
d | Direction to move (-1 = up, 1 = down) |
Definition at line 334 of file gui_window.cpp.
void GuiWindow::Remove | ( | GuiElement * | e | ) |
Removes the specified GuiElement from the GuiWindow
e | GuiElement to be removed |
Definition at line 51 of file gui_window.cpp.
void GuiWindow::SetFocus | ( | int | f | ) | [virtual] |
Sets the window focus
f | Focus |
Reimplemented from GuiElement.
Definition at line 143 of file gui_window.cpp.
void GuiWindow::SetState | ( | int | s | ) |
void GuiWindow::SetVisible | ( | bool | v | ) | [virtual] |
Sets the visibility of the window
v | visibility (true = visible) |
Reimplemented from GuiElement.
Definition at line 132 of file gui_window.cpp.
void GuiWindow::ToggleFocus | ( | GuiTrigger * | t | ) |
Changes window focus to the next focusable window or element If no element is in focus, changes focus to the first available element If B or 1 button is pressed, changes focus to the next available element This is intended for the primary GuiWindow only
t | Pointer to a GuiTrigger, containing the current input data from PAD/WPAD |
Definition at line 167 of file gui_window.cpp.
void GuiWindow::Update | ( | GuiTrigger * | t | ) | [virtual] |
Updates the window and all elements contains within Allows the GuiWindow and all elements to respond to the input data specified
t | Pointer to a GuiTrigger, containing the current input data from PAD/WPAD |
Reimplemented from GuiElement.
Reimplemented in GuiKeyboard.
Definition at line 385 of file gui_window.cpp.