43 #include "UI/widget.h"
44 #include "UI/button.h"
45 #include "UI/screen.h"
47 #include "UI/uimanager.h"
49 #include "Input/inputmanager.h"
50 #include "Input/mouse.h"
71 HoveredSubWidget(NULL),
77 HoveredSubWidget(NULL),
83 HoveredSubWidget(NULL),
89 HoveredSubWidget(NULL),
149 {
return Renderable::RT_Widget; }
155 {
return (this->
State & WS_Hovered); }
158 {
return (this->
State & WS_Focused); }
161 {
return (this->
State & WS_Dragged); }
215 (*It)->SetVisible(CanSee);
289 SerializeError(
"Create XML Version Attribute",
"StateGroupBinding",
true);
293 SerializeError(
"Create XML Version Attribute",
"StateGroupBindings",
true);
326 if( !PropertiesNode.
Empty() ) {
329 if( !CurrAttrib.
Empty() )
346 if( !BindingsNode.
Empty() ) {
350 if( (*BindingNodeIt).GetAttribute(
"Version").AsInt() == 1 ) {
354 CurrAttrib = (*BindingNodeIt).GetAttribute(
"StateID");
355 if( !CurrAttrib.
Empty() )
356 StateID = CurrAttrib.
AsUint();
358 CurrAttrib = (*BindingNodeIt).GetAttribute(
"LayerGroupName");
359 if( !CurrAttrib.
Empty() )
360 LayerGroupName = CurrAttrib.
AsString();
362 if( !LayerGroupName.empty() ) {
364 if( NamedGroup != NULL ) {
365 this->
StateGroupBindings.insert( std::pair<UInt32,RenderLayerGroup*>(StateID,NamedGroup) );
368 ExceptionStream <<
"Named RenderLayerGroup \"" << LayerGroupName <<
"\" not found when deserializing Widget named \"" << this->
GetName() <<
"\".";
389 if( !EventsNode.
Empty() ) {
393 if( (*EvNodeIt).GetAttribute(
"Version").AsInt() == 1 ) {
396 CurrAttrib = (*EvNodeIt).GetAttribute(
"Name");
397 if( !CurrAttrib.
Empty() )
400 if( !EvName.empty() ) {
428 this->
State |= WS_Hovered;
437 if( this->
State & WS_Hovered )
439 this->
State &= ~WS_Hovered;
449 this->
State |= WS_Dragged;
464 if( this->
State & WS_Dragged )
466 this->
State &= ~WS_Dragged;
476 this->
State |= WS_Focused;
485 if( this->
State & WS_Focused )
487 this->
State &= ~WS_Focused;
528 return static_cast<Widget*>(this->
ParentQuad)->_HandleInput(Code);
545 {
return new Widget(RendName,Parent); }
548 {
return new Widget(RendName,RendRect,Parent); }
551 {
return new Widget(Parent); }
554 {
return new Widget(RendName,Parent); }
557 {
return new Widget(RendName,RendRect,Parent); }
560 {
return new Widget(XMLNode,Parent); }
563 {
delete ToBeDestroyed; }