00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if !defined(AFX_GLWWINDOW_H__DF296D0F_BC67_4A40_B8F9_3B70E8AC1F65__INCLUDED_)
00022 #define AFX_GLWWINDOW_H__DF296D0F_BC67_4A40_B8F9_3B70E8AC1F65__INCLUDED_
00023
00024 #include <string>
00025 #include <GLW/GLWPanel.h>
00026 #include <GLW/GLWToolTip.h>
00027 #include <GLEXT/GLTexture.h>
00028
00029 class GLWWindow : public GLWPanel
00030 {
00031 public:
00032 enum PossibleStates
00033 {
00034 eNoTitle = 1,
00035 eSmallTitle = 2,
00036 eTransparent = 4,
00037 eResizeable = 8,
00038 eCircle = 16,
00039 eNoDraw = 32,
00040 eSavePosition = 64,
00041 eSemiTransparent = 128,
00042 eNoMove = 256,
00043 eClickTransparent = 512
00044 };
00045
00046 GLWWindow(const std::string &name = "None",
00047 float x = 0.0f, float y = 0.0f,
00048 float w = 0.0f, float h = 0.0f,
00049 unsigned int states = 0,
00050 const std::string &description = "None");
00051 GLWWindow(const std::string &name, float w, float h,
00052 unsigned int states,
00053 const std::string &description);
00054 virtual ~GLWWindow();
00055
00056 virtual bool initFromXML(XMLNode *node);
00057 virtual void windowInit(const unsigned state);
00058 virtual void draw();
00059 virtual void mouseDown(int button, float x, float y, bool &skipRest);
00060 virtual void mouseUp(int button, float x, float y, bool &skipRest);
00061 virtual void mouseDrag(int button, float mx, float my, float x, float y, bool &skipRest);
00062 virtual void keyDown(char *buffer, unsigned int keyState,
00063 KeyboardHistory::HistoryElement *history, int hisCount,
00064 bool &skipRest);
00065 virtual void mouseWheel(float x, float y, float z, bool &skipRest);
00066
00067 virtual void savePosition(XMLNode *node);
00068 virtual void loadPosition(XMLNode *node);
00069
00070 const char *getDescription() { return description_.c_str(); }
00071 ToolTip &getToolTip() { return toolTip_; }
00072 void setWindowLevel(unsigned int windowLevel) { windowLevel_ = windowLevel; }
00073 unsigned int getWindowLevel() { return windowLevel_; }
00074 unsigned int getWindowState() { return windowState_; }
00075 void needsCentered() { needCentered_ = true; }
00076 virtual void drawIconBox(float x, float y);
00077
00078 REGISTER_CLASS_HEADER(GLWWindow);
00079
00080 protected:
00081 enum
00082 {
00083 NoDrag,
00084 TitleDrag,
00085 SizeDrag
00086 } dragging_;
00087
00088 ToolTip toolTip_;
00089 static GLTexture moveTexture_;
00090 bool showTitle_;
00091 bool needCentered_;
00092 bool disabled_;
00093 bool initPosition_;
00094 unsigned int windowState_;
00095 unsigned int windowLevel_;
00096 float maxWindowSize_;
00097 std::string description_;
00098
00099 virtual void drawWindowCircle(float x, float y, float w, float h);
00100 virtual void drawOutlinePoints(float x, float y, float w, float h);
00101 virtual void drawBackSurface(float x, float y, float w, float h);
00102 virtual void drawTitleBar(float x, float y, float w, float h);
00103 virtual void drawSurround(float x, float y, float w, float h);
00104 virtual void drawMaximizedWindow();
00105 virtual void drawInfoBox(float x, float y, float w);
00106 virtual void drawJoin(float x, float y);
00107
00108 };
00109
00110 #endif // !defined(AFX_GLWWINDOW_H__DF296D0F_BC67_4A40_B8F9_3B70E8AC1F65__INCLUDED_)