// @(#)root/gpad:$Id$
// Author: Nenad Buncic   20/02/96

/*************************************************************************
 * 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_TControlBar
#define ROOT_TControlBar


/////////////////////////////////////////////////////////////////////////
//                                                                     //
// TControlBar                                                         //
//                                                                     //
//   ControlBar is a fully user configurable tool which provides fast  //
// access to frequently used operations. The user can choose between   //
// buttons and drawnbuttons (let's say icons) and assign to them their //
// own actions (let's say ROOT or C++ commands).                       //
//                                                                     //
/////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TControlBarButton
#include "TControlBarButton.h"
#endif

#ifndef ROOT_TControlBarImp
#include "TControlBarImp.h"
#endif

class TList;

class TControlBar : public TControlBarButton {

friend class  TControlBarImp;

private:
   virtual void   Create();
   void           Initialize(Int_t x, Int_t y);

protected:

   TControlBarImp *fControlBarImp;  //system specific implementation
   Int_t           fOrientation;    //orientation
   TList          *fButtons;        //list of buttons
   Int_t           fNoroc;          //number of rows or columns
   
public:
   enum { kVertical = 1, kHorizontal = 2 };

   TControlBar();
   TControlBar(const char *orientation, const char *title="");
   TControlBar(const char *orientation, const char *title, Int_t x, Int_t y);
   virtual ~TControlBar();

   void            AddButton(TControlBarButton *button);
   void            AddButton(TControlBarButton &button);
   void            AddButton(const char *label, const char *action, const char *hint="", const char *type="button");
   void            AddControlBar(TControlBar *controlBar);
   void            AddControlBar(TControlBar &controlBar);
   void            AddSeparator();
   TControlBarButton *GetClicked() const;      
   TControlBarImp *GetControlBarImp() const   { return fControlBarImp; }
   TList          *GetListOfButtons() const   { return fButtons; }
   Int_t           GetNumberOfColumns() const { return fNoroc; }
   Int_t           GetNumberOfRows() const    { return fNoroc; }
   Int_t           GetOrientation() const     { return fOrientation; }
   void            Hide();
   void            SetButtonState(const char *label, Int_t state = 0);
   void            SetFont(const char *fontName);
   void            SetTextColor(const char *colorName);
   void            SetNumberOfColumns(Int_t n) { fNoroc = n; }
   void            SetNumberOfRows(Int_t n) { fNoroc = n; }
   void            SetOrientation(const char *o);
   void            SetOrientation(Int_t o);
   void            SetButtonWidth(UInt_t width);
   void            Show();

   ClassDef(TControlBar,0) //Control bar
};

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