library: libGpad #include "TControlBar.h" |
TControlBar
class description - source file - inheritance tree (.pdf)
private:
virtual void Create()
void Initialize(Int_t x, Int_t y)
public:
TControlBar()
TControlBar(const char* orientation, const char* title = "")
TControlBar(const char* orientation, const char* title, Int_t x, Int_t y)
TControlBar(const TControlBar&)
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()
static TClass* Class()
TControlBarButton* GetClicked() const
TControlBarImp* GetControlBarImp() const
TList* GetListOfButtons() const
Int_t GetNumberOfColumns() const
Int_t GetNumberOfRows() const
Int_t GetOrientation() const
void Hide()
virtual TClass* IsA() const
TControlBar& operator=(const TControlBar&)
void SetFont(const char* fontName)
void SetNumberOfColumns(Int_t n)
void SetNumberOfRows(Int_t n)
void SetOrientation(const char* o)
void SetOrientation(Int_t o)
void SetTextColor(const char* colorName)
void Show()
virtual void ShowMembers(TMemberInspector& insp, char* parent)
virtual void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
protected:
TControlBarImp* fControlBarImp system specific implementation
Int_t fOrientation orientation
TList* fButtons list of buttons
Int_t fNoroc number of rows or columns
public:
static const enum TControlBar:: kVertical
static const enum TControlBar:: kHorizontal
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();
}
/*
*/
TControlBar() : TControlBarButton()
TControlBar(const char *orientation, const char *title)
: TControlBarButton(title, "", "", "button")
TControlBar(const char *orientation, const char *title, Int_t x, Int_t y)
: TControlBarButton(title, "", "", "button")
~TControlBar()
void AddButton(TControlBarButton &button)
void AddButton(TControlBarButton *button)
void AddButton(const char *label, const char *action, const char *hint, const char *type)
void AddControlBar(TControlBar &controlBar)
void AddControlBar(TControlBar *controlBar)
void AddSeparator()
void Create()
void Hide()
void Initialize(Int_t x, Int_t y)
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 SetOrientation(const char *o)
void SetOrientation(Int_t o)
void Show()
TControlBarButton* GetClicked() const
Returns a pointer to the last clicked controlbar button;
null if no button was clicked yet
Inline Functions
TControlBarImp* GetControlBarImp() const
TList* GetListOfButtons() const
Int_t GetNumberOfColumns() const
Int_t GetNumberOfRows() const
Int_t GetOrientation() const
void SetNumberOfColumns(Int_t n)
void SetNumberOfRows(Int_t n)
TClass* Class()
TClass* IsA() const
void ShowMembers(TMemberInspector& insp, char* parent)
void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
TControlBar TControlBar(const TControlBar&)
TControlBar& operator=(const TControlBar&)
Author: Nenad Buncic 20/02/96
Last update: root/gpad:$Name: $:$Id: TControlBar.cxx,v 1.7 2005/08/02 16:43:21 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
ROOT page - Class index - Class Hierarchy - Top of the page
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.