G3D::GuiPane Class ReferenceSub-rectangle of a window.
More...
#include <GuiPane.h>
Inherits G3D::GuiControl.
List of all members.
|
Public Types |
| enum | Style { SIMPLE_FRAME_STYLE,
ORNATE_FRAME_STYLE,
NO_FRAME_STYLE
} |
Public Member Functions |
| GuiButton * | addButton (const GuiCaption &text, GuiButton::Style style=GuiButton::NORMAL_STYLE) |
| GuiCheckBox * | addCheckBox (const GuiCaption &text, bool *pointer, GuiCheckBox::Style style=GuiCheckBox::BOX_STYLE) |
| GuiCheckBox * | addCheckBox (const GuiCaption &text, const Pointer< bool > &pointer, GuiCheckBox::Style style=GuiCheckBox::BOX_STYLE) |
| GuiDropDownList * | addDropDownList (const GuiCaption &caption, const Pointer< int > &indexPointer, Array< GuiCaption > *list) |
| GuiDropDownList * | addDropDownList (const GuiCaption &caption, const Pointer< int > &indexPointer, Array< std::string > *list) |
| GuiLabel * | addLabel (const GuiCaption &text, GFont::XAlign xalign=GFont::XALIGN_LEFT, GFont::YAlign=GFont::YALIGN_CENTER) |
| GuiPane * | addPane (const GuiCaption &text="", float height=0, GuiPane::Style style=GuiPane::SIMPLE_FRAME_STYLE) |
| GuiRadioButton * | addRadioButton (const GuiCaption &text, int myID, void *selection, GuiRadioButton::Style style=GuiRadioButton::RADIO_STYLE) |
| template<typename EnumOrInt, class T> |
| GuiRadioButton * | addRadioButton (const GuiCaption &text, int myID, T *object, EnumOrInt(T::*get)() const, void(T::*set)(EnumOrInt), GuiRadioButton::Style style) |
| template<typename Value> |
| GuiSlider< Value > * | addSlider (const GuiCaption &text, Value *value, Value min, Value max, bool horizontal=true) |
| template<typename Value> |
| GuiSlider< Value > * | addSlider (const GuiCaption &text, const Pointer< Value > &value, Value min, Value max, bool horizontal=true) |
| GuiTextBox * | addTextBox (const GuiCaption &caption, const Pointer< std::string > &stringPointer, GuiTextBox::Update update=GuiTextBox::DELAYED_UPDATE) |
| const GuiCaption & | caption () const |
| const Rect2D & | clientRect () const |
| bool | enabled () const |
| bool | focused () const |
| bool | morphing () const |
| virtual void | morphTo (const Rect2D &r) |
| bool | mouseOver () const |
| void | moveBy (float dx, float dy) |
| void | moveBy (const Vector2 &delta) |
| void | moveRightOf (const GuiControl *control) |
| void | pack () |
| const Rect2D & | rect () const |
| void | remove (GuiControl *gui) |
| void | setCaption (const GuiCaption &text) |
| void | setEnabled (bool e) |
| void | setFocused (bool b) |
| void | setHeight (float h) |
| void | setPosition (float x, float y) |
| void | setPosition (const Vector2 &v) |
| virtual void | setRect (const Rect2D &rect) |
| void | setSize (float x, float y) |
| void | setSize (const Vector2 &v) |
| void | setVisible (bool b) |
| void | setWidth (float w) |
| GuiSkinRef | skin () const |
| bool | visible () const |
| | ~GuiPane () |
Protected Member Functions |
| template<class T> |
| T * | addControl (T *c) |
| Vector2 | contentsExtent () const |
| void | findControlUnderMouse (Vector2 mouse, GuiControl *&control) const |
| void | fireActionEvent () |
| | GuiPane (GuiWindow *gui, GuiPane *parent, const GuiCaption &text, const Rect2D &rect, Style style) |
| void | increaseBounds (const Vector2 &extent) |
| Vector2 | nextControlPos () const |
| virtual bool | onEvent (const GEvent &event) |
| virtual void | render (RenderDevice *rd, const GuiSkinRef &skin) const |
Static Protected Member Functions |
| static void | makeRelative (GEvent &e, const Rect2D &clientRect) |
Protected Attributes |
| Array< GuiControl * > | controlArray |
| Array< GuiLabel * > | labelArray |
| GuiCaption | m_caption |
| Rect2D | m_clickRect |
| Rect2D | m_clientRect |
| bool | m_enabled |
| GuiWindow * | m_gui |
| Morph | m_morph |
| GuiPane * | m_parent |
| Rect2D | m_rect |
| Style | m_style |
| bool | m_visible |
| Array< GuiPane * > | paneArray |
Friends |
| class | _GuiSliderBase |
| class | GuiButton |
| class | GuiControl |
| class | GuiRadioButton |
| class | GuiWindow |
Classes |
| class | Morph |
Detailed Description
Sub-rectangle of a window.
Created by GuiWindow::addPane(). If a pane is invisible, everything inside of it is also invisible.
All coordinates of objects inside a pane are relative to the pane's clientRect(). See GuiWindow for an example of creating a user interface.
Member Enumeration Documentation
Controls the appearance of the pane's borders and background.
- Enumerator:
-
| SIMPLE_FRAME_STYLE |
|
| ORNATE_FRAME_STYLE |
|
| NO_FRAME_STYLE |
|
Constructor & Destructor Documentation
| G3D::GuiPane::~GuiPane |
( |
|
) |
|
Member Function Documentation
bool enabled;
gui->addCheckBox("Enabled", &enabled);
Foo* foo = new Foo();
gui->addCheckBox("Enabled", Pointer<bool>(foo, &Foo::enabled, &Foo::setEnabled));
BarRef foo = Bar::create();
gui->addCheckBox("Enabled", Pointer<bool>(bar, &Bar::enabled, &Bar::setEnabled));
template<class T>
| T* G3D::GuiPane::addControl |
( |
T * |
c |
) |
[inline, protected] |
- Parameters:
-
| height | Client size of the pane (size of the inside, not counting the border). |
This will automatically grow as controls are added, so it can safely be left as zero.
Example:.
enum Day {SUN, MON, TUE, WED, THU, FRI, SAT};
Day day;
gui->addRadioButton("Sun", SUN, &day);
gui->addRadioButton("Mon", MON, &day);
gui->addRadioButton("Tue", TUE, &day);
...
- Parameters:
-
| selection | Must be a pointer to an int or enum. The current selection value for a group of radio buttons. |
template<typename EnumOrInt, class T>
template<typename Value>
| GuiSlider<Value>* G3D::GuiPane::addSlider |
( |
const GuiCaption & |
text, |
|
|
Value * |
value, |
|
|
Value |
min, |
|
|
Value |
max, |
|
|
bool |
horizontal = true | |
|
) |
| | [inline] |
template<typename Value>
| GuiSlider<Value>* G3D::GuiPane::addSlider |
( |
const GuiCaption & |
text, |
|
|
const Pointer< Value > & |
value, |
|
|
Value |
min, |
|
|
Value |
max, |
|
|
bool |
horizontal = true | |
|
) |
| | [inline] |
| const GuiCaption& G3D::GuiControl::caption |
( |
|
) |
const [inherited] |
| const Rect2D& G3D::GuiPane::clientRect |
( |
|
) |
const [inline] |
Client rect bounds, relative to the parent pane (or window if there is no parent).
| Vector2 G3D::GuiPane::contentsExtent |
( |
|
) |
const [protected] |
| bool G3D::GuiControl::enabled |
( |
|
) |
const [inherited] |
| void G3D::GuiPane::findControlUnderMouse |
( |
Vector2 |
mouse, |
|
|
GuiControl *& |
control | |
|
) |
| | const [protected] |
Finds the visible, enabled control underneath the mouse.
- Parameters:
-
| control | (Output) pointer to the control that the mouse is over |
| mouse | Relative to the parent of this pane. |
| void G3D::GuiControl::fireActionEvent |
( |
|
) |
[protected, inherited] |
| bool G3D::GuiControl::focused |
( |
|
) |
const [inherited] |
| void G3D::GuiPane::increaseBounds |
( |
const Vector2 & |
extent |
) |
[protected] |
Updates this pane to ensure that its client rect is least as wide and high as the specified extent, then recursively calls increaseBounds on its parent.
| static void G3D::GuiPane::makeRelative |
( |
GEvent & |
e, |
|
|
const Rect2D & |
clientRect | |
|
) |
| | [static, protected] |
If this is a mouse event, make it relative to the client rectangle.
| bool G3D::GuiPane::morphing |
( |
|
) |
const [inline] |
Returns true while a morph is in progress.
| virtual void G3D::GuiPane::morphTo |
( |
const Rect2D & |
r |
) |
[virtual] |
Causes the window to change shape and/or position to meet the specified location.
The window will not respond to drag events while it is morphing.
| bool G3D::GuiControl::mouseOver |
( |
|
) |
const [inherited] |
| void G3D::GuiControl::moveBy |
( |
float |
dx, |
|
|
float |
dy | |
|
) |
| | [inherited] |
| void G3D::GuiControl::moveBy |
( |
const Vector2 & |
delta |
) |
[inherited] |
| void G3D::GuiControl::moveRightOf |
( |
const GuiControl * |
control |
) |
[inherited] |
If these two controls have the same parent, move this one immediately to the right of the argument.
| Vector2 G3D::GuiPane::nextControlPos |
( |
|
) |
const [protected] |
Finds the next vertical position for a control relative to the client rect.
| virtual bool G3D::GuiPane::onEvent |
( |
const GEvent & |
event |
) |
[inline, protected, virtual] |
Events are only delivered to a control when the control that control has the key focus (which is transferred during a mouse down).
Reimplemented from G3D::GuiControl.
| void G3D::GuiPane::pack |
( |
|
) |
|
Resize this pane so that all of its controls are visible and so that there is no wasted space.
- See also:
- G3D::GuiWindow::pack
| const Rect2D& G3D::GuiControl::rect |
( |
|
) |
const [inherited] |
Removes this control from the GuiPane.
| void G3D::GuiControl::setCaption |
( |
const GuiCaption & |
text |
) |
[inherited] |
| void G3D::GuiControl::setEnabled |
( |
bool |
e |
) |
[inherited] |
| void G3D::GuiControl::setFocused |
( |
bool |
b |
) |
[inherited] |
Grab or release keyboard focus.
| void G3D::GuiControl::setHeight |
( |
float |
h |
) |
[inherited] |
| void G3D::GuiControl::setPosition |
( |
float |
x, |
|
|
float |
y | |
|
) |
| | [inherited] |
| void G3D::GuiControl::setPosition |
( |
const Vector2 & |
v |
) |
[inherited] |
| virtual void G3D::GuiPane::setRect |
( |
const Rect2D & |
rect |
) |
[virtual] |
| void G3D::GuiControl::setSize |
( |
float |
x, |
|
|
float |
y | |
|
) |
| | [inherited] |
| void G3D::GuiControl::setSize |
( |
const Vector2 & |
v |
) |
[inherited] |
| void G3D::GuiControl::setVisible |
( |
bool |
b |
) |
[inherited] |
| void G3D::GuiControl::setWidth |
( |
float |
w |
) |
[inherited] |
| GuiSkinRef G3D::GuiControl::skin |
( |
|
) |
const [inherited] |
| bool G3D::GuiControl::visible |
( |
|
) |
const [inherited] |
Friends And Related Function Documentation
Member Data Documentation
Rect bounds used for mouse actions.
Updated by setRect.
The window that ultimately contains this control.
Rect bounds used for rendering and layout.
Relative to the enclosing pane's clientRect.
The documentation for this class was generated from the following file:
Generated on Thu Aug 2 11:40:46 2007 for G3D by
1.5.2
Hosted by
|