Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TControlBar.h
Go to the documentation of this file.
1 // @(#)root/gpad:$Id$
2 // Author: Nenad Buncic 20/02/96
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_TControlBar
13 #define ROOT_TControlBar
14 
15 
16 #include "TControlBarButton.h"
17 
18 #include "TControlBarImp.h"
19 
20 class TList;
21 
22 class TControlBar : public TControlBarButton {
23 
24 friend class TControlBarImp;
25 
26 private:
27  virtual void Create();
28  void Initialize(Int_t x, Int_t y);
29 
30 protected:
31 
32  TControlBarImp *fControlBarImp; ///< system specific implementation
33  Int_t fOrientation; ///< orientation
34  TList *fButtons; ///< list of buttons
35  Int_t fNoroc; ///< number of rows or columns
36 
37 public:
38  enum { kVertical = 1, kHorizontal = 2 };
39 
40  TControlBar();
41  TControlBar(const char *orientation, const char *title="");
42  TControlBar(const char *orientation, const char *title, Int_t x, Int_t y);
43  virtual ~TControlBar();
44 
45  void AddButton(TControlBarButton *button);
46  void AddButton(TControlBarButton &button);
47  void AddButton(const char *label, const char *action, const char *hint="", const char *type="button");
48  void AddControlBar(TControlBar *controlBar);
49  void AddControlBar(TControlBar &controlBar);
50  void AddSeparator();
51  TControlBarButton *GetClicked() const;
52  TControlBarImp *GetControlBarImp() const { return fControlBarImp; }
53  TList *GetListOfButtons() const { return fButtons; }
54  Int_t GetNumberOfColumns() const { return fNoroc; }
55  Int_t GetNumberOfRows() const { return fNoroc; }
56  Int_t GetOrientation() const { return fOrientation; }
57  void Hide();
58  void SetButtonState(const char *label, Int_t state = 0);
59  void SetFont(const char *fontName);
60  void SetTextColor(const char *colorName);
61  void SetNumberOfColumns(Int_t n) { fNoroc = n; }
62  void SetNumberOfRows(Int_t n) { fNoroc = n; }
63  void SetOrientation(const char *o);
64  void SetOrientation(Int_t o);
65  void SetButtonWidth(UInt_t width);
66  void Show();
67 
68  ClassDef(TControlBar,0) //Control bar
69 };
70 
71 #endif