This is a widget for displaying a list of captions in a box. More...
#include <uilistbox.h>
Public Member Functions | |
| ListBox (ConstString &name, const RenderableRect &Rect, const UI::ScrollbarStyle &ScrollStyle, Layer *PLayer) | |
| Standard initialization constructor. | |
| virtual | ~ListBox () |
| Standard destructor. | |
| virtual Caption * | AddSelection (ConstString &name, ConstString &Text, ConstString &BackgroundSprite="") |
| Adds a selectable caption to the list to be displayed. | |
| virtual void | DestroySelection (String &ToBeDestroyed) |
| Destroys a selectable caption. | |
| virtual void | DestroySelection (Caption *ToBeDestroyed) |
| Destroys a selectable caption. | |
| virtual Rectangle * | GetBoxBack () |
| Gets the background of this List Box. | |
| virtual Caption * | GetSelected () |
| Gets the currently selected caption. | |
| virtual Caption * | GetSelection (ConstString &Name) |
| Gets a caption by name. | |
| virtual const UI::TemplateParams & | GetTemplateInfo () |
| Gets the struct containing all the current template parameters used when creating a new selections. | |
| virtual UI::Scrollbar * | GetVertScroll () |
| Gets the scrollbar used within this List Box. | |
| virtual void | SetActualPosition (const Vector2 &Position) |
| Sets the pixel position of this List Box. | |
| virtual void | SetActualSize (const Vector2 &Size) |
| Sets the pixel size of this List Box. | |
| virtual void | SetAutoHideScroll (bool AutoHide) |
| Eanbles or disables the scrollbar autohide. | |
| virtual void | SetMaxDisplayedSelections (const Whole &MaxSelections) |
| Sets the maximum number of selections to display at once before the scrollbar appears. | |
| virtual void | SetPosition (const Vector2 &Position) |
| Sets the relative position of this List Box. | |
| virtual void | SetSelected (Caption *ToBeSelected) |
| Sets the selection within this list to be "selected". | |
| virtual void | SetSize (const Vector2 &Size) |
| Sets the relative size of this List Box. | |
| virtual ListBox & | SetTemplateBackgroundColour (const ColourValue &BackgroundColour) |
| Sets the background colour to be applied to all created Selections. | |
| virtual ListBox & | SetTemplateCursorOffset (const Whole &Offset) |
| Set the cursor offset to be applied to all created Selections. | |
| virtual ListBox & | SetTemplateGlyphIndex (const Whole &Glyph) |
| Sets the glyph index to be applied to all created Selections. | |
| virtual ListBox & | SetTemplateHorizontalAlign (const UI::TextHorizontalAlign &HorAlign) |
| Sets the horizontal alignment to be applied to all created Selections. | |
| virtual ListBox & | SetTemplateRenderPriority (const UI::RenderPriority &Priority) |
| Sets the render priority to be applied to all created Selections. | |
| virtual ListBox & | SetTemplateSize (const Vector2 &Size, bool Relative=true) |
| Sets the size to be applied to all created Selections. | |
| virtual ListBox & | SetTemplateTextColour (const ColourValue &TextColour) |
| Sets the text colour to be applied to all created Selections. | |
| virtual ListBox & | SetTemplateTextScale (const Real &Scale) |
| Sets the text scale to be applied to all created Selections. | |
| virtual ListBox & | SetTemplateVerticalAlign (const UI::TextVerticalAlign &VertAlign) |
| Sets the vertical alignment to be applied to all created Selections. | |
| virtual void | UpdateDimensions () |
| Updates the dimensions of this widget to match those of the new screen size. | |
Public Attributes | |
| TemplateParams | Params |
Protected Member Functions | |
| virtual bool | CheckMouseHoverImpl () |
| Child specific mouse hover method. | |
| virtual void | DrawList () |
| Updates the list of Visible buttons and hides the rest. | |
| virtual void | ScrollerSizeCheck () |
| Checks to make sure the Scroller is the appropriate size. | |
| virtual void | ScrollHideCheck () |
| Checks to see if the scrollbar should be hidden or not. | |
| virtual void | SelectionSizeCheck (UI::Caption *Selection) |
| Checks to see if the current size of the selection needs adjusting. | |
| virtual void | SetArea (const Vector2 &Area) |
| Internal utility to set the size of this widget. | |
| virtual void | SetVisibleImpl (bool visible) |
| Child specific visibility method. | |
| virtual void | UpdateImpl (bool Force=false) |
| Child specific update method. | |
Protected Attributes | |
| bool | AutoHideScroll |
| Rectangle * | BoxBack |
| Caption * | HoveredCaption |
| Real | LastScrollValue |
| Whole | MaxDisplay |
| Caption * | Selected |
| std::vector< Caption * > | Selections |
| Whole | SelectionsAdded |
| UI::TemplateParams | SelectionTemplate |
| Scrollbar * | VertScroll |
| std::vector< Caption * > | VisibleSelections |
This is a widget for displaying a list of captions in a box.
Definition at line 74 of file uilistbox.h.
| Mezzanine::UI::ListBox::ListBox | ( | ConstString & | name, |
| const RenderableRect & | Rect, | ||
| const UI::ScrollbarStyle & | ScrollStyle, | ||
| Layer * | PLayer | ||
| ) |
Standard initialization constructor.
| name | The name of the List Box. |
| Rect | The Rect representing the position and size of the List Box. The size portion of this rect would be in reference to the size of a single selection. The actual size of this widget will be a result of how many selections are currently being displayed. |
| ScrollStyle | The style of the scrollbar you want for this List Box. See Scrollbar class for more information. |
| Layer | The parent layer this List Box belongs to. |
Definition at line 61 of file uilistbox.cpp.
| Caption * Mezzanine::UI::ListBox::AddSelection | ( | ConstString & | name, |
| ConstString & | Text, | ||
| ConstString & | BackgroundSprite = "" |
||
| ) | [virtual] |
Adds a selectable caption to the list to be displayed.
If a colour other then white was set as the template and you try to set a background sprite, it will attempt to blend the colour and sprite. Pure white colour will cause the sprite to look normal.
| name | A name for the selection. |
| Text | The text to be displayed within the created caption. |
| BackgroundSprite | Optional, name of the sprite to set as it's background. Ignored if the string is empty. |
Definition at line 346 of file uilistbox.cpp.
| void Mezzanine::UI::ListBox::DestroySelection | ( | Caption * | ToBeDestroyed | ) | [virtual] |
Destroys a selectable caption.
| ToBeDestroyed | A pointer to the caption you want destroyed and removed from this list. |
Definition at line 384 of file uilistbox.cpp.
| void Mezzanine::UI::ListBox::DestroySelection | ( | String & | ToBeDestroyed | ) | [virtual] |
Destroys a selectable caption.
| ToBeDestroyed | A string naming the caption you want destroyed and removed from this list. |
Definition at line 405 of file uilistbox.cpp.
| Rectangle * Mezzanine::UI::ListBox::GetBoxBack | ( | ) | [virtual] |
Gets the background of this List Box.
Definition at line 489 of file uilistbox.cpp.
| Caption * Mezzanine::UI::ListBox::GetSelected | ( | ) | [virtual] |
Gets the currently selected caption.
Definition at line 484 of file uilistbox.cpp.
| Caption * Mezzanine::UI::ListBox::GetSelection | ( | ConstString & | Name | ) | [virtual] |
Gets a caption by name.
| Name | The name of the selectable caption you want to get. |
Definition at line 371 of file uilistbox.cpp.
| const UI::TemplateParams & Mezzanine::UI::ListBox::GetTemplateInfo | ( | ) | [virtual] |
Gets the struct containing all the current template parameters used when creating a new selections.
Definition at line 341 of file uilistbox.cpp.
| UI::Scrollbar * Mezzanine::UI::ListBox::GetVertScroll | ( | ) | [virtual] |
Gets the scrollbar used within this List Box.
Definition at line 494 of file uilistbox.cpp.
| void Mezzanine::UI::ListBox::SetActualPosition | ( | const Vector2 & | Position | ) | [virtual] |
Sets the pixel position of this List Box.
| Position | A vector2 representing the pixel position of this List Box. |
Implements Mezzanine::UI::Widget.
Definition at line 448 of file uilistbox.cpp.
| void Mezzanine::UI::ListBox::SetActualSize | ( | const Vector2 & | Size | ) | [virtual] |
Sets the pixel size of this List Box.
| Size | A vector2 representing the pixel size of this List Box. |
Implements Mezzanine::UI::Widget.
Definition at line 462 of file uilistbox.cpp.
| void Mezzanine::UI::ListBox::SetAutoHideScroll | ( | bool | AutoHide | ) | [virtual] |
Eanbles or disables the scrollbar autohide.
| AutoHide | A bool indicating whether or not to auto hide the scrollbar. |
Definition at line 433 of file uilistbox.cpp.
| void Mezzanine::UI::ListBox::SetMaxDisplayedSelections | ( | const Whole & | MaxSelections | ) | [virtual] |
Sets the maximum number of selections to display at once before the scrollbar appears.
| MaxSelections | The maximum number of selections to display at once before requiring a scrollbar. This indirectly controls the max size of this widget. |
Definition at line 424 of file uilistbox.cpp.
| void Mezzanine::UI::ListBox::SetPosition | ( | const Vector2 & | Position | ) | [virtual] |
Sets the relative position of this List Box.
The position is relative to the screen size. Values range from 0.0 to 1.0.
| Position | A vector2 representing the relative position of this List Box. |
Implements Mezzanine::UI::Widget.
Definition at line 439 of file uilistbox.cpp.
| void Mezzanine::UI::ListBox::SetSelected | ( | Caption * | ToBeSelected | ) | [virtual] |
Sets the selection within this list to be "selected".
| ToBeSelected | A pointer to the caption to be set as "selected". |
Definition at line 418 of file uilistbox.cpp.
| void Mezzanine::UI::ListBox::SetSize | ( | const Vector2 & | Size | ) | [virtual] |
Sets the relative size of this List Box.
The size is relative to the screen size. Values range from 0.0 to 1.0.
| Size | A vector2 representing the relative size of this List Box. |
Implements Mezzanine::UI::Widget.
Definition at line 457 of file uilistbox.cpp.
| ListBox & Mezzanine::UI::ListBox::SetTemplateBackgroundColour | ( | const ColourValue & | BackgroundColour | ) | [virtual] |
Sets the background colour to be applied to all created Selections.
Optional parameter.
| BackgroundColour | The colour to set for the captions background. This defaults to white. |
Definition at line 317 of file uilistbox.cpp.
Set the cursor offset to be applied to all created Selections.
Optional parameter.
| Offset | The offset in pixels to adjust where text starts appearing in the caption. |
Definition at line 311 of file uilistbox.cpp.
Sets the glyph index to be applied to all created Selections.
This needs to be called prior to the creation of any selections(captions). This defaults to 0, which may not be a valid font index in your mta file. In which case it will throw an exception.
Definition at line 293 of file uilistbox.cpp.
| ListBox & Mezzanine::UI::ListBox::SetTemplateHorizontalAlign | ( | const UI::TextHorizontalAlign & | HorAlign | ) | [virtual] |
Sets the horizontal alignment to be applied to all created Selections.
Optional parameter.
| HorAlign | The horizontal text alignment. This defaults to UI::Middle. |
Definition at line 323 of file uilistbox.cpp.
| ListBox & Mezzanine::UI::ListBox::SetTemplateRenderPriority | ( | const UI::RenderPriority & | Priority | ) | [virtual] |
Sets the render priority to be applied to all created Selections.
Optional parameter.
| Priority | The priority with which to render the image. This defaults to UI::RP_Medium. |
Definition at line 335 of file uilistbox.cpp.
| ListBox & Mezzanine::UI::ListBox::SetTemplateSize | ( | const Vector2 & | Size, |
| bool | Relative = true |
||
| ) | [virtual] |
Sets the size to be applied to all created Selections.
| Size | The size of the caption to make. Applied to all captions created by this class. |
| Relative | Whether or not the size provided is in relative units(rather then pixels). |
Definition at line 277 of file uilistbox.cpp.
| ListBox & Mezzanine::UI::ListBox::SetTemplateTextColour | ( | const ColourValue & | TextColour | ) | [virtual] |
Sets the text colour to be applied to all created Selections.
Optional parameter.
| TextColour | The Colour of the text. This defaults to black. |
Definition at line 299 of file uilistbox.cpp.
Sets the text scale to be applied to all created Selections.
Optional parameter.
| Scale | The scale you wish to apply to the text in all created selections. |
Definition at line 305 of file uilistbox.cpp.
| ListBox & Mezzanine::UI::ListBox::SetTemplateVerticalAlign | ( | const UI::TextVerticalAlign & | VertAlign | ) | [virtual] |
Sets the vertical alignment to be applied to all created Selections.
Optional parameter.
| VertAlign | The Vertical text alignment. This defaults to UI::Center. |
Definition at line 329 of file uilistbox.cpp.
| void Mezzanine::UI::ListBox::UpdateDimensions | ( | ) | [virtual] |
Updates the dimensions of this widget to match those of the new screen size.
This function is called automatically when a viewport changes in size, and shouldn't need to be called manually.
Implements Mezzanine::UI::Widget.
Definition at line 467 of file uilistbox.cpp.
1.7.3