//------------------------------------------------------------------------------ // gso_Frame class -- // (C) Piero Giubilato 2008-2010, Berkeley Lab -- //------------------------------------------------------------------------------ //______________________________________________________________________________ // {Trace} // [File name] "gso_Frame.h" // [Author] "Piero Giubilato" // [Version] "1.1" // [Modified by] "Piero Giubilato" // [Last revision] "06 Jun 2009" // [Language] "C++" // [Compiler] "Visual C++ 9.x" // [Member of] "Cool SEAL" // [Project] "SEAL" // [Description] "Header for the gso_Frame class" // [Key documentation] // "Visual C++ Reference Help" // "Root reference guide" // {Trace} //______________________________________________________________________________ // Overloading check #if !defined gso_Frame_H #define gso_Frame_H // Root components #include // Application component // Bevel Object class gso_Frame: public TGCompositeFrame { private: // Parent frame elements const TGWindow* window_Hnd; // Container window handle GContext_t frame_gc_Hnd; // The graphic contecx used to paint into the frame GCValues_t* frame_gc_Set; // Values structure to set the gc // The border pxMaps Pixmap_t bvl_PxMap[8]; // The border's bevel pictures // Appearance UInt_t brd_Size; // Border size UInt_t brd_Color; // Border color UInt_t bck_Color; // The background color (pure) UInt_t inn_Color; // The inner color (shaded) UInt_t dsk_Color; // The background color (shaded) Float_t brd_Thick; // Border thickness UInt_t brd_Style; // Border style bool frm_Fill; // Fill the frame with the border color // Graphics void Draw(); // Draw the frame void draw_Corners(); // Draw the bevel corners void draw_Sides(); // Draw the bevel sides // Special private memebers gso_Frame(const gso_Frame&) {} const gso_Frame& operator=(const gso_Frame&) {return *this;} protected: void DoRedraw(); // Put the image on screen, TGFrame overloaded public: // Konstant enum kborder {kb_Raised, kb_Sunken}; enum kstyle {ks_Bevel, ks_Notch}; // Default methods gso_Frame(const TGWindow* window = 0, UInt_t width = 1, UInt_t height = 1, UInt_t bvl_Size = 0, Float_t bvl_Thick = 1, UInt_t bvl_Style = 0, UInt_t bvl_Color = 0, UInt_t back_Color = 0, bool fill = false); ~gso_Frame(); // X elements virtual GContext_t GetGC() const {return frame_gc_Hnd;}; virtual const TGWindow* GetWID() const {return window_Hnd;}; // Clear area boundaries virtual UInt_t ClrLeft() const {return brd_Size;}; virtual UInt_t ClrTop() const {return brd_Size;}; virtual UInt_t ClrWidth() const {return TGFrame::GetWidth() - brd_Size * 2;}; virtual UInt_t ClrHeight() const {return TGFrame::GetHeight() - brd_Size * 2;}; virtual UInt_t BrdSize() const {return brd_Size;}; virtual bool FrmFill() const {return frm_Fill;}; // TGFrame overloaded methods virtual void Resize(UInt_t width, UInt_t height); virtual void Resize(TGDimension size); virtual void MoveResize(Int_t left, Int_t top, UInt_t width, UInt_t height); virtual void Move(Int_t left, Int_t top); virtual void SetForegroundColor(Pixel_t color); virtual void SetBackgroundColor(Pixel_t color); virtual UInt_t GetShadedColor() const; virtual void SetColor(Pixel_t fore, Pixel_t back); // Personal methods void Refresh(); // Cint preprocessor token ClassDef(gso_Frame, 1) }; // End of Overloading check #endif