TGStatusBar.h

Go to the documentation of this file.
00001 // @(#)root/gui:$Id: TGStatusBar.h 26692 2008-12-06 10:54:36Z bellenot $
00002 // Author: Fons Rademakers   23/01/98
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TGStatusBar
00013 #define ROOT_TGStatusBar
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TGStatusBar                                                          //
00019 //                                                                      //
00020 // Provides a StatusBar widget.                                         //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TGFrame
00025 #include "TGFrame.h"
00026 #endif
00027 
00028 class TGStatusBarPart;
00029 
00030 
00031 class TGStatusBar : public TGHorizontalFrame {
00032 
00033 friend class TGStatusBarPart;
00034 
00035 private:
00036    TGStatusBar(const TGStatusBar&);            // not implemented
00037    TGStatusBar& operator=(const TGStatusBar&); // not implemented
00038 
00039 protected:
00040    TGStatusBarPart **fStatusPart; // frames containing statusbar text
00041    Int_t            *fParts;      // size of parts (in percent of total width)
00042    Int_t             fNpart;      // number of parts
00043    Int_t             fYt;         // y drawing position (depending on font)
00044    Int_t            *fXt;         // x position for each part
00045    Bool_t            f3DCorner;   // draw 3D corner (drawn by default)
00046 
00047    static const TGFont *fgDefaultFont;
00048    static TGGC         *fgDefaultGC;
00049 
00050    virtual void DoRedraw();
00051 
00052    static FontStruct_t  GetDefaultFontStruct();
00053    static const TGGC   &GetDefaultGC();
00054 
00055 public:
00056    TGStatusBar(const TGWindow *p = 0, UInt_t w = 4, UInt_t h = 2,
00057                UInt_t options = kSunkenFrame | kHorizontalFrame,
00058                Pixel_t back = GetDefaultFrameBackground());
00059    virtual ~TGStatusBar();
00060 
00061    virtual void DrawBorder();
00062    virtual void SetText(TGString *text, Int_t partidx = 0);
00063    virtual void SetText(const char *text, Int_t partidx = 0);
00064            void AddText(const char *text, Int_t partidx = 0)
00065                   { SetText(text, partidx); }                  //*MENU*
00066    const char  *GetText(Int_t partidx = 0) const;
00067    virtual void SetParts(Int_t npart);                         //*MENU*
00068    virtual void SetParts(Int_t *parts, Int_t npart);
00069    void         Draw3DCorner(Bool_t corner) { f3DCorner = corner; }
00070    TGCompositeFrame *GetBarPart(Int_t npart) const;
00071    TGDimension GetDefaultSize() const;
00072 
00073    virtual void SavePrimitive(ostream &out, Option_t *option = "");
00074 
00075    ClassDef(TGStatusBar,0)  // Status bar widget
00076 };
00077 
00078 #endif

Generated on Tue Jul 5 14:20:08 2011 for ROOT_528-00b_version by  doxygen 1.5.1