157
165
SetMinimumSize (w, h);
158
166
SetMaximumSize (w, h);
160
//InitiateResizeLayout();
168
//ReconfigureParentLayout();
163
171
void Area::ApplyMinWidth()
165
173
_geometry.width = _min_size.width;
167
InitiateResizeLayout();
175
ReconfigureParentLayout();
170
178
void Area::ApplyMinHeight()
172
180
_geometry.height = _min_size.height;
174
InitiateResizeLayout();
182
ReconfigureParentLayout();
177
185
void Area::ApplyMaxWidth()
179
187
_geometry.width = _max_size.width;
181
InitiateResizeLayout();
189
ReconfigureParentLayout();
184
192
void Area::ApplyMaxHeight()
186
194
_geometry.height = _max_size.height;
188
InitiateResizeLayout();
196
ReconfigureParentLayout();
191
199
Size Area::GetMinimumSize() const
313
321
return _geometry.height;
316
void Area::SetGeometry (int x, int y, int w, int h)
324
void Area::SetGeometry(int x, int y, int w, int h)
318
326
h = nux::Clamp<int> (h, _min_size.height, _max_size.height);
319
327
w = nux::Clamp<int> (w, _min_size.width, _max_size.width);
340
348
return _geometry;
343
void Area::SetBaseX (int x)
351
void Area::SetBaseX(int x)
345
SetGeometry (x, _geometry.y, _geometry.width, _geometry.height);
353
SetGeometry(x, _geometry.y, _geometry.width, _geometry.height);
348
356
void Area::SetBaseY (int y)
399
void Area::InitiateResizeLayout (Area *child)
407
void Area::SetReconfigureParentLayoutOnGeometryChange(bool reconfigure_parent_layout)
409
_on_geometry_changeg_reconfigure_parent_layout = reconfigure_parent_layout;
412
bool Area::ReconfigureParentLayoutOnGeometryChange()
414
return _on_geometry_changeg_reconfigure_parent_layout;
417
void Area::ReconfigureParentLayout(Area *child)
419
if(_on_geometry_changeg_reconfigure_parent_layout == false)
401
422
if (GetWindowThread ()->IsComputingLayout() )
403
424
// there is no need to do the following while we are already computing the layout.
850
884
nux::GetWindowThread ()->QueueObjectLayout (this);
887
void Area::SetAcceptKeyboardEvent(bool accept_keyboard_event)
889
_accept_keyboard_event = accept_keyboard_event;
892
bool Area::AcceptKeyboardEvent() const
894
return _accept_keyboard_event;
897
void Area::SetAcceptMouseWheelEvent(bool accept_mouse_wheel_event)
899
_accept_mouse_wheel_event = accept_mouse_wheel_event;
902
bool Area::AcceptMouseWheelEvent() const
904
return _accept_mouse_wheel_event;
907
bool Area::TestMousePointerInclusion(const Point& mouse_position, NuxEventType event_type)
909
bool mouse_pointer_inside_area = false;
911
if (Type().IsDerivedFromType(MenuPage::StaticObjectType))
913
// A MenuPage geometry is already in absolute coordinates.
914
mouse_pointer_inside_area = _geometry.IsInside(mouse_position);
918
mouse_pointer_inside_area = GetAbsoluteGeometry().IsInside(mouse_position);
921
if ((event_type == NUX_MOUSE_WHEEL) && mouse_pointer_inside_area)
923
if (_accept_mouse_wheel_event == false)
927
return mouse_pointer_inside_area;
930
bool Area::TestMousePointerInclusionFilterMouseWheel(const Point& mouse_position, NuxEventType event_type)
932
bool mouse_pointer_inside_area = false;
934
if (Type().IsDerivedFromType(MenuPage::StaticObjectType))
936
// A MenuPage geometry is already in absolute coordinates.
937
mouse_pointer_inside_area = _geometry.IsInside(mouse_position);
941
mouse_pointer_inside_area = GetAbsoluteGeometry().IsInside(mouse_position);
944
return mouse_pointer_inside_area;
947
Area* Area::FindAreaUnderMouse(const Point& mouse_position, NuxEventType event_type)
952
Area* Area::FindKeyFocusArea(unsigned int key_symbol,
953
unsigned long x11_key_code,
954
unsigned long special_keys_state)
960
else if (next_object_to_key_focus_area_)
962
return next_object_to_key_focus_area_->FindKeyFocusArea(key_symbol, x11_key_code, special_keys_state);
967
void Area::SetPathToKeyFocusArea()
969
has_key_focus_ = true;
970
next_object_to_key_focus_area_ = NULL;
973
Area* parent = GetParentObject();
977
parent->next_object_to_key_focus_area_ = child;
978
parent->has_key_focus_ = false;
980
parent = parent->GetParentObject();
984
void Area::ResetDownwardPathToKeyFocusArea()
986
has_key_focus_ = false;
987
if (next_object_to_key_focus_area_)
989
next_object_to_key_focus_area_->ResetDownwardPathToKeyFocusArea();
991
next_object_to_key_focus_area_ = NULL;
994
void Area::ResetUpwardPathToKeyFocusArea()
996
has_key_focus_ = false;
999
_parent_area->ResetUpwardPathToKeyFocusArea();
1001
next_object_to_key_focus_area_ = NULL;
1004
bool Area::InspectKeyEvent(unsigned int eventType,
1005
unsigned int keysym,
1006
const char* character)
1011
bool Area::AcceptKeyNavFocus()
1016
Area* Area::KeyNavIteration(KeyNavDirection direction)
1021
bool Area::HasKeyFocus() const
1023
return has_key_focus_;