Logo ROOT  
Reference Guide
TGStatusBar.h
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 23/01/98
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGStatusBar
13 #define ROOT_TGStatusBar
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TGStatusBar //
19 // //
20 // Provides a StatusBar widget. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TGFrame.h"
25 
26 class TGStatusBarPart;
27 
28 
30 
31 friend class TGStatusBarPart;
32 
33 private:
34  TGStatusBar(const TGStatusBar&); // not implemented
35  TGStatusBar& operator=(const TGStatusBar&); // not implemented
36 
37 protected:
38  TGStatusBarPart **fStatusPart; // frames containing statusbar text
39  Int_t *fParts; // size of parts (in percent of total width)
40  Int_t fNpart; // number of parts
41  Int_t fYt; // y drawing position (depending on font)
42  Int_t *fXt; // x position for each part
43  Bool_t f3DCorner; // draw 3D corner (drawn by default)
44 
45  static const TGFont *fgDefaultFont;
46  static TGGC *fgDefaultGC;
47 
48  virtual void DoRedraw();
49 
51  static const TGGC &GetDefaultGC();
52 
53 public:
54  TGStatusBar(const TGWindow *p = 0, UInt_t w = 4, UInt_t h = 2,
57  virtual ~TGStatusBar();
58 
59  virtual void DrawBorder();
60  virtual void SetText(TGString *text, Int_t partidx = 0);
61  virtual void SetText(const char *text, Int_t partidx = 0);
62  void AddText(const char *text, Int_t partidx = 0)
63  { SetText(text, partidx); } //*MENU*
64  const char *GetText(Int_t partidx = 0) const;
65  virtual void SetParts(Int_t npart); //*MENU*
66  virtual void SetParts(Int_t *parts, Int_t npart);
67  void Draw3DCorner(Bool_t corner) { f3DCorner = corner; }
68  TGCompositeFrame *GetBarPart(Int_t npart) const;
70 
71  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
72 
73  ClassDef(TGStatusBar,0) // Status bar widget
74 };
75 
76 #endif
TGStatusBar::fXt
Int_t * fXt
Definition: TGStatusBar.h:42
TGStatusBar::SetParts
virtual void SetParts(Int_t npart)
Divide the status bar in npart equal sized parts.
Definition: TGStatusBar.cxx:292
TGStatusBar::GetDefaultGC
static const TGGC & GetDefaultGC()
Return default graphics context in use.
Definition: TGStatusBar.cxx:342
TGWindow
Definition: TGWindow.h:31
TGDimension
Definition: TGDimension.h:27
Option_t
const char Option_t
Definition: RtypesCore.h:66
Pixel_t
ULong_t Pixel_t
Definition: GuiTypes.h:39
TGStatusBar::fYt
Int_t fYt
Definition: TGStatusBar.h:41
FontStruct_t
Handle_t FontStruct_t
Definition: GuiTypes.h:38
Int_t
int Int_t
Definition: RtypesCore.h:45
TGStatusBar::SetText
virtual void SetText(TGString *text, Int_t partidx=0)
Set text in partition partidx in status bar.
Definition: TGStatusBar.cxx:144
TGFrame::GetDefaultFrameBackground
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:668
TGHorizontalFrame
Definition: TGFrame.h:423
text
TText * text
Definition: entrylist_figure1.C:10
bool
TGStatusBar::operator=
TGStatusBar & operator=(const TGStatusBar &)
TGStatusBar
Definition: TGStatusBar.h:29
TGStatusBar::fParts
Int_t * fParts
Definition: TGStatusBar.h:39
kSunkenFrame
@ kSunkenFrame
Definition: GuiTypes.h:383
TGStatusBar::TGStatusBarPart
friend class TGStatusBarPart
Definition: TGStatusBar.h:31
TGStatusBar::TGStatusBar
TGStatusBar(const TGStatusBar &)
TGStatusBar::GetDefaultSize
TGDimension GetDefaultSize() const
Return default size.
Definition: TGStatusBar.cxx:363
h
#define h(i)
Definition: RSha256.hxx:106
TGGC
Definition: TGGC.h:31
TGStatusBar::fgDefaultGC
static TGGC * fgDefaultGC
Definition: TGStatusBar.h:46
TGStatusBar::GetText
const char * GetText(Int_t partidx=0) const
return text in the part partidx
Definition: TGStatusBar.cxx:166
TGFrame.h
TGStatusBar::f3DCorner
Bool_t f3DCorner
Definition: TGStatusBar.h:43
TGStatusBar::fStatusPart
TGStatusBarPart ** fStatusPart
Definition: TGStatusBar.h:38
TGStatusBar::DrawBorder
virtual void DrawBorder()
Draw the status bar border (including cute 3d corner).
Definition: TGStatusBar.cxx:180
unsigned int
kHorizontalFrame
@ kHorizontalFrame
Definition: GuiTypes.h:382
TGStatusBar::AddText
void AddText(const char *text, Int_t partidx=0)
Definition: TGStatusBar.h:62
TGStatusBar::GetBarPart
TGCompositeFrame * GetBarPart(Int_t npart) const
Returns bar part.
Definition: TGStatusBar.cxx:355
TGStatusBar::~TGStatusBar
virtual ~TGStatusBar()
Delete status bar widget.
Definition: TGStatusBar.cxx:127
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGStatusBar::fNpart
Int_t fNpart
Definition: TGStatusBar.h:40
TGStatusBar::DoRedraw
virtual void DoRedraw()
Redraw status bar.
Definition: TGStatusBar.cxx:238
TGStatusBar::fgDefaultFont
static const TGFont * fgDefaultFont
Definition: TGStatusBar.h:45
TGFont
Definition: TGFont.h:149
TGStatusBar::GetDefaultFontStruct
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use.
Definition: TGStatusBar.cxx:332
TGCompositeFrame
Definition: TGFrame.h:324
TGStatusBar::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a status bar widget as a C++ statement(s) on output stream out.
Definition: TGStatusBar.cxx:376
TGString
Definition: TGString.h:30
int
TGStatusBar::Draw3DCorner
void Draw3DCorner(Bool_t corner)
Definition: TGStatusBar.h:67