Logo ROOT  
Reference Guide
TGToolBar.h
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 25/02/98
3
4/*************************************************************************
5 * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TGToolBar
13#define ROOT_TGToolBar
14
15
16#include "TGFrame.h"
17
18class TGButton;
19class TGPictureButton;
20class TList;
21class TMap;
22
24 const char *fPixmap;
25 const char *fTipText;
29};
30
31
32
34
35protected:
36 TList *fPictures; ///< list of pictures that should be freed
37 TList *fTrash; ///< list of buttons and layout hints to be deleted
38 TMap *fMapOfButtons; ///< map of button/id pairs in this group
39
40private:
41 TGToolBar(const TGToolBar&) = delete;
42 TGToolBar& operator=(const TGToolBar&) = delete;
43
44public:
45 TGToolBar(const TGWindow *p = nullptr, UInt_t w = 1, UInt_t h = 1,
46 UInt_t options = kHorizontalFrame,
48 virtual ~TGToolBar();
49
50 virtual TGButton *AddButton(const TGWindow *w, ToolBarData_t *button, Int_t spacing = 0);
51 virtual TGButton *AddButton(const TGWindow *w, TGPictureButton *button, Int_t spacing = 0);
52
53 virtual void ChangeIcon(ToolBarData_t *button, const char *new_icon);
54 virtual void Cleanup();
55 virtual TGButton *GetButton(Int_t id) const;
56 virtual Long_t GetId(TGButton *button) const;
57 virtual void SetId(TGButton *button, Long_t id);
58
59 virtual void ButtonPressed();
60 virtual void ButtonReleased();
61 virtual void ButtonClicked();
62
63 virtual void Pressed(Int_t id) { Emit("Pressed(Int_t)",id); } //*SIGNAL*
64 virtual void Released(Int_t id) { Emit("Released(Int_t)",id);} //*SIGNAL*
65 virtual void Clicked(Int_t id) { Emit("Clicked(Int_t)",id); } //*SIGNAL*
66
67 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
68
69 ClassDef(TGToolBar,0) //A bar containing picture buttons
70};
71
72#endif
int Int_t
Definition: CPyCppyy.h:43
unsigned int UInt_t
Definition: CPyCppyy.h:44
long Long_t
Definition: CPyCppyy.h:50
@ kHorizontalFrame
Definition: GuiTypes.h:382
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
#define h(i)
Definition: RSha256.hxx:106
bool Bool_t
Definition: RtypesCore.h:63
const char Option_t
Definition: RtypesCore.h:66
#define ClassDef(name, id)
Definition: Rtypes.h:325
A button abstract base class.
Definition: TGButton.h:68
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:683
Handle_t GetId() const
Definition: TGObject.h:37
Yield an action as soon as it is clicked.
Definition: TGButton.h:228
A toolbar is a composite frame that contains TGPictureButtons.
Definition: TGToolBar.h:33
virtual TGButton * AddButton(const TGWindow *w, ToolBarData_t *button, Int_t spacing=0)
Add button to toolbar.
Definition: TGToolBar.cxx:92
TList * fTrash
list of buttons and layout hints to be deleted
Definition: TGToolBar.h:37
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGToolBar.cxx:214
TGToolBar & operator=(const TGToolBar &)=delete
virtual void SetId(TGButton *button, Long_t id)
changes id for button.
Definition: TGToolBar.cxx:172
virtual void Pressed(Int_t id)
Definition: TGToolBar.h:63
virtual void ButtonPressed()
This slot is activated when one of the buttons in the group emits the Pressed() signal.
Definition: TGToolBar.cxx:227
virtual void Clicked(Int_t id)
Definition: TGToolBar.h:65
virtual void ButtonClicked()
This slot is activated when one of the buttons in the group emits the Clicked() signal.
Definition: TGToolBar.cxx:257
TGToolBar(const TGToolBar &)=delete
virtual ~TGToolBar()
Delete toolbar and its buttons and layout hints.
Definition: TGToolBar.cxx:65
virtual void ButtonReleased()
This slot is activated when one of the buttons in the group emits the Released() signal.
Definition: TGToolBar.cxx:242
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an horizontal slider as a C++ statement(s) on output stream out.
Definition: TGToolBar.cxx:271
TList * fPictures
list of pictures that should be freed
Definition: TGToolBar.h:36
virtual void ChangeIcon(ToolBarData_t *button, const char *new_icon)
Change the icon of a toolbar button.
Definition: TGToolBar.cxx:196
virtual TGButton * GetButton(Int_t id) const
Finds and returns a pointer to the button with the specified identifier id.
Definition: TGToolBar.cxx:157
virtual void Released(Int_t id)
Definition: TGToolBar.h:64
TMap * fMapOfButtons
map of button/id pairs in this group
Definition: TGToolBar.h:38
ROOT GUI Window base class.
Definition: TGWindow.h:23
A doubly linked list.
Definition: TList.h:44
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition: TMap.h:40
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
const char * fTipText
Definition: TGToolBar.h:25
TGButton * fButton
Definition: TGToolBar.h:28
Bool_t fStayDown
Definition: TGToolBar.h:26
const char * fPixmap
Definition: TGToolBar.h:24