2013-04-10 04:32:05 +00:00
|
|
|
#ifndef MWGUI_WINDOW_BASE_H
|
|
|
|
#define MWGUI_WINDOW_BASE_H
|
|
|
|
|
2015-05-01 00:09:57 +00:00
|
|
|
#include "layout.hpp"
|
2013-04-10 04:32:05 +00:00
|
|
|
|
|
|
|
namespace MWBase
|
|
|
|
{
|
|
|
|
class WindowManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
|
|
|
class WindowManager;
|
2014-01-26 13:47:01 +00:00
|
|
|
class DragAndDrop;
|
2013-04-10 04:32:05 +00:00
|
|
|
|
2015-05-01 00:09:57 +00:00
|
|
|
class WindowBase: public Layout
|
2013-04-10 04:32:05 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-04-10 18:46:21 +00:00
|
|
|
WindowBase(const std::string& parLayout);
|
2013-04-10 04:32:05 +00:00
|
|
|
|
|
|
|
// Events
|
|
|
|
typedef MyGUI::delegates::CMultiDelegate1<WindowBase*> EventHandle_WindowBase;
|
|
|
|
|
2015-07-15 17:10:09 +00:00
|
|
|
/// Notify that window has been made visible
|
2013-04-10 04:32:05 +00:00
|
|
|
virtual void open() {}
|
2015-07-15 17:10:09 +00:00
|
|
|
/// Notify that window has been hidden
|
2013-04-10 04:32:05 +00:00
|
|
|
virtual void close () {}
|
2015-07-15 17:10:09 +00:00
|
|
|
/// Gracefully exits the window
|
2014-05-27 03:13:37 +00:00
|
|
|
virtual void exit() {}
|
2015-07-15 17:10:09 +00:00
|
|
|
/// Sets the visibility of the window
|
2013-04-10 04:32:05 +00:00
|
|
|
virtual void setVisible(bool visible);
|
2015-07-15 17:10:09 +00:00
|
|
|
/// Returns the visibility state of the window
|
|
|
|
bool isVisible();
|
2013-04-10 04:32:05 +00:00
|
|
|
void center();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* "Modal" windows cause the rest of the interface to be unaccessible while they are visible
|
|
|
|
*/
|
|
|
|
class WindowModal : public WindowBase
|
|
|
|
{
|
|
|
|
public:
|
2013-04-10 18:46:21 +00:00
|
|
|
WindowModal(const std::string& parLayout);
|
2013-04-10 04:32:05 +00:00
|
|
|
virtual void open();
|
|
|
|
virtual void close();
|
2014-05-27 18:30:26 +00:00
|
|
|
virtual void exit() {}
|
2013-04-10 04:32:05 +00:00
|
|
|
};
|
2014-01-26 13:47:01 +00:00
|
|
|
|
|
|
|
/// A window that cannot be the target of a drag&drop action.
|
|
|
|
/// When hovered with a drag item, the window will become transparent and allow click-through.
|
|
|
|
class NoDrop
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NoDrop(DragAndDrop* drag, MyGUI::Widget* widget);
|
|
|
|
|
|
|
|
void onFrame(float dt);
|
2014-09-13 05:59:29 +00:00
|
|
|
virtual void setAlpha(float alpha);
|
2014-01-26 13:47:01 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
MyGUI::Widget* mWidget;
|
|
|
|
DragAndDrop* mDrag;
|
|
|
|
bool mTransparent;
|
|
|
|
};
|
2013-04-10 04:32:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|