//------------------------------------------------------------------------------ // Application main gui form -- // (C) Piero Giubilato 2008-2010, Berkeley Lab -- //------------------------------------------------------------------------------ //______________________________________________________________________________ // {Trace} // [File name] "gui_Main.h" // [Author] "Piero Giubilato" // [Version] "1.0" // [Modified by] "Piero Giubilato" // [Last revision] "09 Feb 2009" // [Language] "C++" // [Compiler] "Visual C++ 8.x 9.x" // [Member of] "Cool SEAL" // [Project] "SEAL" // [Description] "Application main gui form." // [Key documentation] // "Root user's guide, writing a graphical interface" // "Visual C++ Reference Help" // {Trace} //______________________________________________________________________________ // Overloading Check #ifndef gui_Main_H #define gui_Main_H // Root components #include #include #include #include // Application components #include "gui_Object.h" //#include "gui_Menu.h" //______________________________________________________________________________ class gui_Main: public gui_Object { // Remember to add the class to the root_Linkdef.h file also! ClassDef(gui_Main, 2) private: // Singleton implementation static gui_Main* inst_Handle; static int inst_Count; // Interface elements static TGMainFrame *frm_Main; // The frame window itself static TGCanvas *tgc_Draw; // TG canvas container static TGCompositeFrame *tgf_Draw; // Frame container static TGMenuBar *mnu_Main; // The main menu bar // Setup routines static void frm_main_Menu(); // Set up all the menus static void frm_main_Frame(); // Set up all the frames protected: // Special memeber functions gui_Main(const TGWindow* p, UInt_t w, UInt_t h); ~gui_Main(); gui_Main (const gui_Main&) {}; gui_Main& operator=(gui_Main&) {}; public: // Default colors static const UInt_t kc_Black = 0x202020; static const UInt_t kc_Gray = 0x666666; static const UInt_t kc_White = 0xC0C0C0; static const UInt_t kc_Red = 0x770000; static const UInt_t kc_Orange = 0x775000; static const UInt_t kc_Yellow = 0x818800; static const UInt_t kc_Green = 0x106610; static const UInt_t kc_Cyan = 0x006677; static const UInt_t kc_Blue = 0x002266; static const UInt_t kc_blue_Dark = 0x001133; static const UInt_t kc_Purple = 0x661066; // Singleton Initializer static gui_Main* instance_Load(const TGWindow* p, UInt_t w, UInt_t h); static void instance_Destroy(); // Slots for gui calls: functions used by the signal system // implemented by root to manage events driven by buttons, checks, ... // and others interface elements. They MUST be public! static void do_frm_Close(); // Close the form // Graphics interface references static TGMainFrame* frame_Main(); // The main window frame static TGCompositeFrame* frame_Draw(); // The whiteboard frame static TGMenuBar* menu_Bar(); // The main window frame // Overloaded gui_Objects members void Update(bool force = false) const; // Forced update void size_Set(UInt_t width, UInt_t height); // The the board size void color_Set(UInt_t foreColor, UInt_t backColor); // Color overloaded // Special global members void delete_All(); // Kills all the graphics object except the main itself void Quit(); // Quits the graphical interface }; // Overloading Check #endif