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
|
|
|
|
|
|
|
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
|
|
|
{
|
|
|
|
MyGUI::WindowPtr t = static_cast<MyGUI::WindowPtr>(mMainWidget);
|
|
|
|
t->eventWindowButtonPressed += MyGUI::newDelegate(this, &WindowPinnableBase::onWindowButtonPressed);
|
|
|
|
}
|
|
|
|
|
|
|
|
void WindowPinnableBase::onWindowButtonPressed(MyGUI::Window* sender, const std::string& eventName)
|
|
|
|
{
|
|
|
|
if ("PinToggle" == eventName)
|
|
|
|
{
|
2012-04-01 20:51:49 +00:00
|
|
|
mPinned = !mPinned;
|
2012-04-05 22:17:23 +00:00
|
|
|
onPinToggled();
|
2012-04-01 17:36:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
eventDone(this);
|
|
|
|
}
|