Support Forum G3D Web Page |
A gui control that allows the user to switch between a variety of differnt panes.
More...
Inherits G3D::GuiContainer.
Public Types | |
enum | { CONTROL_HEIGHT = 25 } |
enum | { CONTROL_WIDTH = 215 } |
enum | { BUTTON_WIDTH = 80 } |
enum | { TOOL_BUTTON_WIDTH = 50 } |
enum | { CONTROL_PADDING = 4 } |
Public Member Functions | |
GuiTabPane (GuiContainer *parent, const Pointer< int > &id=nullptr) | |
For use by GuiPane. More... | |
GuiPane * | addTab (const GuiText &label, int id=-1) |
const GuiText & | caption () const |
float | captionHeight () const |
For controls that have a caption outside the bounds of the control on the top or bottom, this is the size reserved for the caption. More... | |
float | captionWidth () const |
For controls that have a caption outside the bounds of the control on the left, this is the size reserved for the caption. More... | |
const Rect2D & | clickRect () const |
Used by GuiContainers. More... | |
const Rect2D & | clientRect () const |
Client rect bounds, relative to the parent (or window if there is no parent). More... | |
virtual float | defaultCaptionHeight () const |
Default caption size for this control. More... | |
virtual float | defaultCaptionWidth () const |
bool | enabled () const |
virtual void | findControlUnderMouse (Vector2 mouse, GuiControl *&control) override |
Return the enabled, visible control containing the mouse. More... | |
bool | focused () const |
Vector2 | fromOSWindowCoords (const Vector2 &v) const |
Transforms v from OS window coordinates to this control's coordinates. More... | |
virtual void | increaseBounds (const Vector2 &extent) |
Updates this container to ensure that its client rect is least as wide and high as the specified extent, then recursively calls increaseBounds on its parent. More... | |
bool | mouseOver () const |
void | moveBy (const Vector2 &delta) |
void | moveBy (float dx, float dy) |
void | moveRightOf (const GuiControl *control, const Vector2 &offset) |
If these two controls have the same parent, move this one immediately to the right of the argument. More... | |
void | moveRightOf (const GuiControl *control, float offsetX=0.0f) |
virtual bool | onChildControlEvent (const GEvent &event) |
Invoked immediately (i.e., outside of the queue sequence) when a child fires an event through Widget::fireEvent. More... | |
virtual void | pack () |
const Rect2D & | rect () const |
virtual void | render (RenderDevice *rd, const shared_ptr< GuiTheme > &theme, bool ancestorsEnabled) const override |
Only methods on theme may be called from this method by default. More... | |
int | selectedIndex () const |
virtual void | setCaption (const GuiText &caption) |
virtual void | setCaptionHeight (float c) |
virtual void | setCaptionWidth (float c) |
virtual void | setEnabled (bool e) |
void | setEventSource (GuiControl *c) |
void | setFocused (bool b) |
Grab or release keyboard focus. More... | |
void | setHeight (float h) |
void | setPosition (const Vector2 &v) |
void | setPosition (float x, float y) |
virtual void | setRect (const Rect2D &rect) override |
If you explicitly change the rectangle of a control, the containing pane may clip its borders. More... | |
void | setSelectedIndex (int p) |
void | setSize (const Vector2 &v) |
void | setSize (float x, float y) |
void | setVisible (bool b) |
void | setWidth (float w) |
shared_ptr< GuiTheme > | theme () const |
virtual bool | toolStyle () const |
Return true if this is in tool button style. More... | |
Vector2 | toOSWindowCoords (const Vector2 &v) const |
Returns the coordinates of v, which is in the coordinate system of this object, relative to the OSWindow on which it will be rendered. More... | |
Rect2D | toOSWindowCoords (const Rect2D &r) const |
bool | visible () const |
GuiWindow * | window () const |
Get the window containing this control. More... | |
Protected Types | |
enum | { LEFT_CAPTION_WIDTH = 80, TOP_CAPTION_HEIGHT = 20 } |
Protected Member Functions | |
void | fireEvent (GEventType type) |
Fires an event. More... | |
virtual bool | onEvent (const GEvent &event) override |
Events are only delivered to a control when the control that control has the key focus (which is transferred during a mouse down) More... | |
Protected Attributes | |
GuiText | m_caption |
float | m_captionHeight |
float | m_captionWidth |
Rect2D | m_clickRect |
Rect bounds used for mouse actions. More... | |
Rect2D | m_clientRect |
Position to which all child controls are relative. More... | |
Array< int > | m_contentIDArray |
Parallel array to m_contentPaneArray. More... | |
Array< GuiPane * > | m_contentPaneArray |
bool | m_enabled |
GuiControl * | m_eventSource |
Sent events should appear to be from this object, which is usually "this". More... | |
GuiWindow * | m_gui |
The window that ultimately contains this control. More... | |
Pointer< int > | m_idPtr |
int | m_internalIndex |
Used if no index pointer is provided. More... | |
GuiContainer * | m_parent |
Parent pane. More... | |
Rect2D | m_rect |
Rect bounds used for rendering and layout. More... | |
GuiPane * | m_tabButtonPane |
GuiDropDownList * | m_tabDropDown |
GuiPane * | m_viewPane |
bool | m_visible |
A gui control that allows the user to switch between a variety of differnt panes.
The panes are represented by tabs if they fit on the screen in which case it switches to a drop down window.
G3D::GuiTabPane::GuiTabPane | ( | GuiContainer * | parent, |
const Pointer< int > & | id = nullptr |
||
) |
For use by GuiPane.
Call GuiPane::addTabPane to create
id | If -1 (default), set to the integer corresponding to the number of panes already in existence. Useful for cases where you want the index to correspond to an enum. |
|
inherited |
Referenced by G3D::GuiPane::addDropDownList(), G3D::GuiPane::addMultiLineTextBox(), and G3D::GuiPane::addTextBox().
|
inherited |
For controls that have a caption outside the bounds of the control on the top or bottom, this is the size reserved for the caption.
|
inherited |
For controls that have a caption outside the bounds of the control on the left, this is the size reserved for the caption.
|
inlineinherited |
Used by GuiContainers.
|
inlineinherited |
Client rect bounds, relative to the parent (or window if there is no parent).
|
inlinevirtualinherited |
Default caption size for this control.
Reimplemented in G3D::GuiFunctionBox.
|
inlinevirtualinherited |
|
inherited |
Referenced by G3D::GuiNumberBox< int >::render().
|
overridevirtual |
Return the enabled, visible control containing the mouse.
The default implementation returns itself if the mouse is within its bounds. GuiContainers should override this to iterate through children. Since only one (non-overlapping) child will write to control, it is sufficient to call this on all children without testing to see if one already wrote to control.
Reimplemented from G3D::GuiControl.
|
protectedinherited |
Fires an event.
|
inherited |
Transforms v from OS window coordinates to this control's coordinates.
|
virtualinherited |
Updates this container to ensure that its client rect is least as wide and high as the specified extent, then recursively calls increaseBounds on its parent.
Used during automatic layout sizing.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
If these two controls have the same parent, move this one immediately to the right of the argument.
offset | May be negative |
Referenced by G3D::GuiControl::moveRightOf().
|
inlineinherited |
|
virtualinherited |
Invoked immediately (i.e., outside of the queue sequence) when a child fires an event through Widget::fireEvent.
If this method returns true, the event is never submitted to the event queue. The default implementation passes the event to the GUI parent of this GuiContainer.
This enables creation of new custom controls by embedding other controls inside a GuiContainer; the container can suppress or watch the child control events in order to present its own behavior to its parent and the GuiWindow.
|
inlineoverrideprotectedvirtual |
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.
|
virtual |
|
inherited |
|
overridevirtual |
Only methods on theme may be called from this method by default.
To make arbitrary RenderDevice calls, wrap them in GuiTheme::pauseRendering ... GuiTheme::resumeRendering.
Implements G3D::GuiControl.
|
inline |
|
virtualinherited |
Reimplemented in G3D::GuiNumberBox< Value >, G3D::GuiNumberBox< float >, G3D::GuiNumberBox< int >, G3D::GuiTextureBox, and G3D::GuiPane.
Referenced by G3D::GuiNumberBox< int >::setCaption().
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
Reimplemented in G3D::GuiNumberBox< Value >, G3D::GuiNumberBox< float >, G3D::GuiNumberBox< int >, and G3D::GuiFrameBox.
Referenced by G3D::GuiNumberBox< int >::setEnabled().
|
inlineinherited |
|
inherited |
Grab or release keyboard focus.
|
inherited |
|
inherited |
|
inherited |
|
overridevirtual |
If you explicitly change the rectangle of a control, the containing pane may clip its borders.
Call pack() on the containing pane (or window) to resize that container appropriately.
Reimplemented from G3D::GuiContainer.
|
inline |
|
inherited |
Referenced by G3D::GuiPane::addRadioButton().
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inlinevirtualinherited |
Return true if this is in tool button style.
Reimplemented in G3D::GuiRadioButton, G3D::GuiButton, and G3D::GuiCheckBox.
Returns the coordinates of v, which is in the coordinate system of this object, relative to the OSWindow on which it will be rendered.
Referenced by G3D::GuiControl::toOSWindowCoords().
|
inherited |
|
inherited |
Get the window containing this control.
|
protectedinherited |
Referenced by G3D::GuiNumberBox< int >::render().
|
protectedinherited |
|
protectedinherited |
Referenced by G3D::GuiNumberBox< int >::setRect().
|
protectedinherited |
|
protectedinherited |
Position to which all child controls are relative.
Referenced by G3D::GuiContainer::clientRect(), G3D::GuiNumberBox< int >::findControlUnderMouse(), and G3D::GuiNumberBox< int >::render().
|
protected |
Parallel array to m_contentPaneArray.
|
protectedinherited |
|
protectedinherited |
Sent events should appear to be from this object, which is usually "this".
Other controls can set the event source to create compound controls that seem atomic from the outside.
Referenced by G3D::GuiSlider< int >::GuiSlider(), G3D::GuiNumberBox< Value >::MyTextBox::MyTextBox(), and G3D::GuiControl::setEventSource().
|
protectedinherited |
The window that ultimately contains this control.
|
protected |
Referenced by selectedIndex(), and setSelectedIndex().
|
protected |
Used if no index pointer is provided.
|
protectedinherited |
Parent pane.
|
protectedinherited |
Rect bounds used for rendering and layout.
Relative to the enclosing pane's clientRect.
Referenced by G3D::GuiControl::findControlUnderMouse(), G3D::GuiNumberBox< int >::render(), G3D::GuiNumberBox< int >::setCaption(), and G3D::GuiNumberBox< int >::setRect().
|
protected |
|
protected |
|
protected |
|
protectedinherited |