Logo ROOT  
Reference Guide
No Matches
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 25/02/98
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 *************************************************************************/
12#ifndef ROOT_TGToolBar
13#define ROOT_TGToolBar
16#include "TGFrame.h"
18class TGButton;
19class TGPictureButton;
20class TList;
21class TMap;
24 const char *fPixmap;
25 const char *fTipText;
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
41 TGToolBar(const TGToolBar&) = delete;
42 TGToolBar& operator=(const TGToolBar&) = delete;
45 TGToolBar(const TGWindow *p = nullptr, UInt_t w = 1, UInt_t h = 1,
46 UInt_t options = kHorizontalFrame,
48 ~TGToolBar() override;
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);
53 virtual void ChangeIcon(ToolBarData_t *button, const char *new_icon);
54 void Cleanup() override;
55 virtual TGButton *GetButton(Int_t id) const;
56 virtual Longptr_t GetId(TGButton *button) const;
57 virtual void SetId(TGButton *button, Longptr_t id);
59 virtual void ButtonPressed();
60 virtual void ButtonReleased();
61 virtual void ButtonClicked();
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*
67 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
69 ClassDefOverride(TGToolBar,0) //A bar containing picture buttons
@ kHorizontalFrame
Definition GuiTypes.h:382
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
#define h(i)
Definition RSha256.hxx:106
long Longptr_t
Definition RtypesCore.h:82
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t button
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:41
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 SetId(TGButton *button, Longptr_t id)
changes id for button.
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.
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.
TGToolBar & operator=(const TGToolBar &)=delete
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save an horizontal slider as a C++ statement(s) on output stream out.
TGToolBar(const TGToolBar &)=delete
virtual void ButtonReleased()
This slot is activated when one of the buttons in the group emits the Released() signal.
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.
virtual TGButton * GetButton(Int_t id) const
Finds and returns a pointer to the button with the specified identifier id.
virtual void Released(Int_t id)
Definition TGToolBar.h:64
void Cleanup() override
Cleanup and delete all objects contained in this composite frame.
TMap * fMapOfButtons
map of button/id pairs in this group
Definition TGToolBar.h:38
~TGToolBar() override
Delete toolbar and its buttons and layout hints.
Definition TGToolBar.cxx:65
ROOT GUI Window base class.
Definition TGWindow.h:23
A doubly linked list.
Definition TList.h:38
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