00001
00002 #ifndef AEDWINDOW_H
00003 #define AEDWINDOW_H
00004
00005 #include "dllmacros.h"
00006 #include "aedWidget.h"
00007 #include "aedStaticText.h"
00008 #include "aedButton.h"
00009
00010 enum aedWinFlags
00011 {
00012 WF_PLAIN = 0,
00013
00014 WF_RESIZEABLE = 1,
00015 WF_MOVEABLE = 2,
00016
00017 WF_TITLEBAR =
00018 4,
00019 WF_CLOSEBUTTON = 8,
00020 WF_MAXBUTTON = 16,
00021 WF_MINBUTTON = 32,
00022 };
00023
00024
00025 const Uint32 WF_NORMAL =
00026 WF_RESIZEABLE | WF_MOVEABLE | WF_TITLEBAR | WF_CLOSEBUTTON;
00027
00028
00029 class DLLEXPORT aedWindow:public aedWidget
00030 {
00031
00032 public:
00033 aedWindow();
00034
00035 virtual ~ aedWindow();
00036
00037
00038 virtual void create(aedWidget * parent = NULL, aedRect pos =
00039 aedDEFAULTPOSITION,
00040 std::string caption =
00041 "", Uint32 flags = WF_NORMAL);
00042
00043
00044 virtual void render(void);
00045
00046
00047 virtual int wm_lbuttondown(Uint16 x, Uint16 y);
00048
00049 virtual int wm_lbuttonup(Uint16 x, Uint16 y);
00050
00051 virtual int wm_mousemove(Uint16 x, Uint16 y, Uint16 dx, Uint16 dy);
00052
00053
00054 virtual void setCaption(const std::string & caption)
00055 {
00056
00057 m_Caption = caption;
00058
00059 m_CaptionLabel->setCaption(caption);
00060
00061 }
00062
00063 aedWidget * getClientArea()
00064 {
00065
00066 return &m_ClientArea;
00067
00068 }
00069
00070
00071 virtual bool addWidget(aedWidget * win)
00072 {
00073
00074 if(m_InitComplete == false || win->getUserData() == this)
00075
00076 {
00077
00078 return aedWidget::addWidget(win);
00079
00080 }
00081
00082 else
00083
00084 {
00085
00086 return m_ClientArea.addWidget(win);
00087
00088 }
00089
00090 }
00091
00092
00093 virtual bool removeWindget(aedWidget * win)
00094 {
00095
00096 if(m_InitComplete == false || win->getUserData() == this)
00097
00098 {
00099
00100 return aedWidget::removeWidget(win);
00101
00102 }
00103
00104 else
00105
00106 {
00107
00108 return m_ClientArea.removeWidget(win);
00109
00110 }
00111
00112 }
00113
00114
00115 void Maximize();
00116
00117 void Minimize();
00118
00119
00120
00121 private:
00122 bool m_InitComplete;
00123
00124
00125
00126 bool m_Moveable;
00127
00128
00129 int m_TitleBarBorderX;
00130
00131 int m_TitleBarBorderY;
00132
00133 int m_TitleBarHeight;
00134
00135
00136
00137 aedWidget m_ClientArea;
00138
00139 aedButton * m_CloseButton;
00140
00141 aedButton * m_MinimizeButton;
00142
00143 aedButton * m_MaximizeButton;
00144
00145 aedStaticText * m_CaptionLabel;
00146
00147 Uint16 dragXoffset;
00148
00149 Uint16 dragYoffset;
00150
00151 };
00152
00153
00154 void __aedInternal__WindowCloseButtonHandler(void *caller, void *data);
00155
00156 void __aedInternal__WindowMaxButtonHandler(void *caller, void *data);
00157
00158 void __aedInternal__WindowMinButtonHandler(void *caller, void *data);
00159
00160
00161
00162 #if defined(_MSC_VER)
00163 DLLEXTERN template DLLEXPORT aedFunctor1Arg < stub, aedButton >;
00164
00165 #endif
00166
00167
00168 #endif
00169