00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00023 #ifndef INCLUDE_TITLE_H
00024 #define INCLUDE_TITLE_H
00025
00026 #include "MyString.h"
00027 #include "button.h"
00028 #include "textBox.h"
00029
00030
00031 typedef enum { original , maximize , minimize } StateTitle;
00032
00033 using namespace sigslot;
00034
00035 class EventTitle
00036 {
00037 public:
00038 signal0<> minimize;
00039 signal0<> maximize;
00040 signal0<> original;
00041 signal0<> close;
00042 signal0<> gotFocus;
00043 signal0<> lostFocus;
00044 };
00045
00051 class Title : public Control
00052 {
00053 public:
00054
00055 Button btnMin,btnMax,btnClose;
00056 Button btnIcon;
00057 Text3D *caption;
00058 Tip tipCaption;
00059 Control *container;
00060
00061 BOOL focused;
00062 BOOL useIcon;
00063 BOOL useMin;
00064 BOOL useMax;
00065 BOOL useClose;
00066
00067
00068 Point3D<LayoutDouble> originalSize;
00069 Point3D<GLdouble> originalAngle;
00070 FaceNode *tempNode;
00071 StateTitle state;
00072 StateMouse oldMouse;
00073 EventTitle onTitle;
00074
00075 Title();
00076 ~Title();
00077
00078 virtual void Create() { Create(NULL,DEFAULT_DEPTH_TITLE); }
00079 void Create(Control *container,double depth=DEFAULT_DEPTH_TITLE);
00080 void ToString(MyString &str);
00081 void GotFocus();
00082 void LostFocus();
00083 void operator=(char *newCaption) { SetText(newCaption); };
00084 void SetText(char *newCaption);
00085 void SetUses(BOOL _useMin,BOOL _useMax,BOOL _useClose,BOOL _useIcon);
00086
00087 int OnClick(StateMouse *mouse,int face);
00088 int OnLButtonDown(StateMouse *mouse,int face);
00089 int OnMButtonDown(StateMouse *mouse,int face);
00090 int OnLMButtonUp(StateMouse *mouse,int face);
00091 int OnMaxOrOriginal(StateMouse *mouse,int face);
00092 int OnMaxOrOriginal();
00093 int OnMouseMove (StateMouse *mouse,int deltaX,int deltaY,int face);
00094 int OnMouseWheel(StateMouse *mouse,int face);
00095 int OnMin();
00096 int OnMax();
00097 int OnOriginal();
00098 int OnClose();
00099 int OnKeyDown(StateKey *key,int face);
00100 int OnKeyUp(StateKey *key,int face);
00101 int OnRefresh(Timer *);
00102 int OnOverIn(Control *,int);
00103 int OnOverOut(Control *,int);
00104 };
00105
00106 #endif