12 #ifndef ROOT_TGButtonGroup
13 #define ROOT_TGButtonGroup
31 class TGButtonGroup :
public TGGroupFrame {
33 friend class TGButton;
36 TGButtonGroup(
const TGButtonGroup&);
37 TGButtonGroup& operator=(
const TGButtonGroup&);
47 virtual void DoRedraw();
50 TGButtonGroup(
const TGWindow *parent = 0,
51 const TString &title =
"",
52 UInt_t options = kChildFrame | kVerticalFrame,
53 GContext_t norm = GetDefaultGC()(),
54 FontStruct_t font = GetDefaultFontStruct(),
55 Pixel_t back = GetDefaultFrameBackground());
57 TGButtonGroup(
const TGWindow *parent,
58 UInt_t r, UInt_t c, Int_t s = 0, Int_t h = 0 ,
59 const TString &title =
"",
60 GContext_t norm = GetDefaultGC()(),
61 FontStruct_t font = GetDefaultFontStruct(),
62 Pixel_t back = GetDefaultFrameBackground());
64 virtual ~TGButtonGroup();
66 virtual void Pressed(Int_t
id) { Emit(
"Pressed(Int_t)",
id); }
67 virtual void Released(Int_t
id) { Emit(
"Released(Int_t)",
id);}
68 virtual void Clicked(Int_t
id) { Emit(
"Clicked(Int_t)",
id); }
70 virtual void ButtonPressed();
71 virtual void ButtonReleased();
72 virtual void ButtonClicked();
73 virtual void ReleaseButtons();
75 Bool_t IsEnabled()
const {
return fState; }
76 Bool_t IsExclusive()
const {
return fExclGroup; }
77 Bool_t IsRadioButtonExclusive()
const {
return fRadioExcl; }
78 Bool_t IsBorderDrawn()
const {
return fDrawBorder; }
79 Int_t GetCount()
const {
return fMapOfButtons->GetSize(); }
80 Int_t GetId(TGButton *button)
const;
82 virtual void SetExclusive(Bool_t flag = kTRUE);
83 virtual void SetRadioButtonExclusive(Bool_t flag = kTRUE);
84 virtual void SetState(Bool_t state = kTRUE);
85 virtual void SetBorderDrawn(Bool_t enable = kTRUE);
86 virtual void SetButton(Int_t
id, Bool_t down = kTRUE);
87 virtual void SetTitle(TGString *title);
88 virtual void SetTitle(
const char *title);
90 virtual Int_t Insert(TGButton *button,
int id = -1);
91 virtual void Remove(TGButton *button);
92 virtual TGButton *Find(Int_t
id)
const;
93 virtual TGButton *GetButton(Int_t
id)
const {
return Find(
id); }
96 virtual void DrawBorder();
97 virtual void SetLayoutHints(TGLayoutHints *l, TGButton *button = 0);
98 virtual void SavePrimitive(std::ostream &out, Option_t *option =
"");
100 ClassDef(TGButtonGroup,0)
104 class TGVButtonGroup :
public TGButtonGroup {
107 TGVButtonGroup(
const TGWindow *parent,
108 const TString &title =
"",
109 GContext_t norm = GetDefaultGC()(),
110 FontStruct_t font = GetDefaultFontStruct(),
111 Pixel_t back = GetDefaultFrameBackground()) :
112 TGButtonGroup(parent, title, kChildFrame | kVerticalFrame,
113 norm, font, back) { }
115 virtual ~TGVButtonGroup() { }
116 virtual void SavePrimitive(std::ostream &out, Option_t *option =
"");
118 ClassDef(TGVButtonGroup,0)
122 class TGHButtonGroup :
public TGButtonGroup {
125 TGHButtonGroup(
const TGWindow *parent,
126 const TString &title =
"",
127 GContext_t norm = GetDefaultGC()(),
128 FontStruct_t font = GetDefaultFontStruct(),
129 Pixel_t back = GetDefaultFrameBackground()) :
130 TGButtonGroup(parent, title, kChildFrame | kHorizontalFrame,
131 norm, font, back) { }
133 virtual ~TGHButtonGroup() { }
134 virtual void SavePrimitive(std::ostream &out, Option_t *option =
"");
136 ClassDef(TGHButtonGroup,0)