2011-04-10 00:55:58 +02:00
|
|
|
#ifndef UIWINDOW_H
|
|
|
|
#define UIWINDOW_H
|
|
|
|
|
2011-08-14 04:09:11 +02:00
|
|
|
#include "uiwidget.h"
|
2011-04-10 00:55:58 +02:00
|
|
|
|
2011-08-14 04:09:11 +02:00
|
|
|
class UIWindow : public UIWidget
|
2011-04-10 00:55:58 +02:00
|
|
|
{
|
|
|
|
public:
|
2011-08-14 04:09:11 +02:00
|
|
|
UIWindow();
|
2011-04-16 21:46:31 +02:00
|
|
|
|
2011-08-14 04:09:11 +02:00
|
|
|
static UIWindowPtr create();
|
2011-07-27 01:13:27 +02:00
|
|
|
|
2011-08-22 14:44:26 +02:00
|
|
|
virtual void onStyleApply(const OTMLNodePtr& styleNode);
|
2011-08-14 04:09:11 +02:00
|
|
|
virtual void render();
|
2011-04-10 00:55:58 +02:00
|
|
|
|
2011-04-10 22:40:44 +02:00
|
|
|
void setTitle(const std::string& title) { m_title = title; }
|
2011-05-03 00:48:41 +02:00
|
|
|
std::string getTitle() const { return m_title; }
|
2011-04-10 00:55:58 +02:00
|
|
|
|
2011-08-14 04:09:11 +02:00
|
|
|
protected:
|
2011-08-22 14:44:26 +02:00
|
|
|
virtual void onGeometryUpdate(const Rect& oldRect, const Rect& newRect);
|
|
|
|
virtual void onFocusChange(bool focused, UI::FocusReason reason);
|
|
|
|
virtual bool onMousePress(const Point& mousePos, UI::MouseButton button);
|
|
|
|
virtual bool onMouseRelease(const Point& mousePos, UI::MouseButton button);
|
|
|
|
virtual bool onMouseMove(const Point& mousePos, const Point& mouseMoved);
|
2011-04-22 15:49:46 +02:00
|
|
|
|
2011-04-10 00:55:58 +02:00
|
|
|
private:
|
|
|
|
std::string m_title;
|
2011-04-16 21:46:31 +02:00
|
|
|
bool m_moving;
|
2011-04-17 22:28:12 +02:00
|
|
|
Point m_movingReference;
|
2011-08-14 04:09:11 +02:00
|
|
|
|
|
|
|
// styling
|
|
|
|
BorderImagePtr m_headImage;
|
|
|
|
ImagePtr m_bodyImage;
|
|
|
|
int m_headHeight;
|
|
|
|
int m_headMargin;
|
|
|
|
AlignmentFlag m_titleAlign;
|
2011-04-10 00:55:58 +02:00
|
|
|
};
|
|
|
|
|
2011-08-14 04:09:11 +02:00
|
|
|
#endif
|