1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 20:49:56 +00:00
openmw-tes3mp/apps/openmw/mwgui/windowpinnablebase.cpp

28 lines
734 B
C++

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