TControlBar.h

Go to the documentation of this file.
00001 // @(#)root/gpad:$Id: TControlBar.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Nenad Buncic   20/02/96
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_TControlBar
00013 #define ROOT_TControlBar
00014 
00015 
00016 /////////////////////////////////////////////////////////////////////////
00017 //                                                                     //
00018 // TControlBar                                                         //
00019 //                                                                     //
00020 //   ControlBar is fully user configurable tool which provides fast    //
00021 // access to frequently used operations. User can choose between       //
00022 // buttons and drawnbuttons (let's say icons) and assign to them his   //
00023 // own actions (let's say ROOT or C++ commands).                       //
00024 //                                                                     //
00025 /////////////////////////////////////////////////////////////////////////
00026 
00027 #ifndef ROOT_TControlBarButton
00028 #include "TControlBarButton.h"
00029 #endif
00030 
00031 #ifndef ROOT_TControlBarImp
00032 #include "TControlBarImp.h"
00033 #endif
00034 
00035 class TList;
00036 
00037 class TControlBar : public TControlBarButton {
00038 
00039 friend class  TControlBarImp;
00040 
00041 private:
00042    virtual void   Create();
00043    void           Initialize(Int_t x, Int_t y);
00044 
00045 protected:
00046 
00047    TControlBarImp *fControlBarImp;  //system specific implementation
00048    Int_t           fOrientation;    //orientation
00049    TList          *fButtons;        //list of buttons
00050    Int_t           fNoroc;          //number of rows or columns
00051    
00052 public:
00053    enum { kVertical = 1, kHorizontal = 2 };
00054 
00055    TControlBar();
00056    TControlBar(const char *orientation, const char *title="");
00057    TControlBar(const char *orientation, const char *title, Int_t x, Int_t y);
00058    virtual ~TControlBar();
00059 
00060    void            AddButton(TControlBarButton *button);
00061    void            AddButton(TControlBarButton &button);
00062    void            AddButton(const char *label, const char *action, const char *hint="", const char *type="button");
00063    void            AddControlBar(TControlBar *controlBar);
00064    void            AddControlBar(TControlBar &controlBar);
00065    void            AddSeparator();
00066    TControlBarButton *GetClicked() const;      
00067    TControlBarImp *GetControlBarImp() const   { return fControlBarImp; }
00068    TList          *GetListOfButtons() const   { return fButtons; }
00069    Int_t           GetNumberOfColumns() const { return fNoroc; }
00070    Int_t           GetNumberOfRows() const    { return fNoroc; }
00071    Int_t           GetOrientation() const     { return fOrientation; }
00072    void            Hide();
00073    void            SetButtonState(const char *label, Int_t state = 0);
00074    void            SetFont(const char *fontName);
00075    void            SetTextColor(const char *colorName);
00076    void            SetNumberOfColumns(Int_t n) { fNoroc = n; }
00077    void            SetNumberOfRows(Int_t n) { fNoroc = n; }
00078    void            SetOrientation(const char *o);
00079    void            SetOrientation(Int_t o);
00080    void            SetButtonWidth(UInt_t width);
00081    void            Show();
00082 
00083    ClassDef(TControlBar,0) //Control bar
00084 };
00085 
00086 #endif

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