1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-07 12:54:00 +00:00
OpenMW/apps/openmw/mwgui/windowpinnablebase.cpp

28 lines
754 B
C++
Raw Normal View History

#include "windowpinnablebase.hpp"
#include "exposedwindow.hpp"
2013-04-17 22:56:48 +00:00
namespace MWGui
{
2013-04-17 22:56:48 +00:00
WindowPinnableBase::WindowPinnableBase(const std::string& parLayout)
: WindowBase(parLayout), mPinned(false), mVisible(false)
{
ExposedWindow* window = static_cast<ExposedWindow*>(mMainWidget);
mPinButton = window->getSkinWidget ("Button");
2013-04-17 22:56:48 +00:00
mPinButton->eventMouseButtonClick += MyGUI::newDelegate(this, &WindowPinnableBase::onPinButtonClicked);
}
2013-04-17 22:56:48 +00:00
void WindowPinnableBase::onPinButtonClicked(MyGUI::Widget* _sender)
{
mPinned = !mPinned;
2013-04-17 22:56:48 +00:00
if (mPinned)
mPinButton->changeWidgetSkin ("PinDown");
else
mPinButton->changeWidgetSkin ("PinUp");
2013-04-17 22:56:48 +00:00
onPinToggled();
}
}