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