ROOT logo
// @(#)root/gui:$Id: TGStatusBar.h 26692 2008-12-06 10:54:36Z bellenot $
// Author: Fons Rademakers   23/01/98

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TGStatusBar
#define ROOT_TGStatusBar


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TGStatusBar                                                          //
//                                                                      //
// Provides a StatusBar widget.                                         //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TGFrame
#include "TGFrame.h"
#endif

class TGStatusBarPart;


class TGStatusBar : public TGHorizontalFrame {

friend class TGStatusBarPart;

private:
   TGStatusBar(const TGStatusBar&);            // not implemented
   TGStatusBar& operator=(const TGStatusBar&); // not implemented

protected:
   TGStatusBarPart **fStatusPart; // frames containing statusbar text
   Int_t            *fParts;      // size of parts (in percent of total width)
   Int_t             fNpart;      // number of parts
   Int_t             fYt;         // y drawing position (depending on font)
   Int_t            *fXt;         // x position for each part
   Bool_t            f3DCorner;   // draw 3D corner (drawn by default)

   static const TGFont *fgDefaultFont;
   static TGGC         *fgDefaultGC;

   virtual void DoRedraw();

   static FontStruct_t  GetDefaultFontStruct();
   static const TGGC   &GetDefaultGC();

public:
   TGStatusBar(const TGWindow *p = 0, UInt_t w = 4, UInt_t h = 2,
               UInt_t options = kSunkenFrame | kHorizontalFrame,
               Pixel_t back = GetDefaultFrameBackground());
   virtual ~TGStatusBar();

   virtual void DrawBorder();
   virtual void SetText(TGString *text, Int_t partidx = 0);
   virtual void SetText(const char *text, Int_t partidx = 0);
           void AddText(const char *text, Int_t partidx = 0)
                  { SetText(text, partidx); }                  //*MENU*
   const char  *GetText(Int_t partidx = 0) const;
   virtual void SetParts(Int_t npart);                         //*MENU*
   virtual void SetParts(Int_t *parts, Int_t npart);
   void         Draw3DCorner(Bool_t corner) { f3DCorner = corner; }
   TGCompositeFrame *GetBarPart(Int_t npart) const;
   TGDimension GetDefaultSize() const;

   virtual void SavePrimitive(ostream &out, Option_t *option = "");

   ClassDef(TGStatusBar,0)  // Status bar widget
};

#endif
 TGStatusBar.h:1
 TGStatusBar.h:2
 TGStatusBar.h:3
 TGStatusBar.h:4
 TGStatusBar.h:5
 TGStatusBar.h:6
 TGStatusBar.h:7
 TGStatusBar.h:8
 TGStatusBar.h:9
 TGStatusBar.h:10
 TGStatusBar.h:11
 TGStatusBar.h:12
 TGStatusBar.h:13
 TGStatusBar.h:14
 TGStatusBar.h:15
 TGStatusBar.h:16
 TGStatusBar.h:17
 TGStatusBar.h:18
 TGStatusBar.h:19
 TGStatusBar.h:20
 TGStatusBar.h:21
 TGStatusBar.h:22
 TGStatusBar.h:23
 TGStatusBar.h:24
 TGStatusBar.h:25
 TGStatusBar.h:26
 TGStatusBar.h:27
 TGStatusBar.h:28
 TGStatusBar.h:29
 TGStatusBar.h:30
 TGStatusBar.h:31
 TGStatusBar.h:32
 TGStatusBar.h:33
 TGStatusBar.h:34
 TGStatusBar.h:35
 TGStatusBar.h:36
 TGStatusBar.h:37
 TGStatusBar.h:38
 TGStatusBar.h:39
 TGStatusBar.h:40
 TGStatusBar.h:41
 TGStatusBar.h:42
 TGStatusBar.h:43
 TGStatusBar.h:44
 TGStatusBar.h:45
 TGStatusBar.h:46
 TGStatusBar.h:47
 TGStatusBar.h:48
 TGStatusBar.h:49
 TGStatusBar.h:50
 TGStatusBar.h:51
 TGStatusBar.h:52
 TGStatusBar.h:53
 TGStatusBar.h:54
 TGStatusBar.h:55
 TGStatusBar.h:56
 TGStatusBar.h:57
 TGStatusBar.h:58
 TGStatusBar.h:59
 TGStatusBar.h:60
 TGStatusBar.h:61
 TGStatusBar.h:62
 TGStatusBar.h:63
 TGStatusBar.h:64
 TGStatusBar.h:65
 TGStatusBar.h:66
 TGStatusBar.h:67
 TGStatusBar.h:68
 TGStatusBar.h:69
 TGStatusBar.h:70
 TGStatusBar.h:71
 TGStatusBar.h:72
 TGStatusBar.h:73
 TGStatusBar.h:74
 TGStatusBar.h:75
 TGStatusBar.h:76
 TGStatusBar.h:77
 TGStatusBar.h:78