class TControlBar: public TControlBarButton


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

 The macro belows shows an example of controlbar.
 To execute an item, click with the left mouse button.
 To see the HELP of a button, click on the right mouse button.

 You have access to the last clicked button via the method
 GetClicked(). For example, bar->GetClicked()->GetName()
 will return the name of the last clicked button.


{
   gROOT.Reset("a");
   TControlBar bar("vertical");
   bar.AddButton("Help to run demos",".x demoshelp.C",
                 "Explains how to run the demos");
   bar.AddButton("framework",        ".x framework.C",
                 "An Example of Object Oriented User Interface");
   bar.AddButton("hsimple",          ".x hsimple.C",
                 "An Example Creating Histograms/Ntuples on File");
   bar.AddButton("hsum",             ".x hsum.C",
                 "Filling histograms and some graphics options");
   bar.AddButton("canvas",           ".x canvas.C",
                 "Canvas and Pad Management");
   bar.AddButton("formula1",         ".x formula1.C",
                 "Simple Formula and Functions");
   bar.AddButton("fillrandom",       ".x fillrandom.C",
                 "Histograms with Random Numbers from a Function");
   bar.AddButton("fit1",             ".x fit1.C",
                 "A Simple Fitting Example");
   bar.AddButton("h1draw",           ".x h1draw.C",
                 "Drawing Options for 1D Histograms");
   bar.AddButton("graph",            ".x graph.C",
                 "Examples of a simple graph");
   bar.AddButton("tornado",          ".x tornado.C",
                 "Examples of 3-D PolyMarkers");
   bar.AddButton("shapes",           ".x shapes.C",
                 "The Geometry Shapes");
   bar.AddButton("atlasna49",        ".x atlasna49.C",
                 "Creating and Viewing Geometries");
   bar.AddButton("file_layout",      ".x file.C",
                 "The ROOT file format");
   bar.AddButton("tree_layout",      ".x tree.C",
                 "The Tree Data Structure");
   bar.AddButton("ntuple1",          ".x ntuple1.C",
                 "Ntuples and Selections");
   bar.AddButton("run benchmarks",   ".x benchmarks.C",
                 "Runs all the ROOT benchmarks");
   bar.AddButton("rootmarks",        ".x rootmarks.C",
                 "Prints an estimated ROOTMARKS for your machine");
   bar.AddButton("edit_hsimple",     ".!ved hsimple.C &",
                 "Invokes the text editor on file hsimple.C");
   bar.AddButton("Close Bar",        "gROOT.Reset(\"a\")",
                 "Close ControlBar");
   bar.Show();
   gROOT.SaveContext();
}


/* */



Function Members (Methods)

public:
TControlBar()
TControlBar(const TControlBar&)
TControlBar(const char* orientation, const char* title = "")
TControlBar(const char* orientation, const char* title, Int_t x, Int_t y)
virtual~TControlBar()
voidTObject::AbstractMethod(const char* method) const
virtual voidTControlBarButton::Action()
voidAddButton(TControlBarButton* button)
voidAddButton(TControlBarButton& button)
voidAddButton(const char* label, const char* action, const char* hint = "", const char* type = "button")
voidAddControlBar(TControlBar* controlBar)
voidAddControlBar(TControlBar& controlBar)
voidAddSeparator()
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual const char*TControlBarButton::GetAction() const
TControlBarButton*GetClicked() const
TControlBarImp*GetControlBarImp() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
TList*GetListOfButtons() const
virtual const char*TNamed::GetName() const
Int_tGetNumberOfColumns() const
Int_tGetNumberOfRows() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
Int_tGetOrientation() const
virtual const char*TNamed::GetTitle() const
virtual Int_tTControlBarButton::GetType() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
voidHide()
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TControlBar&operator=(const TControlBar&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
virtual voidTControlBarButton::SetAction(const char* action)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetButtonState(const char* label, Int_t state = 0)
voidSetButtonWidth(UInt_t width)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetFont(const char* fontName)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
voidSetNumberOfColumns(Int_t n)
voidSetNumberOfRows(Int_t n)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetOrientation(const char* o)
voidSetOrientation(Int_t o)
voidSetTextColor(const char* colorName)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTControlBarButton::SetType(const char* type)
virtual voidTControlBarButton::SetType(Int_t type)
virtual voidTObject::SetUniqueID(UInt_t uid)
voidShow()
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
private:
virtual voidCreate()
voidInitialize(Int_t x, Int_t y)

Data Members

public:
enum { kVertical
kHorizontal
};
enum TControlBarButton::[unnamed] { kButton
kDrawnButton
kSeparator
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
TStringTControlBarButton::fActionaction to be executed
TList*fButtonslist of buttons
TControlBarImp*fControlBarImpsystem specific implementation
TStringTNamed::fNameobject identifier
Int_tfNorocnumber of rows or columns
Int_tfOrientationorientation
TStringTNamed::fTitleobject title
Int_tTControlBarButton::fTypebutton type

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TControlBar(const TControlBar& )
 Default constructor.
TControlBar(const char* orientation, const char* title = "")
 Normal constructor.
TControlBar(const char* orientation, const char* title, Int_t x, Int_t y)
 Normal constructor.
~TControlBar()
 Destructor.
void AddButton(TControlBarButton &button)
 Add button.
void AddButton(TControlBarButton *button)
 Add button.
void AddButton(const char* label, const char* action, const char* hint = "", const char* type = "button")
 Add button.
void AddControlBar(TControlBar &controlBar)
 Add controlbar.
void AddControlBar(TControlBar *controlBar)
 Add controlbar.
void AddSeparator()
 Add separator.
void Create()
 Create controlbar.
void Hide()
 Hide controlbar.
void Initialize(Int_t x, Int_t y)
 Initialize controlbar.
void SetFont(const char* fontName)
 Sets new font for control bar buttons, e.g.:
 root > .x tutorials/demos.C
 root > bar->SetFont("-adobe-helvetica-bold-r-*-*-24-*-*-*-*-*-iso8859-1")
void SetTextColor(const char* colorName)
 Sets text color for control bar buttons, e.g.:
 root > .x tutorials/demos.C
 root > bar->SetTextColor("red")
void SetButtonState(const char* label, Int_t state = 0)
 Sets a state for control bar button 'label'; possible states are
 0-kButtonUp, 1-kButtonDown, 2-kButtonEngaged, 3-kButtonDisabled,
 e.g.:
 root > .x tutorials/demos.C
 to disable the button 'first' do:
 root > bar->SetButtonState("first", 3)
 to enable the button 'first' do:
 root > bar->SetButtonState("first", 0)
void SetButtonWidth(UInt_t width)
 Sets the width in pixels for control bar button.
void SetOrientation(const char *o)
 Set controlbar orientation.
void SetOrientation(Int_t o)
 Set controlbar orientation.
void Show()
 Show controlbar.
TControlBarButton * GetClicked()
 Returns a pointer to the last clicked controlbar button;
 null if no button was clicked yet
TControlBar(const TControlBar& )
TControlBarImp * GetControlBarImp()
{ return fControlBarImp; }
TList * GetListOfButtons()
{ return fButtons; }
Int_t GetNumberOfColumns()
{ return fNoroc; }
Int_t GetNumberOfRows()
{ return fNoroc; }
Int_t GetOrientation()
{ return fOrientation; }
void SetNumberOfColumns(Int_t n)
{ fNoroc = n; }
void SetNumberOfRows(Int_t n)
{ fNoroc = n; }

Author: Nenad Buncic 20/02/96
Last change: root/gpad:$Id: TControlBar.h 20882 2007-11-19 11:31:26Z rdm $
Last generated: 2008-06-25 08:35
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.