40 #ifndef _uinineboxstrategy_cpp
41 #define _uinineboxstrategy_cpp
43 #include "UI/nineboxstrategy.h"
44 #include "UI/screen.h"
45 #include "UI/widget.h"
80 for( NineBoxStrategy::PartitionVec::iterator It =
Partitions->begin() ; It !=
Partitions->end() ; ++It )
82 if( (*It)->PartitionRect.CheckOverlap(Wid->
GetRect()) )
83 (*It)->Widgets.push_back(Wid);
107 for( PartitionVec::iterator It = this->
Partitions.begin() ; It != this->
Partitions.end() ; ++It )
119 for( PartitionVec::iterator It = this->
Partitions.begin() ; It != this->
Partitions.end() ; ++It )
122 (*It)->Widgets.clear();
134 Vector2 ThirdSize(ScreenSize.
X / 3,ScreenSize.
Y / 3);
137 case NBP_TopLeft:
return Rect(
Vector2(0,0),ThirdSize);
break;
138 case NBP_TopCenter:
return Rect(
Vector2(ThirdSize.
X * 1,0),ThirdSize);
break;
139 case NBP_TopRight:
return Rect(
Vector2(ThirdSize.
X * 2,0),ThirdSize);
break;
140 case NBP_LeftCenter:
return Rect(
Vector2(0,ThirdSize.
Y * 1),ThirdSize);
break;
141 case NBP_Center:
return Rect(
Vector2(ThirdSize.
X * 1,ThirdSize.
Y * 1),ThirdSize);
break;
142 case NBP_RightCenter:
return Rect(
Vector2(ThirdSize.
X * 2,ThirdSize.
Y * 1),ThirdSize);
break;
143 case NBP_BottomLeft:
return Rect(
Vector2(0,ThirdSize.
Y * 2),ThirdSize);
break;
144 case NBP_BottomCenter:
return Rect(
Vector2(ThirdSize.
X * 1,ThirdSize.
Y * 2),ThirdSize);
break;
145 case NBP_BottomRight:
return Rect(
Vector2(ThirdSize.
X * 2,ThirdSize.
Y * 2),ThirdSize);
break;
151 for( PartitionVec::iterator It = this->
Partitions.begin() ; It != this->
Partitions.end() ; ++It )
153 if( (*It)->PartitionRect.IsInside(MousePos) )
163 if( HoveredPartition == NULL )
166 for( PartitionData::WidgetContainer::reverse_iterator WidIt = HoveredPartition->
Widgets.rbegin() ; WidIt != HoveredPartition->
Widgets.rend() ; ++WidIt )
169 if( (*WidIt)->IsVisible() && (*WidIt)->GetNumVisibleRenderLayers() ) {
171 if( (*WidIt)->IsInside(MousePos) ) {
173 if( !(*WidIt)->GetMousePassthrough() ) {