//------------------------------------------------------------------------------ // gui_CoolButton class -- // (C) Piero Giubilato 2008, Berkeley Lab -- //------------------------------------------------------------------------------ //______________________________________________________________________________ // {Trace} // [File name] "gui_Button.h" // [Author] "Piero Giubilato" // [Version] "1.0" // [Modified by] "Piero Giubilato" // [Last revision] "23 Apr 2009" // [Language] "C++" // [Compiler] "Visual C++ 8.x 9.x" // [Member of] "Cool SEAL" // [Project] "SEAL" // [Description] "Header for the gui_CoolButton class" // [Key documentation] // "Visual C++ Reference Help" // "Root reference guide" // {Trace} //______________________________________________________________________________ // Overloading check #if !defined gui_CoolButton_H #define gui_CoolButton_H // Root components #include #include // Application components #include "gui_Const.h" #include "gui_Object.h" #include "gso_Button.h" // This class provides a functional layer to TGTextButton class gui_CoolButton: public gui_Object { // Cint preprocessor token ClassDef(gui_CoolButton, 1) private: // Main interface elements gso_Button* button; // The gso button itself UInt_t button_Mode; // Button mechanical action // Button status bool button_Status; // Button mechanical status bool button_Default; // Button mechanical default // Private functions void Init(const char* label, UInt_t left, UInt_t top, UInt_t width, UInt_t height, UInt_t foreColor, UInt_t backColor); // Special private memebers gui_CoolButton(const gui_CoolButton&) {} const gui_CoolButton& operator=(const gui_CoolButton&) {return *this;} public: // Public parameters enum km {km_Button, km_Latch, km_Led}; // 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_Purple = 0x661066; // Special member functions gui_CoolButton(const char* label, UInt_t left, UInt_t top, UInt_t width, UInt_t height, UInt_t foreColor = kc_Cyan, UInt_t backColor = kc_Blue); gui_CoolButton(gui_Object* parent, const char* label, UInt_t left, UInt_t top, UInt_t width, UInt_t height, UInt_t foreColor = kc_Cyan, UInt_t backColor = kc_Blue); ~gui_CoolButton(); // Slots for gui calls, MUST be public void btn_Do(); // gui_Object overloaded methods (standard interface) const gso_Button* Root() const; void ReDraw(); void MoveResize(UInt_t left, UInt_t top, UInt_t width, UInt_t height); void LowerWindow() const {button->LowerWindow();}; void RaiseWindow() const {button->RaiseWindow();}; void color_Set(UInt_t foreColor, UInt_t backColor); void Text(const char* text); const TString Text() const; virtual UInt_t fontSize() const; void fontSize(UInt_t size); virtual bool fontBold() const; void fontBold(bool bold); virtual const char* fontName() const; void fontName(const char* name); // gui_CoolButton specific methods UInt_t btn_Mode() const; void btn_Mode(UInt_t value); const bool btn_Status(); void btn_Status(bool value); bool btn_Default() const; bool btn_Default(bool value); }; // End of Overloading check #endif