Logo ROOT   6.14/05
Reference Guide
TGButton.h
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 06/01/98
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_TGButton
13 #define ROOT_TGButton
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TGButton, TGTextButton, TGPictureButton, TGCheckButton TGRadioButton //
19 // and TGSplitButton //
20 // //
21 // This header defines all GUI button widgets. //
22 // //
23 // TGButton is a button abstract base class. It defines general button //
24 // behaviour. //
25 // //
26 // Selecting a text or picture button will generate the event: //
27 // kC_COMMAND, kCM_BUTTON, button id, user data. //
28 // //
29 // Selecting a check button will generate the event: //
30 // kC_COMMAND, kCM_CHECKBUTTON, button id, user data. //
31 // //
32 // Selecting a radio button will generate the event: //
33 // kC_COMMAND, kCM_RADIOBUTTON, button id, user data. //
34 // //
35 // If a command string has been specified (via SetCommand()) then this //
36 // command string will be executed via the interpreter whenever a //
37 // button is selected. A command string can contain the macros: //
38 // $MSG -- kC_COMMAND, kCM[CHECK|RADIO]BUTTON packed message //
39 // (use GET_MSG() and GET_SUBMSG() to unpack) //
40 // $PARM1 -- button id //
41 // $PARM2 -- user data pointer //
42 // Before executing these macros are expanded into the respective //
43 // Long_t's //
44 // //
45 //////////////////////////////////////////////////////////////////////////
46 
47 #include "TGFrame.h"
48 #include "TGWidget.h"
49 
50 //--- Button states
51 
57 };
58 
59 
60 class TGWidget;
61 class TGHotString;
62 class TGPicture;
63 class TGToolTip;
64 class TGButtonGroup;
65 class TGPopupMenu;
66 class TGTextLayout;
67 
68 class TGButton : public TGFrame, public TGWidget {
69 
70 friend class TGButtonGroup;
71 
72 protected:
73  UInt_t fTWidth; // button width
74  UInt_t fTHeight; // button height
75  EButtonState fState; // button state
76  Bool_t fStayDown; // true if button has to stay down
77  GContext_t fNormGC; // graphics context used for drawing button
78  void *fUserData; // pointer to user data structure
79  TGToolTip *fTip; // tool tip associated with button
80  TGButtonGroup *fGroup; // button group this button belongs to
81  Pixel_t fBgndColor; // actual background color
82  Pixel_t fHighColor; // highlight color
83  UInt_t fStyle; // button style (modern or classic)
84 
85  virtual void SetToggleButton(Bool_t) { }
86  virtual void EmitSignals(Bool_t wasUp);
87 
88  static const TGGC *fgDefaultGC;
89  static const TGGC *fgHibckgndGC;
90 
91  static Window_t fgReleaseBtn; // the last released button
92 
93 private:
94  TGButton(const TGButton&); // not implemented
95  TGButton& operator=(const TGButton&); // not implemented
96 
97 public:
98  static const TGGC &GetDefaultGC();
99  static const TGGC &GetHibckgndGC();
100 
101  TGButton(const TGWindow *p = 0, Int_t id = -1, GContext_t norm = GetDefaultGC()(),
102  UInt_t option = kRaisedFrame | kDoubleBorder);
103  virtual ~TGButton();
104 
105  virtual Bool_t HandleButton(Event_t *event);
106  virtual Bool_t HandleCrossing(Event_t *event);
107  virtual void SetUserData(void *userData) { fUserData = userData; }
108  virtual void *GetUserData() const { return fUserData; }
109  virtual void SetToolTipText(const char *text, Long_t delayms = 400); //*MENU*
110  virtual TGToolTip *GetToolTip() const { return fTip; }
111  virtual void SetState(EButtonState state, Bool_t emit = kFALSE);
112  virtual EButtonState GetState() const { return fState; }
113  virtual void AllowStayDown(Bool_t a) { fStayDown = a; }
114  virtual void SetGroup(TGButtonGroup *gr);
115  TGButtonGroup *GetGroup() const { return fGroup; }
116 
117  virtual Bool_t IsDown() const;// { return !(fOptions & kRaisedFrame); }
118  virtual void SetDown(Bool_t on = kTRUE, Bool_t emit = kFALSE);
119  virtual Bool_t IsOn() const { return IsDown(); }
120  virtual void SetOn(Bool_t on = kTRUE, Bool_t emit = kFALSE) { SetDown(on, emit); }
121  virtual Bool_t IsToggleButton() const { return kFALSE; }
122  virtual Bool_t IsExclusiveToggle() const { return kFALSE; }
123  virtual void Toggle(Bool_t emit = kFALSE) { SetDown(IsDown() ? kFALSE : kTRUE, emit); }
124  virtual void SetEnabled(Bool_t e = kTRUE); //*TOGGLE* *GETTER=IsEnabled
125  virtual UInt_t GetStyle() const { return fStyle; }
126  virtual void SetStyle(UInt_t newstyle);
127  virtual void SetStyle(const char *style);
128 
129  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
130 
131  GContext_t GetNormGC() const { return fNormGC; }
132 
133  virtual void Pressed() { Emit("Pressed()"); } // *SIGNAL*
134  virtual void Released() { Emit("Released()"); } // *SIGNAL*
135  virtual void Clicked() { Emit("Clicked()"); } // *SIGNAL*
136  virtual void Toggled(Bool_t on) { Emit("Toggled(Bool_t)", on); } // *SIGNAL*
137 
138  ClassDef(TGButton,0) // Button widget abstract base class
139 };
140 
141 
142 class TGTextButton : public TGButton {
143 
144 protected:
145  TGHotString *fLabel; // button text
146  Int_t fMLeft; // margin left
147  Int_t fMRight; // margin right
148  Int_t fMTop; // margin top
149  Int_t fMBottom; // margin bottom
150  Int_t fTMode; // text justify mode
151  Int_t fWrapLength; // wrap length
152  Int_t fHKeycode; // hotkey
153  TGTextLayout *fTLayout; // text layout
154  FontStruct_t fFontStruct; // font to draw text
155  Bool_t fHasOwnFont; // kTRUE - font defined locally, kFALSE - globally
156  Bool_t fStateOn; // bit to save the state across disable/enable
157  Bool_t fPrevStateOn; // bit to save previos state On/Off
158 
159  static const TGFont *fgDefaultFont;
160 
161  void Init();
162  virtual void DoRedraw();
163 
164 private:
165  TGTextButton(const TGTextButton&); // not implemented
166  TGTextButton& operator=(const TGTextButton&); // not implemented
167 
168 public:
169  static FontStruct_t GetDefaultFontStruct();
170 
171  TGTextButton(const TGWindow *p, TGHotString *s, Int_t id = -1,
172  GContext_t norm = GetDefaultGC()(),
173  FontStruct_t font = GetDefaultFontStruct(),
174  UInt_t option = kRaisedFrame | kDoubleBorder);
175  TGTextButton(const TGWindow *p = 0, const char *s = 0, Int_t id = -1,
176  GContext_t norm = GetDefaultGC()(),
177  FontStruct_t font = GetDefaultFontStruct(),
178  UInt_t option = kRaisedFrame | kDoubleBorder);
179  TGTextButton(const TGWindow *p, const char *s, const char *cmd,
180  Int_t id = -1, GContext_t norm = GetDefaultGC()(),
181  FontStruct_t font = GetDefaultFontStruct(),
182  UInt_t option = kRaisedFrame | kDoubleBorder);
183 
184  virtual ~TGTextButton();
185 
186  virtual TGDimension GetDefaultSize() const;
187 
188  virtual Bool_t HandleKey(Event_t *event);
189  const TGHotString *GetText() const { return fLabel; }
190  virtual const char *GetTitle() const { return fLabel->Data(); }
191  TString GetString() const { return TString(fLabel->GetString()); }
192  virtual void SetTextJustify(Int_t tmode);
193  Int_t GetTextJustify() const { return fTMode; }
194  virtual void SetText(TGHotString *new_label);
195  virtual void SetText(const TString &new_label);
196  virtual void SetTitle(const char *label) { SetText(label); }
197  virtual void SetFont(FontStruct_t font, Bool_t global = kFALSE);
198  virtual void SetFont(const char *fontName, Bool_t global = kFALSE);
199  virtual void SetTextColor(Pixel_t color, Bool_t global = kFALSE);
200  virtual void SetForegroundColor(Pixel_t fore) { SetTextColor(fore); }
201  Bool_t HasOwnFont() const;
202  void SetWrapLength(Int_t wl) { fWrapLength = wl; Layout(); }
203  Int_t GetWrapLength() const { return fWrapLength; }
204  void SetMargins(Int_t left=0, Int_t right=0, Int_t top=0, Int_t bottom=0)
205  { fMLeft = left; fMRight = right; fMTop = top; fMBottom = bottom; }
206 
207  virtual void SetLeftMargin(Int_t val) { fMLeft = val; }
208  virtual void SetRightMargin(Int_t val) { fMRight = val; }
209  virtual void SetTopMargin(Int_t val) { fMTop = val; }
210  virtual void SetBottomMargin(Int_t val) { fMBottom = val; }
211 
212  Int_t GetLeftMargin() const { return fMLeft; }
213  Int_t GetRightMargin() const { return fMRight; }
214  Int_t GetTopMargin() const { return fMTop; }
215  Int_t GetBottomMargin() const { return fMBottom; }
216 
217  void ChangeText(const char *title) { SetTitle(title); } //*MENU*icon=bld_rename.png*
218 
219  FontStruct_t GetFontStruct() const { return fFontStruct; }
220 
221  virtual void Layout();
222  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
223 
224  ClassDef(TGTextButton,0) // A text button widget
225 };
226 
227 
228 class TGPictureButton : public TGButton {
229 
230 protected:
231  const TGPicture *fPic; // picture to be put in button
232  const TGPicture *fPicD; // picture shown when button disabled
233  Bool_t fOwnDisabledPic; // kTRUE if disabled picture was autogenerated
234 
235  virtual void DoRedraw();
236  virtual void CreateDisabledPicture();
237 
238 private:
239  TGPictureButton(const TGPictureButton&); // not implemented
240  TGPictureButton& operator=(const TGPictureButton&); // not implemented
241 
242 public:
243  TGPictureButton(const TGWindow *p, const TGPicture *pic, Int_t id = -1,
244  GContext_t norm = GetDefaultGC()(),
245  UInt_t option = kRaisedFrame | kDoubleBorder);
246  TGPictureButton(const TGWindow *p, const TGPicture *pic, const char *cmd,
247  Int_t id = -1, GContext_t norm = GetDefaultGC()(),
248  UInt_t option = kRaisedFrame | kDoubleBorder);
249  TGPictureButton(const TGWindow *p = 0, const char* pic = 0, Int_t id = -1,
250  GContext_t norm = GetDefaultGC()(),
251  UInt_t option = kRaisedFrame | kDoubleBorder);
252  virtual ~TGPictureButton();
253 
254  virtual void SetPicture(const TGPicture *new_pic);
255  virtual void SetDisabledPicture(const TGPicture *pic);
256  const TGPicture *GetPicture() const { return fPic; };
257  const TGPicture *GetDisabledPicture() const { return fPicD; };
258  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
259 
260  ClassDef(TGPictureButton,0) // A picture button widget
261 };
262 
263 
264 class TGCheckButton : public TGTextButton {
265 
266 private:
267 
268  TGCheckButton(const TGCheckButton&); // Not implemented
269  TGCheckButton& operator=(const TGCheckButton&); // Not implemented
270 
271 protected:
272  EButtonState fPrevState; // previous check button state
273  const TGPicture *fOn; // button ON picture
274  const TGPicture *fOff; // button OFF picture
275  const TGPicture *fDisOn; // button disabled and was ON picture
276  const TGPicture *fDisOff; // button disabled and was OFF picture
277 
278 
279  void Init();
280  void PSetState(EButtonState state, Bool_t emit);
281  virtual void DoRedraw();
282  virtual void EmitSignals(Bool_t wasUp = kTRUE);
283 
284  static const TGFont *fgDefaultFont;
285  static const TGGC *fgDefaultGC;
286 
287 public:
288  static FontStruct_t GetDefaultFontStruct();
289  static const TGGC &GetDefaultGC();
290 
291  TGCheckButton(const TGWindow *p, TGHotString *s, Int_t id = -1,
292  GContext_t norm = GetDefaultGC()(),
293  FontStruct_t font = GetDefaultFontStruct(),
294  UInt_t option = 0);
295  TGCheckButton(const TGWindow *p = 0, const char *s = 0, Int_t id = -1,
296  GContext_t norm = GetDefaultGC()(),
297  FontStruct_t font = GetDefaultFontStruct(),
298  UInt_t option = 0);
299  TGCheckButton(const TGWindow *p, const char *s, const char *cmd, Int_t id = -1,
300  GContext_t norm = GetDefaultGC()(),
301  FontStruct_t font = GetDefaultFontStruct(),
302  UInt_t option = 0);
303  virtual ~TGCheckButton();
304 
305  virtual TGDimension GetDefaultSize() const;
306 
307  virtual Bool_t HandleButton(Event_t *event);
308  virtual Bool_t HandleKey(Event_t *event);
309  virtual Bool_t HandleCrossing(Event_t *event);
310  virtual Bool_t IsToggleButton() const { return kTRUE; }
311  virtual Bool_t IsOn() const { return fState == kButtonDown; }
312  virtual Bool_t IsDown() const { return fState == kButtonDown; }
313  virtual Bool_t IsDisabledAndSelected() const { return ((fState == kButtonDisabled) && fStateOn); }
314  virtual void SetDisabledAndSelected(Bool_t);
315  virtual void SetState(EButtonState state, Bool_t emit = kFALSE);
316  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
317 
318  ClassDef(TGCheckButton,0) // A check button widget
319 };
320 
321 
322 class TGRadioButton : public TGTextButton {
323 
324 private:
327 
328 protected:
329  EButtonState fPrevState; // previous radio button state
330  const TGPicture *fOn; // button ON picture
331  const TGPicture *fOff; // button OFF picture
332  const TGPicture *fDisOn; // button disabled and was ON picture
333  const TGPicture *fDisOff; // button disabled and was OFF picture
334 
335  void Init();
336  void PSetState(EButtonState state, Bool_t emit);
337  virtual void DoRedraw();
338  virtual void EmitSignals(Bool_t wasUp = kTRUE);
339 
340  static const TGFont *fgDefaultFont;
341  static const TGGC *fgDefaultGC;
342 
343 public:
344  static FontStruct_t GetDefaultFontStruct();
345  static const TGGC &GetDefaultGC();
346 
347  TGRadioButton(const TGWindow *p, TGHotString *s, Int_t id = -1,
348  GContext_t norm = GetDefaultGC()(),
349  FontStruct_t font = GetDefaultFontStruct(),
350  UInt_t option = 0);
351  TGRadioButton(const TGWindow *p = 0, const char *s = 0, Int_t id = -1,
352  GContext_t norm = GetDefaultGC()(),
353  FontStruct_t font = GetDefaultFontStruct(),
354  UInt_t option = 0);
355  TGRadioButton(const TGWindow *p, const char *s, const char *cmd, Int_t id = -1,
356  GContext_t norm = GetDefaultGC()(),
357  FontStruct_t font = GetDefaultFontStruct(),
358  UInt_t option = 0);
359  virtual ~TGRadioButton();
360 
361  virtual TGDimension GetDefaultSize() const;
362 
363  virtual Bool_t HandleButton(Event_t *event);
364  virtual Bool_t HandleKey(Event_t *event);
365  virtual Bool_t HandleCrossing(Event_t *event);
366  virtual void SetState(EButtonState state, Bool_t emit = kFALSE);
367  virtual void SetDisabledAndSelected(Bool_t);
368  virtual Bool_t IsToggleButton() const { return kTRUE; }
369  virtual Bool_t IsExclusiveToggle() const { return kTRUE; }
370  virtual Bool_t IsOn() const { return fStateOn; }
371  virtual Bool_t IsDown() const { return fStateOn; }
372  virtual Bool_t IsDisabledAndSelected() const { return ((fState == kButtonDisabled) && fStateOn); }
373  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
374 
375  ClassDef(TGRadioButton,0) // A radio button widget
376 };
377 
378 
379 class TGSplitButton : public TGTextButton {
380 
381 friend class TGPopupMenu;
382 
383 private:
384  TGSplitButton(const TGSplitButton&); // Not implemented
385  TGSplitButton& operator=(const TGSplitButton&); // Not implemented
386 
387  void CalcSize();
388  void DrawTriangle(const GContext_t gc, Int_t x, Int_t y);
389  Bool_t HandleSButton(Event_t *event);
390  Bool_t HandleSCrossing(Event_t *event);
391  Bool_t HandleSKey(Event_t *event);
392  void SetMenuState(Bool_t state) ;
393 
394 protected:
395  // Data members for menu functionality
396  Bool_t fSplit; // kTRUE if menu is in split mode
397  EButtonState fMBState; // state for menu button in split mode
398  UInt_t fTBWidth; // width of text button
399  UInt_t fMBWidth; // width of menu button
400  TGPopupMenu *fPopMenu; // pointer to popup menu
401  Int_t fEntryId; // Id of the currently active menu entry
402  TGHotString *fMenuLabel; // Label of the menu;
403  Cursor_t fDefaultCursor; // Default Cursor
404  Bool_t fKeyNavigate; // kTRUE is keynavigation is being used
405  TGString fWidestLabel; // Longest label that can be on the button
406  TGString fHeighestLabel; // Heighest label that can be on the button
407 
408  virtual void DoRedraw();
409  void Init();
410  void BindKeys(Bool_t on = kTRUE);
411  void BindMenuKeys(Bool_t on = kTRUE);
412 
413 public:
414  TGSplitButton(const TGWindow *p, TGHotString *menulabel,
415  TGPopupMenu *popmenu, Bool_t split = kTRUE,
416  Int_t id = -1, GContext_t norm = GetDefaultGC()(),
417  FontStruct_t fontstruct = GetDefaultFontStruct(),
418  UInt_t option = kRaisedFrame | kDoubleBorder);
419 
420  virtual ~TGSplitButton();
421 
422  virtual TGDimension GetDefaultSize() const ;
423 
424  virtual void SetText(TGHotString *new_label);
425  virtual void SetText(const TString &new_label);
426  virtual void SetFont(FontStruct_t font, Bool_t global = kFALSE);
427  virtual void SetFont(const char *fontName, Bool_t global = kFALSE);
428  virtual void SetMBState(EButtonState state);
429  virtual void SetSplit(Bool_t split);
430  Bool_t IsSplit() { return fSplit; }
431  virtual Bool_t HandleButton(Event_t *event);
432  virtual Bool_t HandleCrossing(Event_t *event);
433  virtual Bool_t HandleKey(Event_t *event);
434  virtual Bool_t HandleMotion(Event_t *event);
435  virtual void Layout();
436 
437  virtual void MBPressed() { Emit("MBPressed()"); } // *SIGNAL*
438  virtual void MBReleased() { Emit("MBReleased()"); } // *SIGNAL*
439  virtual void MBClicked() { Emit("MBClicked()"); } // *SIGNAL*
440  virtual void ItemClicked(Int_t id) { Emit("ItemClicked(Int_t)", id); } // *SIGNAL*
441 
442  // Slots
443  void HandleMenu(Int_t id) ;
444 
445  ClassDef(TGSplitButton, 0) //a split button widget
446 };
447 
448 #endif
TGPopupMenu * fPopMenu
Definition: TGButton.h:400
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.cxx:566
void ChangeText(const char *title)
Definition: TGButton.h:217
Handle_t FontStruct_t
Definition: GuiTypes.h:38
Bool_t IsSplit()
Definition: TGButton.h:430
Int_t fTMode
Definition: TGButton.h:150
virtual Bool_t IsExclusiveToggle() const
Definition: TGButton.h:369
virtual void Pressed()
Definition: TGButton.h:133
const TGPicture * GetDisabledPicture() const
Definition: TGButton.h:257
virtual Bool_t IsOn() const
Definition: TGButton.h:119
virtual void MBPressed()
Definition: TGButton.h:437
virtual void EmitSignals(Bool_t wasUp)
Emit button signals.
Definition: TGButton.cxx:335
Bool_t fPrevStateOn
Definition: TGButton.h:157
virtual void Released()
Definition: TGButton.h:134
const TGPicture * fOn
Definition: TGButton.h:273
virtual Bool_t HandleKey(Event_t *)
Definition: TGFrame.h:212
Int_t GetWrapLength() const
Definition: TGButton.h:203
const char Option_t
Definition: RtypesCore.h:62
TString GetString() const
Definition: TGButton.h:191
Int_t GetTextJustify() const
Definition: TGButton.h:193
const TGPicture * fDisOff
Definition: TGButton.h:276
virtual void SetRightMargin(Int_t val)
Definition: TGButton.h:208
static const TGGC * fgDefaultGC
Definition: TGButton.h:285
void * fUserData
Definition: TGButton.h:78
virtual void Toggled(Bool_t on)
Definition: TGButton.h:136
const TGPicture * GetPicture() const
Definition: TGButton.h:256
Handle_t Cursor_t
Definition: GuiTypes.h:33
Int_t fHKeycode
Definition: TGButton.h:152
pt SetTextColor(4)
virtual void SetTopMargin(Int_t val)
Definition: TGButton.h:209
virtual Bool_t IsToggleButton() const
Definition: TGButton.h:368
Handle_t GContext_t
Definition: GuiTypes.h:37
virtual void SetToggleButton(Bool_t)
Definition: TGButton.h:85
Basic string class.
Definition: TString.h:131
const TGPicture * fOn
Definition: TGButton.h:330
Bool_t fStateOn
Definition: TGButton.h:156
Bool_t fKeyNavigate
Definition: TGButton.h:404
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
static const TGGC & GetDefaultGC()
Return default graphics context.
Definition: TGButton.cxx:420
EButtonState fPrevState
Definition: TGButton.h:329
virtual void SetLeftMargin(Int_t val)
Definition: TGButton.h:207
Bool_t fSplit
Definition: TGButton.h:396
Int_t fMRight
Definition: TGButton.h:147
EButtonState
Definition: TGButton.h:52
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse crossing event.
Definition: TGButton.cxx:354
virtual void SetTitle(const char *label)
Definition: TGButton.h:196
TGButtonGroup * fGroup
Definition: TGButton.h:80
TGTextLayout * fTLayout
Definition: TGButton.h:153
Int_t fMLeft
Definition: TGButton.h:146
const TGPicture * fDisOn
Definition: TGButton.h:275
virtual Bool_t IsToggleButton() const
Definition: TGButton.h:121
virtual const char * GetTitle() const
Returns title of object.
Definition: TGButton.h:190
virtual void SetGroup(TGButtonGroup *gr)
Sets new button-group for this button.
Definition: TGButton.cxx:272
virtual void DoRedraw()
Redraw the frame.
Definition: TGFrame.cxx:412
virtual void SetForegroundColor(Pixel_t fore)
Definition: TGButton.h:200
Int_t GetRightMargin() const
Definition: TGButton.h:213
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event.
Definition: TGButton.cxx:280
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:320
ULong_t Pixel_t
Definition: GuiTypes.h:39
TGButton & operator=(const TGButton &)
Int_t GetBottomMargin() const
Definition: TGButton.h:215
Cursor_t fDefaultCursor
Definition: TGButton.h:403
UInt_t fTBWidth
Definition: TGButton.h:398
virtual void MBClicked()
Definition: TGButton.h:439
void Init(TClassEdit::TInterpreterLookupHelper *helper)
Definition: TClassEdit.cxx:121
virtual void ItemClicked(Int_t id)
Definition: TGButton.h:440
virtual Bool_t IsDown() const
Definition: TGButton.h:312
virtual void SetBottomMargin(Int_t val)
Definition: TGButton.h:210
TGHotString * fLabel
Definition: TGButton.h:145
virtual void Layout()
Definition: TGFrame.h:246
static FontStruct_t GetDefaultFontStruct()
Return the default font structure in use.
Definition: TGMenu.cxx:1984
Bool_t fHasOwnFont
Definition: TGButton.h:155
virtual Bool_t IsOn() const
Definition: TGButton.h:311
virtual void * GetUserData() const
Definition: TGButton.h:108
const TGPicture * fPic
Definition: TGButton.h:231
virtual Bool_t IsToggleButton() const
Definition: TGButton.h:310
void SetMargins(Int_t left=0, Int_t right=0, Int_t top=0, Int_t bottom=0)
Definition: TGButton.h:204
Int_t fMBottom
Definition: TGButton.h:149
virtual EButtonState GetState() const
Definition: TGButton.h:112
EButtonState fPrevState
Definition: TGButton.h:272
Bool_t fOwnDisabledPic
Definition: TGButton.h:233
const TGPicture * fOff
Definition: TGButton.h:331
static const TGGC * fgDefaultGC
Definition: TGButton.h:88
virtual Bool_t IsDisabledAndSelected() const
Definition: TGButton.h:372
virtual void SetStyle(UInt_t newstyle)
Set the button style (modern or classic).
Definition: TGButton.cxx:221
static const TGFont * fgDefaultFont
Definition: TGButton.h:340
virtual void MBReleased()
Definition: TGButton.h:438
const TGPicture * fPicD
Definition: TGButton.h:232
UInt_t fTHeight
Definition: TGButton.h:74
virtual void Toggle(Bool_t emit=kFALSE)
Definition: TGButton.h:123
virtual Bool_t HandleMotion(Event_t *)
Definition: TGFrame.h:211
virtual TGToolTip * GetToolTip() const
Definition: TGButton.h:110
TGButtonGroup * GetGroup() const
Definition: TGButton.h:115
static const TGGC * fgHibckgndGC
Definition: TGButton.h:89
auto * a
Definition: textangle.C:12
Pixel_t fHighColor
Definition: TGButton.h:82
Int_t fEntryId
Definition: TGButton.h:401
virtual void AllowStayDown(Bool_t a)
Definition: TGButton.h:113
unsigned int UInt_t
Definition: RtypesCore.h:42
GContext_t fNormGC
Definition: TGButton.h:77
virtual Bool_t IsExclusiveToggle() const
Definition: TGButton.h:122
TGToolTip * fTip
Definition: TGButton.h:79
virtual Bool_t IsDown() const
Definition: TGButton.cxx:251
TGraphErrors * gr
Definition: legend1.C:25
const char * GetString() const
Definition: TGString.h:40
const Bool_t kFALSE
Definition: RtypesCore.h:88
const TGPicture * fOff
Definition: TGButton.h:274
virtual void Clicked()
Definition: TGButton.h:135
TGString fHeighestLabel
Definition: TGButton.h:406
long Long_t
Definition: RtypesCore.h:50
FontStruct_t GetFontStruct() const
Definition: TGButton.h:219
static const TGFont * fgDefaultFont
Definition: TGButton.h:284
virtual void SetUserData(void *userData)
Definition: TGButton.h:107
virtual UInt_t GetStyle() const
Definition: TGButton.h:125
static const TGGC * fgDefaultGC
Definition: TGButton.h:341
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition: TGButton.cxx:409
TText * text
static Window_t fgReleaseBtn
Definition: TGButton.h:91
UInt_t fMBWidth
Definition: TGButton.h:399
Definition: TGFont.h:149
UInt_t fTWidth
Definition: TGButton.h:73
Int_t fWrapLength
Definition: TGButton.h:151
TCanvas * style()
Definition: style.C:1
Double_t y[n]
Definition: legend1.C:17
TGButton(const TGButton &)
GContext_t GetNormGC() const
Definition: TGButton.h:131
static constexpr double s
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630
virtual void SetOn(Bool_t on=kTRUE, Bool_t emit=kFALSE)
Definition: TGButton.h:120
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a button widget as a C++ statement(s) on output stream out.
Definition: TGButton.cxx:1829
const TGPicture * fDisOn
Definition: TGButton.h:332
Handle_t Window_t
Definition: GuiTypes.h:28
virtual void SetDown(Bool_t on=kTRUE, Bool_t emit=kFALSE)
Definition: TGButton.cxx:260
Int_t GetTopMargin() const
Definition: TGButton.h:214
virtual Bool_t IsOn() const
Definition: TGButton.h:370
Int_t GetLeftMargin() const
Definition: TGButton.h:212
static const TGFont * fgDefaultFont
Definition: TGButton.h:159
UInt_t fStyle
Definition: TGButton.h:83
EButtonState fState
Definition: TGButton.h:75
static const TGGC & GetHibckgndGC()
Return graphics context for highlighted frame background.
Definition: TGButton.cxx:430
Int_t fMTop
Definition: TGButton.h:148
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:165
EButtonState fMBState
Definition: TGButton.h:397
Pixel_t fBgndColor
Definition: TGButton.h:81
const TGPicture * fDisOff
Definition: TGButton.h:333
virtual Bool_t IsDown() const
Definition: TGButton.h:371
TGString fWidestLabel
Definition: TGButton.h:405
friend class TGSplitButton
Definition: TGMenu.h:127
const TGHotString * GetText() const
Definition: TGButton.h:189
TGHotString * fMenuLabel
Definition: TGButton.h:402
const Bool_t kTRUE
Definition: RtypesCore.h:87
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition: TGButton.cxx:395
Definition: TGGC.h:31
virtual Bool_t IsDisabledAndSelected() const
Definition: TGButton.h:313
Bool_t fStayDown
Definition: TGButton.h:76
FontStruct_t fFontStruct
Definition: TGButton.h:154
void SetWrapLength(Int_t wl)
Definition: TGButton.h:202
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:185
virtual ~TGButton()
Delete button.
Definition: TGButton.cxx:171
const char * Data() const
Definition: TString.h:364