2012-04-01 17:36:57 +00:00
|
|
|
#include "window_pinnable_base.hpp"
|
2012-08-12 16:11:09 +00:00
|
|
|
|
|
|
|
#include "../mwbase/windowmanager.hpp"
|
2012-04-01 17:36:57 +00:00
|
|
|
|
2013-02-17 01:56:07 +00:00
|
|
|
#include "exposedwindow.hpp"
|
|
|
|
|
2012-04-01 17:36:57 +00:00
|
|
|
using namespace MWGui;
|
|
|
|
|
2012-08-12 16:11:09 +00:00
|
|
|
WindowPinnableBase::WindowPinnableBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager)
|
2012-04-01 20:51:49 +00:00
|
|
|
: WindowBase(parLayout, parWindowManager), mPinned(false), mVisible(false)
|
2012-04-01 17:36:57 +00:00
|
|
|
{
|
2013-02-17 01:56:07 +00:00
|
|
|
ExposedWindow* window = static_cast<ExposedWindow*>(mMainWidget);
|
|
|
|
mPinButton = window->getSkinWidget ("Button");
|
2013-02-17 15:29:38 +00:00
|
|
|
|
|
|
|
mPinButton->eventMouseButtonClick += MyGUI::newDelegate(this, &WindowPinnableBase::onPinButtonClicked);
|
2012-04-01 17:36:57 +00:00
|
|
|
}
|
|
|
|
|
2013-02-17 15:29:38 +00:00
|
|
|
void WindowPinnableBase::onPinButtonClicked(MyGUI::Widget* _sender)
|
2012-04-01 17:36:57 +00:00
|
|
|
{
|
2013-02-17 15:29:38 +00:00
|
|
|
mPinned = !mPinned;
|
2013-02-17 01:56:07 +00:00
|
|
|
|
2013-02-17 15:29:38 +00:00
|
|
|
if (mPinned)
|
|
|
|
mPinButton->changeWidgetSkin ("PinDown");
|
|
|
|
else
|
|
|
|
mPinButton->changeWidgetSkin ("PinUp");
|
2012-04-01 17:36:57 +00:00
|
|
|
|
2013-02-17 15:29:38 +00:00
|
|
|
onPinToggled();
|
2012-04-01 17:36:57 +00:00
|
|
|
}
|