40 #ifndef _uidropdownlist_cpp
41 #define _uidropdownlist_cpp
43 #include "UI/uimanager.h"
44 #include "UI/dropdownlist.h"
45 #include "UI/listbox.h"
46 #include "UI/checkbox.h"
47 #include "UI/scrollbar.h"
48 #include "UI/screen.h"
49 #include "UI/verticalcontainer.h"
50 #include "UI/singlelinetextlayer.h"
51 #include "UI/renderlayergroup.h"
52 #include "UI/horizontallayoutstrategy.h"
54 #include "stringtool.h"
77 Widget(RendName,RendRect,Parent)
154 if( NewSelection != NULL ) {
157 if( NewSelectionActive != NULL && DisSelectionActive != NULL ) {
162 if( ( UncastedNewText != NULL && UncastedNewText->
IsTextLayer() ) &&
163 ( UncastedDisText != NULL && UncastedDisText->
IsTextLayer() ) )
178 if( DisSelectionActive != NULL ) {
180 if( UncastedDisText != NULL && UncastedDisText->
IsTextLayer() ) {
181 return static_cast<TextLayer*
>( UncastedDisText )->GetText();
312 if( SelectedArgs->Selected ) {
314 if( NewSelected != NULL ) {
361 NameValuePairMap::const_iterator ParamIt;
362 ParamIt = Params.find(
"ScrollbarStyle");
363 if( ParamIt != Params.end() )
373 NameValuePairMap::const_iterator ParamIt;
374 ParamIt = Params.find(
"ScrollbarStyle");
375 if( ParamIt != Params.end() )
This is a render layer specializing in single-line text.
virtual void ProtoSerializeChildQuads(XML::Node &SelfRoot) const
Convert the child quads of this class to an XML::Node ready for serialization.
virtual String GetSelectionText() const
Gets the text being displayed by the current selection.
virtual Rect GetRect() const
Gets this QuadRenderables' Rect.
virtual const String & GetTypeName() const
Gets the type of widget this is.
virtual ~DropDownList()
Class destructor.
bool Boole
Generally acts a single bit, true or false.
virtual Widget * GetSelectionDisplay() const
Gets the Widget displaying the current selection.
virtual void Show()
Forces this renderable to be shown.
virtual Vector2 HandleChildSizing(const Rect &OldSelfRect, const Rect &NewSelfRect, QuadRenderable *Child)
Handles the sizing of a child that needs it's dimensions updated.
virtual Boole IsSelected()
Gets whether this checkbox is selected or not.
virtual void _MarkAllLayersDirty()
Tells this QuadRenderable that all of it's layers are dirty.
Vector2 Size
Vector2 representing the width and height of the rect.
virtual void SetAutoTextScale(const TextLayer::ScalingMode Mode, const Real Scalar)
Sets the mode and scaler of auto-scaling applied to the text generated by this textlayer.
Unified dimensions are ignored and will instead us all available space.
virtual CheckBox * CreateCheckBox(const String &RendName)
Creates a CheckBox.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
virtual void ProtoDeSerializeChildQuads(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the ChildQuads of this object with it...
virtual void SetHorizontalPositioningRules(const Whole Rules)
Sets the behavior this quad will have when it is positioned automatically on the X axis...
virtual void UpdateDimensions(const Rect &OldSelfRect, const Rect &NewSelfRect)
Updates the dimensions of this QuadRenderable based on the transform of it's parent.
A simple reference counting pointer.
EventSubscriberSlot * Subscribe(const String &EventName, EventSubscriber *Sub)
Adds a subscriber to this event.
virtual String GetWidgetTypeName() const
Gets the name of the Widget that is created by this factory.
virtual void SetVisible(Boole CanSee)
Sets the visibility of this renderable.
This class represents a box shaped area on the screen.
ScrollbarStyle
Used by the scrollbar class to determine what styling should be used for the scrollbar.
virtual VerticalContainer * GetListContainer() const
Gets the ListItem container within this widget.
static const String EventChildSelected
Event name for when a child of this widget gets selected.
virtual Widget * GetChild(const UInt16 Zorder) const
Gets a child by it's ZOrder.
ChildContainer ChildWidgets
This is a container storing all the children that belong to this Quad.
virtual void ProtoSerializeChildQuads(XML::Node &SelfRoot) const
Convert the child quads of this class to an XML::Node ready for serialization.
static const String EventSelected
Event name for when this checkbox is Selected.
virtual void _NotifyEvent(EventArgumentsPtr Args)
Notifies this subscriber of an event being fired.
static String GetSerializableName()
Get the name of the the XML tag the Renderable class will leave behind as its instances are serialize...
CheckBox * ListToggle
A pointer to the CheckBox that will toggle the visibility of the Selection List.
Rect ActDims
The actual (pixel) position and size of this Quad on the screen it belongs to.
RenderLayer * GetLayerByZOrder(const UInt16 ZOrder) const
Gets a RenderLayer in this group by it's ZOrder.
virtual Real GetAutoTextScalar() const
Gets the relative scalar being used to automatically scale text generated by this layer...
This class represents a 2D rect which can express the size and position of a renderable on screen...
virtual DropDownList * CreateDropDownList(const String &RendName, const UI::ScrollbarStyle &Style, Screen *Parent)
Creates a new DropDownList.
Resizing will use the provided unified dimensions with no further alterations. This is the default fo...
virtual void RemoveChild(Widget *ToBeRemoved)
Removes a child Widget from this quadrenderable.
The calculated value for the perpendicular axis will be used as the final value for this axis...
virtual void DestroyWidget(Widget *ToBeDestroyed)
Destroys a widget.
A light-weight handle for manipulating nodes in DOM tree.
static const String TypeName
String containing the type name for this class: "DropDownList".
Real X
Coordinate on the X vector.
virtual FontData * GetDefaultFont()
Gets the default font in use by this layer.
virtual void SetScrollbarWidth(const UnifiedDim &ScrollWidth)
Sets the Unified width of the child scrollbar in this ListBox.
ListBox * SelectionList
A pointer to the ListBox holding all possible selections.
virtual void SetHorizontalSizingRules(const Whole Rules)
Sets the behavior this quad will have on the X axis when it is resized.
virtual void UpdateCurrentSelection(Widget *NewSelection)
Configures the selection display of this DropDownList to match the new selection. ...
virtual Vector2 GetActualSize() const
Gets the pixel size of this widget.
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
RenderLayerGroup * GetActiveGroup() const
Gets the current RenderLayerGroup used for rendering.
void AddLayerToGroup(RenderLayer *Layer, const UInt16 LayerZOrder, const UInt16 GroupID)
Adds a RenderLayer to the specified group.
virtual void Layout(const Rect &OldSelfRect, const Rect &NewSelfRect, const ChildContainer &ChildQuads)
Updates the dimensions of a collection of QuadRenderables.
String Name
The unique name of this Renderable.
virtual void Hide()
Forces this renderable to hide.
virtual String GetText() const
Gets the text displayed within this layer.
Thrown when the available information should have worked but failed for unknown reasons.
virtual TextLayer::ScalingMode GetAutoTextScalingMode() const
Gets the automatic scaling mode being used by this textlayer.
virtual void AddChild(Widget *Child)
Adds a Widget to this as a child of this quad.
virtual void _SetLayoutStrat(LayoutStrategy *ToSet)
Sets a new LayoutStrategy for this quad to use.
Widget * SelectionDisplay
A pointer to a copy of the ListItem that is the current selection.
virtual Boole IsTextLayer() const
Gets whether or not this is a TextLayer.
DropDownList(Screen *Parent)
Blank constructor.
This class stores a group of render layers that can be set to be rendered.
static const String EventDeselected
Event name for when this checkbox is Deselected.
virtual Widget * CreateWidget(Screen *Parent)
Creates a Widget of the type represented by this factory.
This class represents both the relative and absolute values that can be expressed for the values on o...
virtual ListBox * CreateListBox(const String &RendName, const UI::ScrollbarStyle Style)
Creates a ListBox.
virtual Widget * GetWidget(const String &Name)
Gets a widget in this screen by name.
The bulk of the engine components go in this namspace.
virtual void SetVerticalSizingRules(const Whole Rules)
Sets the behavior this quad will have on the Y axis when it is resized.
virtual void ConstructDropDownList(const UI::ScrollbarStyle &Style)
Convenience method for the construction of a DropDownList.
virtual ListBox * GetSelectionList() const
Gets the ListBox containing all the list options.
virtual void DestroyWidget(Widget *ToBeDestroyed)
Destroys a Widget created by this factory.
virtual Vector2 HandleChildPositioning(const Rect &OldSelfRect, const Rect &NewSelfRect, const Vector2 &NewChildSize, QuadRenderable *Child)
Handles the positioning of a child that needs it's dimensions updated.
virtual void ManualSelect(Boole Select)
Manually select or deselect this checkbox.
Anchors to the right side of the quad.
virtual void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
This is a simple widget for storing a bool value.
virtual void UpdateDimensions()
Updates the dimensions of this QuadRenderable based on the transform of it's parent.
SingleLineTextLayer * CreateSingleLineTextLayer()
Creats a SingleLineTextLayer for this renderable.
Vector2 Position
Vector2 representing the top-left position of the rect.
virtual void SetDefaultFont(FontData *NewFont)
Sets the default font to be used with this layer.
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
virtual void SetText(const String &Text)
Sets the text displayed within this layer.
std::map< String, String > NameValuePairMap
This is a datatype mostly used for describing settings or parameters that can't be declared in advanc...
virtual void ProtoDeSerializeChildQuads(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the ChildQuads of this object with it...
This class is a helper class for creating UI's. It is responsible for storing and keeping track of al...
LayoutStrategy * LayoutStrat
This is a pointer to the strategy being used by this Quad to determine the positions and sizes of chi...
std::string String
A datatype used to a series of characters.
This is a base class for render layers that render text.
This is a specialization of a layout strategy where a group of quads are sized and placed in a linear...
virtual CheckBox * GetListToggle() const
Gets the CheckBox that toggles the selection list visibility.
This is the base class for the types of layers that can be added to a renderable. ...
This is a widget that displays one selection from a list that can have it's visibility toggled...
Screen * ParentScreen
A pointer to the Screen that created this Renderable.
This is a widget for displaying a list of captions in a box.
virtual Widget * CreateWidget(const XML::Node &WidgetNode)
Creates a widget from an XML::Node.