Spinning Topp Logo BlackTopp Studios
inc
menuentry.cpp
1 // © Copyright 2010 - 2016 BlackTopp Studios Inc.
2 /* This file is part of The Mezzanine Engine.
3 
4  The Mezzanine Engine is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  The Mezzanine Engine is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with The Mezzanine Engine. If not, see <http://www.gnu.org/licenses/>.
16 */
17 /* The original authors have included a copy of the license specified above in the
18  'Docs' folder. See 'gpl.txt'
19 */
20 /* We welcome the use of the Mezzanine engine to anyone, including companies who wish to
21  Build professional software and charge for their product.
22 
23  However there are some practical restrictions, so if your project involves
24  any of the following you should contact us and we will try to work something
25  out:
26  - DRM or Copy Protection of any kind(except Copyrights)
27  - Software Patents You Do Not Wish to Freely License
28  - Any Kind of Linking to Non-GPL licensed Works
29  - Are Currently In Violation of Another Copyright Holder's GPL License
30  - If You want to change our code and not add a few hundred MB of stuff to
31  your distribution
32 
33  These and other limitations could cause serious legal problems if you ignore
34  them, so it is best to simply contact us or the Free Software Foundation, if
35  you have any questions.
36 
37  Joseph Toppi - toppij@gmail.com
38  John Blackwood - makoenergy02@gmail.com
39 */
40 #ifndef _uimenuentry_cpp
41 #define _uimenuentry_cpp
42 
43 #include "UI/menuentry.h"
44 #include "UI/stackbutton.h"
45 #include "UI/uimanager.h"
46 #include "UI/screen.h"
47 #include "UI/layoutstrategy.h"
48 
49 #include "stringtool.h"
50 #include "exception.h"
51 #include "serialization.h"
52 
53 namespace Mezzanine
54 {
55  namespace UI
56  {
57  ///////////////////////////////////////////////////////////////////////////////
58  // MenuEntry Static Members
59 
60  const String MenuEntry::TypeName = "MenuEntry";
61 
62  ///////////////////////////////////////////////////////////////////////////////
63  // MenuEntry Methods
64 
66  StackedContainer(Parent),
67  MenuStack(NULL),
68  PushButton(NULL),
69  PopButton(NULL),
70  AutoHideEntry(true)
71  { }
72 
73  MenuEntry::MenuEntry(const String& RendName, Screen* Parent) :
74  StackedContainer(RendName,Parent),
75  MenuStack(NULL),
76  PushButton(NULL),
77  PopButton(NULL),
78  AutoHideEntry(true)
79  { }
80 
81  MenuEntry::MenuEntry(const String& RendName, const UnifiedRect& RendRect, Screen* Parent) :
82  StackedContainer(RendName,RendRect,Parent),
83  MenuStack(NULL),
84  PushButton(NULL),
85  PopButton(NULL),
86  AutoHideEntry(true)
87  { }
88 
89  MenuEntry::MenuEntry(const XML::Node& XMLNode, Screen* Parent) :
90  StackedContainer(Parent),
91  MenuStack(NULL),
92  PushButton(NULL),
93  PopButton(NULL),
94  AutoHideEntry(true)
95  { }
96 
98  { }
99 
101  {
102  if( this->MenuStack ) {
103  if( ( this->IsRootEntry() && this->MenuStack->empty() ) ||
104  ( !(this->MenuStack->empty()) && this->MenuStack->back() == this->ParentQuad ) )
105  {
106  if( !(this->MenuStack->empty()) && this->MenuStack->back()->GetAutoHide() ) {
107  this->MenuStack->back()->Hide();
108  }
109  this->MenuStack->push_back(this);
110  this->Show();
111  return true;
112  }
113  }
114  return false;
115  }
116 
118  {
119  if( this->MenuStack ) {
120  if( this->IsTopOfStack() ) {
121  this->MenuStack->pop_back();
122  if( !this->MenuStack->empty() ) {
123  this->MenuStack->back()->Show();
124  }
125  this->Hide();
126  return true;
127  }
128  }
129  return false;
130  }
131 
132  ///////////////////////////////////////////////////////////////////////////////
133  // Utility Methods
134 
136  {
137  if( this->ParentQuad != NULL && this->ParentQuad->IsWidget() ) {
138  return ( static_cast<Widget*>( this->ParentQuad )->GetTypeName() != MenuEntry::TypeName );
139  }else{
140  return true;
141  }
142  }
143 
145  {
146  if( this->MenuStack && !(this->MenuStack->empty()) ) {
147  return ( this->MenuStack->back() == this );
148  }
149  return false;
150  }
151 
153  {
154  if( this->MenuStack ) {
155  if( RollBackTo != NULL && !(this->MenuStack->empty()) ) {
156  Whole Ret = 0;
157  MenuEntryIterator MenuBeg = this->MenuStack->begin();
158  MenuEntryIterator MenuEnd = this->MenuStack->end();
159  while( MenuBeg != MenuEnd )
160  {
161  if( (*MenuBeg) == RollBackTo ) {
162  ++MenuBeg;
163  break;
164  }else{
165  ++MenuBeg;
166  }
167  }
168 
169  for( MenuEntryIterator MenuIt = MenuBeg ; MenuIt != MenuEnd ; ++MenuIt )
170  {
171  (*MenuIt)->Hide();
172  ++Ret;
173  }
174  this->MenuStack->erase(MenuBeg,MenuEnd);
175  RollBackTo->Show();
176  return Ret;
177  }
178  }
179  return 0;
180  }
181 
183  {
184  if( this->IsRootEntry() ) {
185  this->PushOntoStack();
186  }else{
187  static_cast<MenuEntry*>( this->ParentQuad )->ForceRootEntryVisible();
188  }
189  }
190 
192  {
193  return MenuEntry::TypeName;
194  }
195 
196  ///////////////////////////////////////////////////////////////////////////////
197  // Visibility and Priority Methods
198 
200  {
201  if( CanSee ) {
202  if( !this->AutoHideEntry || this->IsTopOfStack() ) {
203  this->Widget::SetVisible(CanSee);
204  }
205  }else{
206  this->Widget::SetVisible(CanSee);
207  }
208  }
209 
211  {
212  if( !this->AutoHideEntry || this->IsTopOfStack() )
213  this->Widget::Show();
214  }
215 
217  {
218  this->Widget::Hide();
219  }
220 
221  ///////////////////////////////////////////////////////////////////////////////
222  // MenuEntry Properties
223 
225  { this->AutoHideEntry = AutoHide; }
226 
228  { return this->AutoHideEntry; }
229 
230  ///////////////////////////////////////////////////////////////////////////////
231  // Menu Configuration
232 
233  void MenuEntry::SetButtonConfig(const UInt16 Config, StackButton* ConfigButton)
234  {
235  switch( Config )
236  {
237  case MenuEntry::BC_ToggleButton: this->SetToggleButton(ConfigButton); break;
238  case MenuEntry::BC_PushButton: this->SetPushButton(ConfigButton); break;
239  case MenuEntry::BC_PopButton: this->SetPopButton(ConfigButton); break;
240  default:
241  { MEZZ_EXCEPTION(ExceptionBase::PARAMETERS_EXCEPTION,"Invalid config passed in while attempting to set a stack button configuration."); } break;
242  }
243  }
244 
245  UInt16 MenuEntry::GetButtonConfig(const StackButton* ConfigButton) const
246  {
247  if( this->PushButton == ConfigButton && this->PopButton == ConfigButton ) {
249  }else if( this->PushButton == ConfigButton ) {
251  }else if( this->PopButton == ConfigButton ) {
253  }else{
254  return MenuEntry::BC_Error;
255  }
256  }
257 
259  {
260  if( this->PushButton != NULL ) {
261  this->PushButton->_SetBoundContainer(NULL);
262  }
263 
264  this->PushButton = Push;
265 
266  if( this->PushButton != NULL ) {
267  this->PushButton->_SetBoundContainer(this);
268  }
269  }
270 
272  {
273  return this->PushButton;
274  }
275 
277  {
278  if( this->PopButton != NULL ) {
279  this->PopButton->_SetBoundContainer(NULL);
280  }
281 
282  this->PopButton = Pop;
283 
284  if( this->PopButton != NULL ) {
285  this->PopButton->_SetBoundContainer(this);
286  }
287  }
288 
290  {
291  return this->PopButton;
292  }
293 
295  {
296  if( this->PushButton != NULL ) {
297  this->PushButton->_SetBoundContainer(NULL);
298  }
299  if( this->PopButton != NULL ) {
300  this->PopButton->_SetBoundContainer(NULL);
301  }
302 
303  this->PushButton = Toggle;
304  this->PopButton = Toggle;
305 
306  if( this->PushButton != NULL ) {
307  this->PushButton->_SetBoundContainer(this);
308  }
309  }
310 
311  ///////////////////////////////////////////////////////////////////////////////
312  // Serialization
313 
315  {
316  this->Widget::ProtoSerializeProperties(SelfRoot);
317 
318  XML::Node PropertiesNode = SelfRoot.AppendChild( MenuEntry::GetSerializableName() + "Properties" );
319 
320  if( PropertiesNode.AppendAttribute("Version").SetValue("1") &&
321  PropertiesNode.AppendAttribute("AutoHideEntry").SetValue( this->GetAutoHide() ? "true" : "false" ) )
322  {
323  // Only if we have valid bindings
324  if( this->PushButton != NULL ) {
325  if( PropertiesNode.AppendAttribute("PushButtonName").SetValue( this->PushButton->GetName() ) ) {
326  return;
327  }else{
328  SerializeError("Create XML Attribute Values",MenuEntry::GetSerializableName() + "Properties",true);
329  }
330  }
331 
332  if( this->PopButton != NULL ) {
333  if( PropertiesNode.AppendAttribute("PopButtonName").SetValue( this->PopButton->GetName() ) ) {
334  return;
335  }else{
336  SerializeError("Create XML Attribute Values",MenuEntry::GetSerializableName() + "Properties",true);
337  }
338  }
339  }else{
340  SerializeError("Create XML Attribute Values",MenuEntry::GetSerializableName() + "Properties",true);
341  }
342  }
343 
345  {
346  this->Widget::ProtoDeSerializeProperties(SelfRoot);
347 
348  XML::Attribute CurrAttrib;
349  XML::Node PropertiesNode = SelfRoot.GetChild( MenuEntry::GetSerializableName() + "Properties" );
350 
351  if( !PropertiesNode.Empty() ) {
352  if(PropertiesNode.GetAttribute("Version").AsInt() == 1) {
353  CurrAttrib = PropertiesNode.GetAttribute("AutoHideEntry");
354  if( !CurrAttrib.Empty() )
355  this->SetAutoHide( StringTools::ConvertToBool( CurrAttrib.AsString(), true ) );
356 
357  CurrAttrib = PropertiesNode.GetAttribute("PushButtonName");
358  if( !CurrAttrib.Empty() ) {
359  Widget* UncastedButton = this->ParentScreen->GetWidget( CurrAttrib.AsString() );
360  if( UncastedButton->GetTypeName() == StackButton::TypeName ) {
361  this->SetPushButton( static_cast<StackButton*>( UncastedButton ) );
362  }else{
363  MEZZ_EXCEPTION(ExceptionBase::PARAMETERS_EXCEPTION,"Expected name of MenuButton when deserializing. Named widget is not MenuButton.");
364  }
365  }
366 
367  CurrAttrib = PropertiesNode.GetAttribute("PopButtonName");
368  if( !CurrAttrib.Empty() ) {
369  Widget* UncastedButton = this->ParentScreen->GetWidget( CurrAttrib.AsString() );
370  if( UncastedButton->GetTypeName() == StackButton::TypeName ) {
371  this->SetPopButton( static_cast<StackButton*>( UncastedButton ) );
372  }else{
373  MEZZ_EXCEPTION(ExceptionBase::PARAMETERS_EXCEPTION,"Expected name of MenuButton when deserializing. Named widget is not MenuButton.");
374  }
375  }
376  }else{
377  MEZZ_EXCEPTION(ExceptionBase::INVALID_VERSION_EXCEPTION,"Incompatible XML Version for " + (MenuEntry::GetSerializableName() + "Properties") + ": Not Version 1.");
378  }
379  }else{
380  MEZZ_EXCEPTION(ExceptionBase::II_IDENTITY_NOT_FOUND_EXCEPTION,MenuEntry::GetSerializableName() + "Properties" + " was not found in the provided XML node, which was expected.");
381  }
382  }
383 
385  {
386  return MenuEntry::TypeName;
387  }
388 
389  ///////////////////////////////////////////////////////////////////////////////
390  // Internal Event Methods
391 
392 
393 
394  ///////////////////////////////////////////////////////////////////////////////
395  // Internal Methods
396 
398  {
399  return this->MenuStack;
400  }
401 
403  {
404  if( this->MenuStack != NewStack ) {
405  this->MenuStack = NewStack;
406  this->Hide();
407 
408  for( ChildIterator ChildIt = this->ChildWidgets.begin() ; ChildIt != this->ChildWidgets.end() ; ++ChildIt )
409  {
410  if( (*ChildIt)->GetTypeName() == MenuEntry::TypeName ) {
411  static_cast<MenuEntry*>( (*ChildIt) )->_NotifyStack(NewStack);
412  }
413  }
414  }
415  }
416 
418  {
419  if( Selected != NULL && Selected->IsHovered() ) {
420  if( this->PushButton == Selected && this->PopButton == Selected ) {
421  // Since we are toggling, attempt to push first. It'll automatically do the checks needed for pushing.
422  Boole PushResult = this->PushOntoStack();
423  if( !PushResult ) {
424  // If it failed to push, try popping.
425  Boole PopResult = this->PopFromStack();
426  if( !PopResult ) {
427  // If even that failed, then we almost certainly need to do a rollback
428  Boole IsRoot = this->IsRootEntry();
429  this->RollBackToEntry( IsRoot ? this : static_cast<MenuEntry*>( this->ParentQuad ) );
430  if( !IsRoot ) {
431  // Last attempt
432  this->PushOntoStack();
433  }
434  }
435  }
436  }else if( this->PushButton == Selected ) {
437  Boole PushResult = this->PushOntoStack();
438  if( !PushResult ) {
439  // Attempt a rollback
440  Boole IsRoot = this->IsRootEntry();
441  this->RollBackToEntry( IsRoot ? this : static_cast<MenuEntry*>( this->ParentQuad ) );
442  if( !IsRoot ) {
443  // Last attempt
444  this->PushOntoStack();
445  }
446  }
447  }else if( this->PopButton == Selected ) {
448  this->PopFromStack();
449  /*Boole PopResult = this->PopFromStack();
450  if( !PopResult ) {
451  // Is there anything to do here?
452  }// */
453  }
454  }
455  }
456 
458  {
459  if( this->ParentQuad != NewParent ) {
460  this->QuadRenderable::_NotifyParenthood(NewParent);
461 
462  if( this->ParentQuad != NULL ) {
463  // Do the necessary checks to see if we have an updated stack.
464  MenuEntryContainer* UpdatedStack = ( this->IsRootEntry() ? new MenuEntryContainer() : static_cast<MenuEntry*>( this->ParentQuad )->_GetMenuStack() );
465  if( this->MenuStack != UpdatedStack ) {
466  // Preserve the Old stack for later.
467  MenuEntryContainer* OldStack = this->MenuStack;
468  // Notify all the children of the new stack.
469  this->_NotifyStack(UpdatedStack);
470  // Finally we can destroy the old one.
471  delete OldStack;
472  }
473  }else{
474  // If we're here, we're likely being destroyed. Even if not then a menu outside of the widget heirarchy has no use for a stack.
475  // So destroy what we have, and set the lower entries accordingly. They shouldn't need to do the same when they get their turn running this logic.
476  if( this->MenuStack != NULL ) {
477  delete this->MenuStack;
478  this->MenuStack = NULL;
479  }
480  this->_NotifyStack(this->MenuStack);
481  }
482  }
483  }
484 
485  ///////////////////////////////////////////////////////////////////////////////
486  // MenuEntryFactory Methods
487 
489  { return MenuEntry::TypeName; }
490 
492  {
493  MenuEntry* Ret = new MenuEntry(RendName,Parent);
494  Ret->_SetLayoutStrat( new LayoutStrategy() );
495  return Ret;
496  }
497 
498  MenuEntry* MenuEntryFactory::CreateMenuEntry(const String& RendName, const UnifiedRect& RendRect, Screen* Parent)
499  {
500  MenuEntry* Ret = new MenuEntry(RendName,RendRect,Parent);
501  Ret->_SetLayoutStrat( new LayoutStrategy() );
502  return Ret;
503  }
504 
506  {
507  MenuEntry* Ret = new MenuEntry(XMLNode,Parent);
508  Ret->_SetLayoutStrat( new LayoutStrategy() );
509  return Ret;
510  }
511 
513  {
514  MenuEntry* Ret = new MenuEntry(Parent);
515  Ret->_SetLayoutStrat( new LayoutStrategy() );
516  return Ret;
517  }
518 
519  Widget* MenuEntryFactory::CreateWidget(const String& RendName, const NameValuePairMap& Params, Screen* Parent)
520  { return this->CreateMenuEntry(RendName,Parent); }
521 
522  Widget* MenuEntryFactory::CreateWidget(const String& RendName, const UnifiedRect& RendRect, const NameValuePairMap& Params, Screen* Parent)
523  { return this->CreateMenuEntry(RendName,RendRect,Parent); }
524 
526  { return this->CreateMenuEntry(XMLNode,Parent); }
527 
529  { delete static_cast<MenuEntry*>( ToBeDestroyed ); }
530  }//UI
531 }//Mezzanine
532 
533 #endif
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
const String & GetName() const
Gets the name of this renderable.
Definition: renderable.cpp:77
virtual Boole IsRootEntry() const
Gets whether or not this is the Root of the MenuEntry hierarchy.
Definition: menuentry.cpp:135
A light-weight handle for manipulating attributes in DOM tree.
Definition: attribute.h:74
virtual void Show()
Forces this renderable to be shown.
Definition: widget.cpp:257
This is a base class for the algorithms used by QuadRenderables to determine how they should update t...
virtual const String & GetTypeName() const
Gets the type of widget this is.
Definition: menuentry.cpp:191
virtual void SetPushButton(StackButton *Push)
Sets the button that will push(add) this entry on the menu stack, making it visible.
Definition: menuentry.cpp:258
bool Boole
Generally acts a single bit, true or false.
Definition: datatypes.h:173
virtual Boole PushOntoStack()
Pushes this MenuEntry onto the stack if one is available.
Definition: menuentry.cpp:100
virtual StackButton * GetPopButton() const
Gets a pointer to the button that will remove this entry from the menu stack.
Definition: menuentry.cpp:289
virtual void SetPopButton(StackButton *Pop)
Sets the button that will pop(remove) this entry from the menu stack, hiding it.
Definition: menuentry.cpp:276
virtual Boole PopFromStack()
Pops this MenuEntry from the stack if one is available.
Definition: menuentry.cpp:117
StackButton * PopButton
A pointer to the button that will pop this entry from the menu stack.
Definition: menuentry.h:87
virtual void DestroyWidget(Widget *ToBeDestroyed)
Destroys a Widget created by this factory.
Definition: menuentry.cpp:528
virtual void SetVisible(Boole CanSee)
Sets the visibility of this renderable.
Definition: menuentry.cpp:199
static const String TypeName
String containing the type name for this class: "MenuEntry".
Definition: menuentry.h:77
virtual const String & GetTypeName() const
Gets the type of widget this is.
Definition: widget.cpp:156
Thrown when the requested identity could not be found.
Definition: exception.h:94
MenuEntryContainer * _GetMenuStack() const
Gets the MenuStack this Entry belongs to.
Definition: menuentry.cpp:397
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
Definition: exception.h:3048
std::vector< MenuEntry * > MenuEntryContainer
Basic container type for child MenuEntry storage by this class.
Definition: menuentry.h:61
virtual void Show()
Forces this renderable to be shown.
Definition: menuentry.cpp:210
This is a button with additional data used to track the binding to a StackedContainer which can be se...
Definition: stackbutton.h:54
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
Definition: widget.cpp:278
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
Definition: exception.h:112
Boole AutoHideEntry
Stores whether or not this Entry will automatically be hidden when another entry is pushed onto the s...
Definition: menuentry.h:90
const Char8 * AsString(const Char8 *def="") const
Attempts to convert the value of the attribute to a String and returns the results.
virtual Boole IsHovered() const
Gets the result of the last mouse hover check.
Definition: widget.cpp:159
virtual void SetAutoHide(Boole AutoHide)
Sets whether or not thie window should auto hide when another window is added to the menu stack...
Definition: menuentry.cpp:224
bool Empty() const
Is this storing anything at all?
This implements the exception hiearchy for Mezzanine.
virtual void _NotifyStack(MenuEntryContainer *NewStack)
Notifies this MenuEntry and all if it's Entry children a new MenuStack is being applied to the menu t...
Definition: menuentry.cpp:402
MenuEntry(Screen *Parent)
Blank constructor.
Definition: menuentry.cpp:65
ChildContainer ChildWidgets
This is a container storing all the children that belong to this Quad.
virtual Boole GetAutoHide() const
Gets wether or not this window is set to auto hide when another window is added to the menu stack...
Definition: menuentry.cpp:227
virtual void SetToggleButton(StackButton *Toggle)
Sets the button that will both push(add) and pop(remove) the entry from the menu stack, based on the current state of the entry.
Definition: menuentry.cpp:294
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
Definition: menuentry.cpp:344
The interface for serialization.
bool SetValue(const Char8 *rhs)
Set the value of this.
Error condition or queried button isn't bound to this MenuEntry.
Definition: menuentry.h:70
This class represents a 2D rect which can express the size and position of a renderable on screen...
Definition: unifieddim.h:661
uint16_t UInt16
An 16-bit unsigned integer.
Definition: datatypes.h:122
Boole ConvertToBool(const String &ToConvert, const Boole Default)
Converts a string into a Boole.
Definition: stringtool.cpp:379
virtual void _NotifyButtonSelected(StackButton *Selected)
Notifies this StackedContainer a button has been selected.
Definition: menuentry.cpp:417
A light-weight handle for manipulating nodes in DOM tree.
Definition: node.h:89
static const String TypeName
String containing the type name for this class: "StackButton".
Definition: stackbutton.h:58
This is the base class for containers that stack their children one on top of the other...
int AsInt(int def=0) const
Attempts to convert the value of the attribute to an int and returns the results. ...
virtual void Hide()
Forces this renderable to hide.
Definition: menuentry.cpp:216
StackButton * PushButton
A pointer to the button that will push this entry on the menu stack.
Definition: menuentry.h:84
bool Empty() const
Is this storing anything at all?
This is the base class for all widgets.
Definition: widget.h:126
MenuEntryContainer * MenuStack
A pointer to the active stack of MenuEntries.
Definition: menuentry.h:81
MenuEntryContainer::iterator MenuEntryIterator
Iterator type for child MenuEntry instances stored by this class.
Definition: menuentry.h:63
virtual void ForceRootEntryVisible()
Forces the root entry to push itself onto the stack. Useful for always visible root entries...
Definition: menuentry.cpp:182
virtual Whole RollBackToEntry(MenuEntry *RollBackTo)
Finds a MenuEntry in the menu stack and hides all Entries above it in the menu stack.
Definition: menuentry.cpp:152
This class is an entry for a single window/widget in a menu.
Definition: menuentry.h:57
Queried button is being used as the entry pop button.
Definition: menuentry.h:72
virtual String GetWidgetTypeName() const
Gets the name of the Widget that is created by this factory.
Definition: menuentry.cpp:488
virtual Widget * CreateWidget(Screen *Parent)
Creates a Widget of the type represented by this factory.
Definition: menuentry.cpp:512
static String GetSerializableName()
Get the name of the the XML tag the Renderable class will leave behind as its instances are serialize...
Definition: menuentry.cpp:384
Thrown when parameters are checked at runtime and found invalid.
Definition: exception.h:108
virtual void _SetLayoutStrat(LayoutStrategy *ToSet)
Sets a new LayoutStrategy for this quad to use.
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
Definition: menuentry.cpp:314
Queried button is being used as the entry push button.
Definition: menuentry.h:71
virtual void Hide()
Forces this renderable to hide.
Definition: widget.cpp:266
virtual Widget * GetWidget(const String &Name)
Gets a widget in this screen by name.
Definition: screen.cpp:573
virtual UInt16 GetButtonConfig(const StackButton *ConfigButton) const
Gets the role of the specified StackedButton for this StackedContainer.
Definition: menuentry.cpp:245
The bulk of the engine components go in this namspace.
Definition: actor.cpp:56
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
Definition: datatypes.h:151
Queried button is being used as both the push and pop button, aka toggle button.
Definition: menuentry.h:73
ChildContainer::iterator ChildIterator
Iterator type for Widget instances stored by this class.
virtual Boole IsTopOfStack() const
Gets whether or not this MenuEntry is at the top of the menu stack.
Definition: menuentry.cpp:144
virtual void SetVisible(Boole CanSee)
Sets the visibility of this renderable.
Definition: widget.cpp:229
virtual void _SetBoundContainer(StackedContainer *ToBeBound)
Notifies this StackButton that a StackedContainer has been bound to it.
virtual void SetButtonConfig(const UInt16 Config, StackButton *ConfigButton)
Binds a StackedButton to this container according to the provided config value.
Definition: menuentry.cpp:233
Boole IsWidget() const
Gets whether or not this renderable is a Widget.
Definition: renderable.cpp:83
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
Definition: widget.cpp:337
This represents a nestable quad for an object in a GUI layout.
virtual void _NotifyParenthood(QuadRenderable *NewParent)
Notifies this QuadRenderable that it has been added to another QuadRenderable.
Definition: menuentry.cpp:457
virtual StackButton * GetPushButton() const
Gets a pointer to the button that will add this entry to the menu stack.
Definition: menuentry.cpp:271
virtual ~MenuEntry()
Class destructor.
Definition: menuentry.cpp:97
void SerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
virtual MenuEntry * CreateMenuEntry(const String &RendName, Screen *Parent)
Creates a new MenuEntry.
Definition: menuentry.cpp:491
Node AppendChild(NodeType Type=NodeElement)
Creates a Node and makes it a child of this one.
std::map< String, String > NameValuePairMap
This is a datatype mostly used for describing settings or parameters that can't be declared in advanc...
Definition: datatypes.h:209
This class is a helper class for creating UI's. It is responsible for storing and keeping track of al...
Definition: screen.h:142
std::string String
A datatype used to a series of characters.
Definition: datatypes.h:159
QuadRenderable * ParentQuad
This is a pointer to the Quad that owns this Quad and is responsible for transform updates applied to...
Attribute GetAttribute(const Char8 *Name) const
Attempt to get an Attribute on this Node with a given name.
Node GetChild(const Char8 *Name) const
Attempt to get a child Node with a given name.
Screen * ParentScreen
A pointer to the Screen that created this Renderable.
Definition: renderable.h:72
virtual void _NotifyParenthood(QuadRenderable *NewParent)
Notifies this QuadRenderable that it has been added to another QuadRenderable.