/*!
@file
@author Albert Semenov
@date 02/2008
@module
*/
/*
This file is part of MyGUI.
MyGUI is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MyGUI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with MyGUI. If not, see .
*/
#include "MyGUI_Precompiled.h"
#include "MyGUI_MenuCtrl.h"
#include "MyGUI_ResourceSkin.h"
#include "MyGUI_MenuItem.h"
#include "MyGUI_StaticImage.h"
#include "MyGUI_MenuBar.h"
#include "MyGUI_WidgetManager.h"
#include "MyGUI_LayerManager.h"
#include "MyGUI_ControllerManager.h"
#include "MyGUI_InputManager.h"
#include "MyGUI_Gui.h"
namespace MyGUI
{
const float POPUP_MENU_SPEED_COEF = 3.0f;
MenuCtrl::MenuCtrl() :
mHideByAccept(true),
mMenuDropMode(false),
mIsMenuDrop(true),
mHideByLostKey(false),
mHeightLine(1),
mSubmenuImageSize(0),
mShutdown(false),
mSeparatorHeight(0),
mAlignVert(true),
mDistanceButton(0),
mPopupAccept(false),
mOwner(nullptr),
mAnimateSmooth(false)
{
}
void MenuCtrl::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
{
Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
// инициализируем овнера
Widget* parent = getParent();
if (parent)
{
mOwner = parent->castType