Logo ROOT  
Reference Guide
TGButtonGroup.h
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Valeriy Onuchin & Fons Rademakers 16/10/2000
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, 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_TGButtonGroup
13#define ROOT_TGButtonGroup
14
15
16#include "TGFrame.h"
17
18class TGButton;
19class TMap;
20
22
23friend class TGButton;
24
25private:
26 TGButtonGroup(const TGButtonGroup&) = delete;
28
29protected:
30 Bool_t fState; ///< kTRUE if group is enabled
31 Bool_t fExclGroup; ///< kTRUE if group is exclusive
32 Bool_t fRadioExcl; ///< kTRUE if radio buttons are exclusive
33 Bool_t fDrawBorder; ///< kTRUE if border and title are drawn
34 TMap *fMapOfButtons; ///< map of button/id pairs in this group
35
36 void Init();
37 virtual void DoRedraw();
38
39public:
40 TGButtonGroup(const TGWindow *parent = 0,
41 const TString &title = "",
43 GContext_t norm = GetDefaultGC()(),
46
47 TGButtonGroup(const TGWindow *parent,
48 UInt_t r, UInt_t c, Int_t s = 0, Int_t h = 0 ,
49 const TString &title = "",
50 GContext_t norm = GetDefaultGC()(),
53
54 virtual ~TGButtonGroup();
55
56 virtual void Pressed(Int_t id) { Emit("Pressed(Int_t)",id); } //*SIGNAL*
57 virtual void Released(Int_t id) { Emit("Released(Int_t)",id);} //*SIGNAL*
58 virtual void Clicked(Int_t id) { Emit("Clicked(Int_t)",id); } //*SIGNAL*
59
60 virtual void ButtonPressed();
61 virtual void ButtonReleased();
62 virtual void ButtonClicked();
63 virtual void ReleaseButtons();
64
65 Bool_t IsEnabled() const { return fState; }
66 Bool_t IsExclusive() const { return fExclGroup; }
68 Bool_t IsBorderDrawn() const { return fDrawBorder; }
69 Int_t GetCount() const;
70 Int_t GetId(TGButton *button) const;
71
72 virtual void SetExclusive(Bool_t flag = kTRUE);
73 virtual void SetRadioButtonExclusive(Bool_t flag = kTRUE);
74 virtual void SetState(Bool_t state = kTRUE);
75 virtual void SetBorderDrawn(Bool_t enable = kTRUE);
76 virtual void SetButton(Int_t id, Bool_t down = kTRUE);
77 virtual void SetTitle(TGString *title);
78 virtual void SetTitle(const char *title);
79
80 virtual Int_t Insert(TGButton *button, int id = -1);
81 virtual void Remove(TGButton *button);
82 virtual TGButton *Find(Int_t id) const;
83 virtual TGButton *GetButton(Int_t id) const { return Find(id); }
84 virtual void Show();
85 virtual void Hide();
86 virtual void DrawBorder();
87 virtual void SetLayoutHints(TGLayoutHints *l, TGButton *button = 0);
88 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
89
90 ClassDef(TGButtonGroup,0) // Organizes TGButtons in a group
91};
92
93
95
96public:
97 TGVButtonGroup(const TGWindow *parent,
98 const TString &title = "",
99 GContext_t norm = GetDefaultGC()(),
103 norm, font, back) { }
104
105 virtual ~TGVButtonGroup() { }
106 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
107
108 ClassDef(TGVButtonGroup,0) // A button group with one vertical column
109};
110
111
113
114public:
116 const TString &title = "",
117 GContext_t norm = GetDefaultGC()(),
121 norm, font, back) { }
122
123 virtual ~TGHButtonGroup() { }
124 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
125
126 ClassDef(TGHButtonGroup,0) // A button group with one horizontal row
127};
128
129#endif
@ kChildFrame
Definition: GuiTypes.h:379
@ kVerticalFrame
Definition: GuiTypes.h:381
@ kHorizontalFrame
Definition: GuiTypes.h:382
Handle_t GContext_t
Graphics context handle.
Definition: GuiTypes.h:38
Handle_t FontStruct_t
Pointer to font structure.
Definition: GuiTypes.h:39
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
ROOT::R::TRInterface & r
Definition: Object.C:4
#define c(i)
Definition: RSha256.hxx:101
#define h(i)
Definition: RSha256.hxx:106
int Int_t
Definition: RtypesCore.h:45
unsigned int UInt_t
Definition: RtypesCore.h:46
bool Bool_t
Definition: RtypesCore.h:63
const Bool_t kTRUE
Definition: RtypesCore.h:100
const char Option_t
Definition: RtypesCore.h:66
#define ClassDef(name, id)
Definition: Rtypes.h:325
Organizes TGButton widgets in a group.
Definition: TGButtonGroup.h:21
virtual ~TGButtonGroup()
Destructor, we do not delete the buttons.
Int_t GetCount() const
Returns number of buttons in group.
virtual void Clicked(Int_t id)
Definition: TGButtonGroup.h:58
virtual void ButtonClicked()
This slot is activated when one of the buttons in the group emits the Clicked() signal.
virtual void SetRadioButtonExclusive(Bool_t flag=kTRUE)
If enable is kTRUE, this button group will treat radio buttons as mutually exclusive,...
virtual void Show()
Show group of buttons.
virtual void DrawBorder()
Draw border of around the group frame.
Bool_t fState
kTRUE if group is enabled
Definition: TGButtonGroup.h:30
virtual void SetExclusive(Bool_t flag=kTRUE)
Sets the button group to be exclusive if enable is kTRUE, or to be non-exclusive if enable is kFALSE.
virtual void Pressed(Int_t id)
Definition: TGButtonGroup.h:56
virtual void ButtonPressed()
This slot is activated when one of the buttons in the group emits the Pressed() signal.
TGButtonGroup(const TGButtonGroup &)=delete
Bool_t IsEnabled() const
Definition: TGButtonGroup.h:65
Bool_t IsExclusive() const
Definition: TGButtonGroup.h:66
virtual void SetState(Bool_t state=kTRUE)
Sets the state of all the buttons in the group to enable or disable.
virtual void ReleaseButtons()
This slot is activated when one of the buttons in the exclusive group emits the Pressed() signal.
virtual TGButton * Find(Int_t id) const
Finds and returns a pointer to the button with the specified identifier id.
Bool_t fDrawBorder
kTRUE if border and title are drawn
Definition: TGButtonGroup.h:33
Bool_t IsRadioButtonExclusive() const
Definition: TGButtonGroup.h:67
virtual void DoRedraw()
Redraw the group frame.
TGButtonGroup & operator=(const TGButtonGroup &)=delete
virtual void SetLayoutHints(TGLayoutHints *l, TGButton *button=0)
Set layout hints for the specified button or if button=0 for all buttons.
Bool_t IsBorderDrawn() const
Definition: TGButtonGroup.h:68
virtual void SetButton(Int_t id, Bool_t down=kTRUE)
Sets the button with id to be on/down, and if this is an exclusive group, all other button in the gro...
Bool_t fExclGroup
kTRUE if group is exclusive
Definition: TGButtonGroup.h:31
virtual TGButton * GetButton(Int_t id) const
Definition: TGButtonGroup.h:83
void Init()
Default init.
virtual void ButtonReleased()
This slot is activated when one of the buttons in the group emits the Released() signal.
TMap * fMapOfButtons
map of button/id pairs in this group
Definition: TGButtonGroup.h:34
virtual void SetTitle(TGString *title)
Set or change title.
virtual void Hide()
Hide group of buttons.
virtual void Remove(TGButton *button)
Removes a button from the button group.
virtual Int_t Insert(TGButton *button, int id=-1)
Inserts a button with the identifier id into the button group.
virtual void SetBorderDrawn(Bool_t enable=kTRUE)
Makes border to be visible/invisible.
Bool_t fRadioExcl
kTRUE if radio buttons are exclusive
Definition: TGButtonGroup.h:32
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a button group widget as a C++ statement(s) on output stream out.
virtual void Released(Int_t id)
Definition: TGButtonGroup.h:57
A button abstract base class.
Definition: TGButton.h:68
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:683
A composite frame with a border and a title.
Definition: TGFrame.h:523
static const TGGC & GetDefaultGC()
Return default graphics context in use.
Definition: TGFrame.cxx:2345
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use.
Definition: TGFrame.cxx:2335
Organizes TGButton widgets in a group with one horizontal row.
TGHButtonGroup(const TGWindow *parent, const TString &title="", GContext_t norm=GetDefaultGC()(), FontStruct_t font=GetDefaultFontStruct(), Pixel_t back=GetDefaultFrameBackground())
virtual ~TGHButtonGroup()
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a button group widget as a C++ statement(s) on output stream out.
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
Handle_t GetId() const
Definition: TGObject.h:37
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Definition: TGString.h:20
Organizes TGButton widgets in a group with one vertical column.
Definition: TGButtonGroup.h:94
TGVButtonGroup(const TGWindow *parent, const TString &title="", GContext_t norm=GetDefaultGC()(), FontStruct_t font=GetDefaultFontStruct(), Pixel_t back=GetDefaultFrameBackground())
Definition: TGButtonGroup.h:97
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a button group widget as a C++ statement(s) on output stream out.
virtual ~TGVButtonGroup()
ROOT GUI Window base class.
Definition: TGWindow.h:23
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
Basic string class.
Definition: TString.h:136
static constexpr double s
auto * l
Definition: textangle.C:4