ROOT » GRAF2D » GPAD » TControlBar

class TControlBar: public TControlBarButton

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).

 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.

   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");

/* */

Function Members (Methods)

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)
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
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()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
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(ostream& 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)
virtual voidShowMembers(TMemberInspector& insp) const
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
TControlBar(const TControlBar&)
TControlBar(const char* orientation, const char* title = "")
TControlBar(const char* orientation, const char* title, Int_t x, Int_t y)
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
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
virtual voidCreate()
voidInitialize(Int_t x, Int_t y)

Data Members

static TObject::(anonymous)TObject::kBitMask
static TControlBarButton::(anonymous)TControlBarButton::kButton
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static TControlBarButton::(anonymous)TControlBarButton::kDrawnButton
static TObject::EStatusBitsTObject::kHasUUID
static TControlBar::(anonymous)kHorizontal
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TObject::EStatusBitsTObject::kMustCleanup
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TControlBarButton::(anonymous)TControlBarButton::kSeparator
static TObject::(anonymous)TObject::kSingleKey
static TControlBar::(anonymous)kVertical
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
TStringTControlBarButton::fActionaction to be executed
TList*fButtonslist of buttons
TControlBarImp*fControlBarImpsystem specific implementation
TStringTNamed::fNameobject identifier
Int_tfNorocnumber of rows or columns
TStringTNamed::fTitleobject title
Int_tTControlBarButton::fTypebutton type

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

 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.
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,
 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() const
 Returns a pointer to the last clicked controlbar button;
 null if no button was clicked yet
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 SetNumberOfColumns(Int_t n)
{ fNoroc = n; }
void SetNumberOfRows(Int_t n)
{ fNoroc = n; }