Make the "lock window" button to change state visually
parent
43d6392921
commit
3ba3c71556
@ -0,0 +1,26 @@
|
||||
#include "exposedwindow.hpp"
|
||||
|
||||
#include "MyGUI_Window.h"
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
MyGUI::VectorWidgetPtr ExposedWindow::getSkinWidgetsByName (const std::string &name)
|
||||
{
|
||||
return MyGUI::Widget::getSkinWidgetsByName (name);
|
||||
}
|
||||
|
||||
MyGUI::Widget* ExposedWindow::getSkinWidget(const std::string & _name, bool _throw)
|
||||
{
|
||||
MyGUI::VectorWidgetPtr widgets = getSkinWidgetsByName (_name);
|
||||
|
||||
if (widgets.empty())
|
||||
{
|
||||
MYGUI_ASSERT( ! _throw, "widget name '" << _name << "' not found in skin of layout '" << getName() << "'");
|
||||
return nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
return widgets[0];
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
#ifndef MWGUI_EXPOSEDWINDOW_H
|
||||
#define MWGUI_EXPOSEDWINDOW_H
|
||||
|
||||
#include "MyGUI_Window.h"
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief subclass to provide access to some Widget internals.
|
||||
*/
|
||||
class ExposedWindow : public MyGUI::Window
|
||||
{
|
||||
MYGUI_RTTI_DERIVED(ExposedWindow)
|
||||
|
||||
public:
|
||||
MyGUI::VectorWidgetPtr getSkinWidgetsByName (const std::string &name);
|
||||
|
||||
MyGUI::Widget* getSkinWidget(const std::string & _name, bool _throw = true);
|
||||
///< Get a widget defined in the inner skin of this window.
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue