44 mMouseRootFocus(false),
54 Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
56 initialiseWidgetSkin(_info);
68 initialiseWidgetSkin(_info);
77 mMinmax.
set(0, 0, 3000, 3000);
79 bool main_move =
false;
82 if (!properties.empty())
84 MapString::const_iterator iter = properties.find(
"Snap");
86 iter = properties.find(
"MainMove");
87 if (iter != properties.end())
96 if (*(*iter)->_getInternalData<std::string>() ==
"Client")
107 else if (*(*iter)->_getInternalData<std::string>() ==
"Caption")
110 mWidgetCaption = (*iter);
114 else if (*(*iter)->_getInternalData<std::string>() ==
"Button")
118 else if (*(*iter)->_getInternalData<std::string>() ==
"Action")
127 void Window::shutdownWidgetSkin()
130 mWidgetCaption =
nullptr;
143 mMouseRootFocus = _focus;
151 mKeyRootFocus = _focus;
190 IntCoord coord = mCurrentActionScale;
192 coord.
top *= (_top - point.
top);
196 if (coord.
left == 0 && coord.
top == 0)
197 setSize((mPreActionCoord + coord).size());
209 if (!mIsAutoAlpha)
return;
222 mIsAutoAlpha = _auto;
239 getSnappedCoord(coord);
240 point = coord.point();
260 getSnappedCoord(coord);
305 getSnappedCoord(coord);
310 if (coord ==
mCoord)
return;
317 if (mWidgetCaption !=
nullptr) mWidgetCaption->
setCaption(_caption);
323 if (mWidgetCaption !=
nullptr)
return mWidgetCaption->
getCaption();
339 mAnimateSmooth =
false;
351 mAnimateSmooth =
false;
357 float Window::getAlphaVisible()
362 void Window::getSnappedCoord(
IntCoord& _coord)
373 if ( abs(_coord.left + _coord.width - view_size.width) <
WINDOW_SNAP_DISTANSE) _coord.left = view_size.
width - _coord.width;
374 if ( abs(_coord.top + _coord.height - view_size.height) <
WINDOW_SNAP_DISTANSE) _coord.top = view_size.height - _coord.height;
379 mAnimateSmooth =
true;
403 ControllerFadeAlpha* Window::createControllerFadeAlpha(
float _alpha,
float _coef,
bool _enable)
439 if (_key ==
"Window_AutoAlpha")
setAutoAlpha(utility::parseValue<bool>(_value));
440 else if (_key ==
"Window_Snap")
setSnap(utility::parseValue<bool>(_value));
441 else if (_key ==
"Window_MinSize")
setMinSize(utility::parseValue<IntSize>(_value));
442 else if (_key ==
"Window_MaxSize")
setMaxSize(utility::parseValue<IntSize>(_value));
444 #ifndef MYGUI_DONT_USE_OBSOLETE
445 else if (_key ==
"Window_MinMax")
450 MYGUI_LOG(Warning,
"Window_MinMax is obsolete, use Window_MinSize or Window_MaxSize");
452 #endif // MYGUI_DONT_USE_OBSOLETE