Remove "PinToggle" event from layout file

actorid
Emanuel Guevel 12 years ago
parent 2dea86bbc7
commit 3dc28baa28

@ -9,26 +9,20 @@ using namespace MWGui;
WindowPinnableBase::WindowPinnableBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager)
: WindowBase(parLayout, parWindowManager), mPinned(false), mVisible(false)
{
MyGUI::WindowPtr t = static_cast<MyGUI::WindowPtr>(mMainWidget);
t->eventWindowButtonPressed += MyGUI::newDelegate(this, &WindowPinnableBase::onWindowButtonPressed);
ExposedWindow* window = static_cast<ExposedWindow*>(mMainWidget);
mPinButton = window->getSkinWidget ("Button");
mPinButton->eventMouseButtonClick += MyGUI::newDelegate(this, &WindowPinnableBase::onPinButtonClicked);
}
void WindowPinnableBase::onWindowButtonPressed(MyGUI::Window* sender, const std::string& eventName)
void WindowPinnableBase::onPinButtonClicked(MyGUI::Widget* _sender)
{
if ("PinToggle" == eventName)
{
mPinned = !mPinned;
if (mPinned)
mPinButton->changeWidgetSkin ("PinDown");
else
mPinButton->changeWidgetSkin ("PinUp");
mPinned = !mPinned;
onPinToggled();
}
if (mPinned)
mPinButton->changeWidgetSkin ("PinDown");
else
mPinButton->changeWidgetSkin ("PinUp");
eventDone(this);
onPinToggled();
}

@ -14,7 +14,7 @@ namespace MWGui
bool pinned() { return mPinned; }
private:
void onWindowButtonPressed(MyGUI::Window* sender, const std::string& eventName);
void onPinButtonClicked(MyGUI::Widget* _sender);
protected:
virtual void onPinToggled() = 0;

@ -585,9 +585,7 @@
<Property key="Scale" value = "1 1 0 0"/>
</Child>
<Child type="Button" skin="PinUp" offset="232 4 19 19" align="ALIGN_RIGHT ALIGN_TOP" name="Button">
<Property key="Event" value="PinToggle"/>
</Child>
<Child type="Button" skin="PinUp" offset="232 4 19 19" align="ALIGN_RIGHT ALIGN_TOP" name="Button"/>
</Skin>
<Skin name = "MW_Dialog" size = "256 54">

Loading…
Cancel
Save