/*! @file @author Albert Semenov @date 11/2007 @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_VScroll.h" #include "MyGUI_InputManager.h" #include "MyGUI_Button.h" #include "MyGUI_ResourceSkin.h" namespace MyGUI { const int SCROLL_MOUSE_WHEEL = 50; // колличество пикселей для колеса мыши VScroll::VScroll() : mWidgetStart(nullptr), mWidgetEnd(nullptr), mWidgetTrack(nullptr), mWidgetFirstPart(nullptr), mWidgetSecondPart(nullptr), mSkinRangeStart(0), mSkinRangeEnd(0), mScrollRange(0), mScrollPosition(0), mScrollPage(0), mScrollViewPage(0), mMinTrackSize(0), mMoveToClick(false) { } void VScroll::_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); initialiseWidgetSkin(_info); } VScroll::~VScroll() { shutdownWidgetSkin(); } void VScroll::baseChangeWidgetSkin(ResourceSkin* _info) { shutdownWidgetSkin(); Base::baseChangeWidgetSkin(_info); initialiseWidgetSkin(_info); } void VScroll::initialiseWidgetSkin(ResourceSkin* _info) { // при нуле, будет игнорировать кнопки mScrollPage = 1; mScrollViewPage = 1; for (VectorWidgetPtr::iterator iter = mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter) { if (*(*iter)->_getInternalData() == "Start") { MYGUI_DEBUG_ASSERT( ! mWidgetStart, "widget already assigned"); mWidgetStart = (*iter)->castType