Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

title.h

Go to the documentation of this file.
00001 /* ***********************************************************************************
00002         Writer:         Sebastien Bloc
00003         Copyright:      2003-2004
00004         eMail:          sebastien.bloc@free.fr
00005         URL:            http://mignonsoft.free.fr
00006 
00007         This program is free software; you can redistribute it and/or
00008         modify it under the terms of the GNU General Public License
00009         as published by the Free Software Foundation; either version 2
00010         of the License, or (at your option) any later version.
00011 
00012         This program is distributed in the hope that it will be useful,
00013         but WITHOUT ANY WARRANTY; without even the implied warranty of
00014         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015         GNU General Public License for more details.
00016         http://www.gnu.org/copyleft/gpl.html
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 //#include "container.h"
00030 
00031 typedef enum { original , maximize , minimize } StateTitle;
00032 
00033 using namespace sigslot;  // pour signal (evit l'ecriture sigslot::signal?<...>)
00034 
00035 class EventTitle
00036 {
00037 public:
00038         signal0<> minimize;             //Call: void Minimize();
00039         signal0<> maximize;             //Call: void Maximize();
00040         signal0<> original;             //Call: void Original();
00041         signal0<> close;                //Call: void Close();
00042         signal0<> gotFocus;             //Call: void GotFocus();
00043         signal0<> lostFocus;    //Call: void Class::LostFocus();
00044 };
00045 
00051 class Title : public Control
00052 {
00053 public:
00054         // varaible membre
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         // gestion pour min / max / alternate
00068         Point3D<LayoutDouble> originalSize; // taille fenetre avant maximisation ou minimisation
00069         Point3D<GLdouble> originalAngle;        // angle fenetre avant maximisation ou minimisation
00070         FaceNode *tempNode;                     // noeud temporaire, en max = masterContainer, en min dans trash
00071         StateTitle state;
00072         StateMouse oldMouse;
00073         EventTitle onTitle;
00074 
00075         Title();
00076         ~Title();
00077 
00078         virtual void Create() { Create(NULL,DEFAULT_DEPTH_TITLE); } // Createur pour container
00079         void Create(Control *container,double depth=DEFAULT_DEPTH_TITLE); // !importent, le container dois etre le control contenant le 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

Generated on Fri Aug 20 19:19:50 2004 for 3d Controls by doxygen 1.3.6