Logo ROOT  
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 
53  kButtonUp,
57 };
58 
59 
60 class TGWidget;
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:
170 
171  TGTextButton(const TGWindow *p, TGHotString *s, Int_t id = -1,
172  GContext_t norm = GetDefaultGC()(),
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()(),
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()(),
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 
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:
289  static const TGGC &GetDefaultGC();
290 
291  TGCheckButton(const TGWindow *p, TGHotString *s, Int_t id = -1,
292  GContext_t norm = GetDefaultGC()(),
294  UInt_t option = 0);
295  TGCheckButton(const TGWindow *p = 0, const char *s = 0, Int_t id = -1,
296  GContext_t norm = GetDefaultGC()(),
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()(),
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:
345  static const TGGC &GetDefaultGC();
346 
347  TGRadioButton(const TGWindow *p, TGHotString *s, Int_t id = -1,
348  GContext_t norm = GetDefaultGC()(),
350  UInt_t option = 0);
351  TGRadioButton(const TGWindow *p = 0, const char *s = 0, Int_t id = -1,
352  GContext_t norm = GetDefaultGC()(),
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()(),
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);
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
TGSplitButton::fMBState
EButtonState fMBState
Definition: TGButton.h:397
TGButton::SetToolTipText
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition: TGButton.cxx:398
TGSplitButton::fMenuLabel
TGHotString * fMenuLabel
Definition: TGButton.h:402
TGTextButton::SetTextColor
virtual void SetTextColor(Pixel_t color, Bool_t global=kFALSE)
Changes text color.
Definition: TGButton.cxx:871
TGRadioButton::SetDisabledAndSelected
virtual void SetDisabledAndSelected(Bool_t)
Set the state of a radio button to disabled and either on or off.
Definition: TGButton.cxx:1579
TGRadioButton::GetDefaultSize
virtual TGDimension GetDefaultSize() const
default size
Definition: TGButton.cxx:1553
TGRadioButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set radio button state.
Definition: TGButton.cxx:1566
TGTextButton::SetTopMargin
virtual void SetTopMargin(Int_t val)
Definition: TGButton.h:209
TGButton::AllowStayDown
virtual void AllowStayDown(Bool_t a)
Definition: TGButton.h:113
TGRadioButton::EmitSignals
virtual void EmitSignals(Bool_t wasUp=kTRUE)
Emit signals.
Definition: TGButton.cxx:1599
TGButton::Clicked
virtual void Clicked()
Definition: TGButton.h:135
TGButton::SetEnabled
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition: TGButton.cxx:412
TGRadioButton::PSetState
void PSetState(EButtonState state, Bool_t emit)
Set radio button state.
Definition: TGButton.cxx:1610
TGSplitButton::SetFont
virtual void SetFont(FontStruct_t font, Bool_t global=kFALSE)
Changes text font.
Definition: TGButton.cxx:2799
TGPictureButton::SetPicture
virtual void SetPicture(const TGPicture *new_pic)
Change a picture in a picture button.
Definition: TGButton.cxx:993
TGTextButton::SetLeftMargin
virtual void SetLeftMargin(Int_t val)
Definition: TGButton.h:207
TGTextButton::HasOwnFont
Bool_t HasOwnFont() const
Returns kTRUE if text attributes are unique, returns kFALSE if text attributes are shared (global).
Definition: TGButton.cxx:891
TGSplitButton::fWidestLabel
TGString fWidestLabel
Definition: TGButton.h:405
TGCheckButton::fOn
const TGPicture * fOn
Definition: TGButton.h:273
TGWindow
Definition: TGWindow.h:31
TGCheckButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1203
TGSplitButton::MBReleased
virtual void MBReleased()
Definition: TGButton.h:438
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
e
#define e(i)
Definition: RSha256.hxx:121
TGPictureButton::DoRedraw
virtual void DoRedraw()
Redraw picture button.
Definition: TGButton.cxx:1017
TGSplitButton::ItemClicked
virtual void ItemClicked(Int_t id)
Definition: TGButton.h:440
TGButton::IsDown
virtual Bool_t IsDown() const
Definition: TGButton.cxx:254
TGRadioButton::Init
void Init()
Common radio button initialization.
Definition: TGButton.cxx:1498
TGPicture
Definition: TGPicture.h:36
TGTextButton::GetText
const TGHotString * GetText() const
Definition: TGButton.h:189
TGDimension
Definition: TGDimension.h:27
TGTextButton::fMTop
Int_t fMTop
Definition: TGButton.h:148
TGButton::fgHibckgndGC
static const TGGC * fgHibckgndGC
Definition: TGButton.h:89
TGTextButton::SetTitle
virtual void SetTitle(const char *label)
Definition: TGButton.h:196
TGSplitButton::HandleSButton
Bool_t HandleSButton(Event_t *event)
Handle mouse button event in case the button is split.
Definition: TGButton.cxx:2305
TGButton::SetDown
virtual void SetDown(Bool_t on=kTRUE, Bool_t emit=kFALSE)
Definition: TGButton.cxx:263
TGRadioButton::IsDisabledAndSelected
virtual Bool_t IsDisabledAndSelected() const
Definition: TGButton.h:372
TGTextButton::SetWrapLength
void SetWrapLength(Int_t wl)
Definition: TGButton.h:202
kButtonDown
@ kButtonDown
Definition: TGButton.h:60
TGCheckButton::~TGCheckButton
virtual ~TGCheckButton()
Delete a check button.
Definition: TGButton.cxx:1178
TString::Data
const char * Data() const
Definition: TString.h:369
Pixel_t
ULong_t Pixel_t
Definition: GuiTypes.h:39
TGButton::GetDefaultGC
static const TGGC & GetDefaultGC()
Return default graphics context.
Definition: TGButton.cxx:423
TGTextButton::GetBottomMargin
Int_t GetBottomMargin() const
Definition: TGButton.h:215
TGTextButton::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TGButton.h:190
TGSplitButton::fPopMenu
TGPopupMenu * fPopMenu
Definition: TGButton.h:400
TGRadioButton::fDisOff
const TGPicture * fDisOff
Definition: TGButton.h:333
TGCheckButton::IsOn
virtual Bool_t IsOn() const
Definition: TGButton.h:311
TGTextButton::ChangeText
void ChangeText(const char *title)
Definition: TGButton.h:217
FontStruct_t
Handle_t FontStruct_t
Definition: GuiTypes.h:38
TGSplitButton::HandleCrossing
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse crossing event.
Definition: TGButton.cxx:2965
TGTextButton::SetForegroundColor
virtual void SetForegroundColor(Pixel_t fore)
Definition: TGButton.h:200
TGHotString
Definition: TGString.h:52
TGTextButton::SetBottomMargin
virtual void SetBottomMargin(Int_t val)
Definition: TGButton.h:210
TGTextButton::fTMode
Int_t fTMode
Definition: TGButton.h:150
TGSplitButton::fHeighestLabel
TGString fHeighestLabel
Definition: TGButton.h:406
TGButton::fTHeight
UInt_t fTHeight
Definition: TGButton.h:74
TGCheckButton::GetDefaultGC
static const TGGC & GetDefaultGC()
Return default graphics context.
Definition: TGButton.cxx:1456
TGRadioButton::DoRedraw
virtual void DoRedraw()
Draw a radio button.
Definition: TGButton.cxx:1755
kButtonUp
@ kButtonUp
Definition: TGButton.h:59
TGSplitButton::HandleMenu
void HandleMenu(Int_t id)
Handle a menu item activation.
Definition: TGButton.cxx:3167
TGTextButton
Definition: TGButton.h:142
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:168
Int_t
int Int_t
Definition: RtypesCore.h:45
TGWidget
Definition: TGWidget.h:55
TGTextButton::fLabel
TGHotString * fLabel
Definition: TGButton.h:145
TGCheckButton::DoRedraw
virtual void DoRedraw()
Draw the check button widget.
Definition: TGButton.cxx:1390
TGSplitButton::Layout
virtual void Layout()
layout text button
Definition: TGButton.cxx:3135
TGTextButton::fHasOwnFont
Bool_t fHasOwnFont
Definition: TGButton.h:155
TGButton::SetToggleButton
virtual void SetToggleButton(Bool_t)
Definition: TGButton.h:85
x
Double_t x[n]
Definition: legend1.C:17
TGPictureButton::TGPictureButton
TGPictureButton(const TGPictureButton &)
TGToolTip
Definition: TGToolTip.h:35
TGTextButton::GetTextJustify
Int_t GetTextJustify() const
Definition: TGButton.h:193
TGButton::Released
virtual void Released()
Definition: TGButton.h:134
TGTextButton::fMBottom
Int_t fMBottom
Definition: TGButton.h:149
TGCheckButton::fgDefaultGC
static const TGGC * fgDefaultGC
Definition: TGButton.h:285
TGTextButton::SetRightMargin
virtual void SetRightMargin(Int_t val)
Definition: TGButton.h:208
TGCheckButton::PSetState
void PSetState(EButtonState state, Bool_t emit)
Set check button state.
Definition: TGButton.cxx:1226
TGSplitButton::SetMBState
virtual void SetMBState(EButtonState state)
Set the state of the Menu Button part.
Definition: TGButton.cxx:2836
TGRadioButton::fgDefaultFont
static const TGFont * fgDefaultFont
Definition: TGButton.h:340
TGButton::IsOn
virtual Bool_t IsOn() const
Definition: TGButton.h:119
TGButtonGroup
Definition: TGButtonGroup.h:31
TGCheckButton::HandleKey
virtual Bool_t HandleKey(Event_t *event)
Handle key event. This function will be called when the hotkey is hit.
Definition: TGButton.cxx:1356
TGTextButton::fPrevStateOn
Bool_t fPrevStateOn
Definition: TGButton.h:157
TGTextButton::GetWrapLength
Int_t GetWrapLength() const
Definition: TGButton.h:203
TGTextButton::fHKeycode
Int_t fHKeycode
Definition: TGButton.h:152
TString
Definition: TString.h:136
TGTextButton::GetDefaultSize
virtual TGDimension GetDefaultSize() const
returns default size
Definition: TGButton.cxx:812
TGFrame
Definition: TGFrame.h:105
TGButton::Toggle
virtual void Toggle(Bool_t emit=kFALSE)
Definition: TGButton.h:123
TGSplitButton::TGSplitButton
TGSplitButton(const TGSplitButton &)
TGPictureButton::operator=
TGPictureButton & operator=(const TGPictureButton &)
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TGTextButton::SetTextJustify
virtual void SetTextJustify(Int_t tmode)
Set text justification.
Definition: TGButton.cxx:648
kDoubleBorder
@ kDoubleBorder
Definition: GuiTypes.h:385
EButtonState
EButtonState
Definition: TGButton.h:52
TGPictureButton::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a picture button widget as a C++ statement(s) on output stream out.
Definition: TGButton.cxx:1936
text
TText * text
Definition: entrylist_figure1.C:10
TGButton::fBgndColor
Pixel_t fBgndColor
Definition: TGButton.h:81
TGPictureButton::~TGPictureButton
virtual ~TGPictureButton()
Destructor.
Definition: TGButton.cxx:983
bool
Cursor_t
Handle_t Cursor_t
Definition: GuiTypes.h:33
TGButton::fGroup
TGButtonGroup * fGroup
Definition: TGButton.h:80
TGSplitButton::BindKeys
void BindKeys(Bool_t on=kTRUE)
If on kTRUE bind arrow, popup menu hot keys, otherwise remove key bindings.
Definition: TGButton.cxx:2673
TGSplitButton::MBPressed
virtual void MBPressed()
Definition: TGButton.h:437
TGCheckButton::SetDisabledAndSelected
virtual void SetDisabledAndSelected(Bool_t)
Set the state of a check button to disabled and either on or off.
Definition: TGButton.cxx:1263
TGButton::GetStyle
virtual UInt_t GetStyle() const
Definition: TGButton.h:125
TGCheckButton::IsDisabledAndSelected
virtual Bool_t IsDisabledAndSelected() const
Definition: TGButton.h:313
GContext_t
Handle_t GContext_t
Definition: GuiTypes.h:37
TGCheckButton::TGCheckButton
TGCheckButton(const TGCheckButton &)
TGTextButton::fStateOn
Bool_t fStateOn
Definition: TGButton.h:156
style
TCanvas * style()
Definition: style.C:1
TGCheckButton
Definition: TGButton.h:264
TGSplitButton::BindMenuKeys
void BindMenuKeys(Bool_t on=kTRUE)
If on kTRUE bind Menu hot keys, otherwise remove key bindings.
Definition: TGButton.cxx:2685
TGTextButton::Init
void Init()
Common initialization used by the different ctors.
Definition: TGButton.cxx:494
TGSplitButton::GetDefaultSize
virtual TGDimension GetDefaultSize() const
returns default size
Definition: TGButton.cxx:2710
TGTextButton::fTLayout
TGTextLayout * fTLayout
Definition: TGButton.h:153
TGRadioButton::operator=
TGRadioButton & operator=(const TGRadioButton &)
TGSplitButton::operator=
TGSplitButton & operator=(const TGSplitButton &)
TGCheckButton::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event.
Definition: TGButton.cxx:1283
TGTextButton::fMRight
Int_t fMRight
Definition: TGButton.h:147
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TGCheckButton::GetDefaultFontStruct
static FontStruct_t GetDefaultFontStruct()
Return default font structure.
Definition: TGButton.cxx:1446
TGRadioButton::~TGRadioButton
virtual ~TGRadioButton()
Delete a radio button.
Definition: TGButton.cxx:1542
TGButton::GetToolTip
virtual TGToolTip * GetToolTip() const
Definition: TGButton.h:110
TGPictureButton::GetPicture
const TGPicture * GetPicture() const
Definition: TGButton.h:256
TGRadioButton::IsDown
virtual Bool_t IsDown() const
Definition: TGButton.h:371
TGSplitButton::MBClicked
virtual void MBClicked()
Definition: TGButton.h:439
TGSplitButton::~TGSplitButton
virtual ~TGSplitButton()
Delete a split button widget.
Definition: TGButton.cxx:2264
TGButton::Toggled
virtual void Toggled(Bool_t on)
Definition: TGButton.h:136
TGRadioButton
Definition: TGButton.h:322
TGRadioButton::TGRadioButton
TGRadioButton(const TGRadioButton &)
TGTextButton::fMLeft
Int_t fMLeft
Definition: TGButton.h:146
TGTextButton::SetText
virtual void SetText(TGHotString *new_label)
Set new button text.
Definition: TGButton.cxx:597
TGButton::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event.
Definition: TGButton.cxx:283
TGButton::fHighColor
Pixel_t fHighColor
Definition: TGButton.h:82
kButtonEngaged
@ kButtonEngaged
Definition: TGButton.h:61
TGGC
Definition: TGGC.h:31
TGButton::fTWidth
UInt_t fTWidth
Definition: TGButton.h:73
gr
TGraphErrors * gr
Definition: legend1.C:25
TGTextButton::GetFontStruct
FontStruct_t GetFontStruct() const
Definition: TGButton.h:219
TGSplitButton::fEntryId
Int_t fEntryId
Definition: TGButton.h:401
TGTextButton::fWrapLength
Int_t fWrapLength
Definition: TGButton.h:151
TGCheckButton::EmitSignals
virtual void EmitSignals(Bool_t wasUp=kTRUE)
Emit signals.
Definition: TGButton.cxx:1215
TGPictureButton::GetDisabledPicture
const TGPicture * GetDisabledPicture() const
Definition: TGButton.h:257
a
auto * a
Definition: textangle.C:12
TGSplitButton::HandleSCrossing
Bool_t HandleSCrossing(Event_t *event)
Handle mouse crossing event in case of split menu.
Definition: TGButton.cxx:2436
TGRadioButton::GetDefaultFontStruct
static FontStruct_t GetDefaultFontStruct()
Return default font structure.
Definition: TGButton.cxx:1812
TGTextButton::GetRightMargin
Int_t GetRightMargin() const
Definition: TGButton.h:213
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TGButton::fgDefaultGC
static const TGGC * fgDefaultGC
Definition: TGButton.h:88
TGFrame.h
Long_t
long Long_t
Definition: RtypesCore.h:54
TGButton::fTip
TGToolTip * fTip
Definition: TGButton.h:79
TGTextLayout
Definition: TGFont.h:115
TGTextButton::DoRedraw
virtual void DoRedraw()
Draw the text button.
Definition: TGButton.cxx:700
TGTextButton::SetMargins
void SetMargins(Int_t left=0, Int_t right=0, Int_t top=0, Int_t bottom=0)
Definition: TGButton.h:204
TGPictureButton::CreateDisabledPicture
virtual void CreateDisabledPicture()
Creates disabled picture.
Definition: TGButton.cxx:1061
Window_t
Handle_t Window_t
Definition: GuiTypes.h:28
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
TGRadioButton::IsOn
virtual Bool_t IsOn() const
Definition: TGButton.h:370
TGRadioButton::fOff
const TGPicture * fOff
Definition: TGButton.h:331
TGButton::GetGroup
TGButtonGroup * GetGroup() const
Definition: TGButton.h:115
TGSplitButton::fMBWidth
UInt_t fMBWidth
Definition: TGButton.h:399
TGTextButton::operator=
TGTextButton & operator=(const TGTextButton &)
TGButton::SetUserData
virtual void SetUserData(void *userData)
Definition: TGButton.h:107
y
Double_t y[n]
Definition: legend1.C:17
TGButton::SavePrimitive
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:1832
TGSplitButton::HandleKey
virtual Bool_t HandleKey(Event_t *event)
Handle key event. This function will be called when the hotkey is hit.
Definition: TGButton.cxx:2977
TGRadioButton::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event.
Definition: TGButton.cxx:1647
TGCheckButton::fDisOn
const TGPicture * fDisOn
Definition: TGButton.h:275
TGSplitButton::CalcSize
void CalcSize()
Calculate the size of the button.
Definition: TGButton.cxx:2290
TGButton::GetUserData
virtual void * GetUserData() const
Definition: TGButton.h:108
TGSplitButton::fDefaultCursor
Cursor_t fDefaultCursor
Definition: TGButton.h:403
TGTextButton::GetLeftMargin
Int_t GetLeftMargin() const
Definition: TGButton.h:212
TGTextButton::fgDefaultFont
static const TGFont * fgDefaultFont
Definition: TGButton.h:159
TGCheckButton::IsToggleButton
virtual Bool_t IsToggleButton() const
Definition: TGButton.h:310
TGSplitButton::Init
void Init()
Common initialization used by the different ctors.
Definition: TGButton.cxx:2220
TGWidget.h
TGTextButton::GetTopMargin
Int_t GetTopMargin() const
Definition: TGButton.h:214
kRaisedFrame
@ kRaisedFrame
Definition: GuiTypes.h:384
TGRadioButton::fPrevState
EButtonState fPrevState
Definition: TGButton.h:329
TGButton::SetStyle
virtual void SetStyle(UInt_t newstyle)
Set the button style (modern or classic).
Definition: TGButton.cxx:224
TGTextButton::HandleKey
virtual Bool_t HandleKey(Event_t *event)
Handle key event. This function will be called when the hotkey is hit.
Definition: TGButton.cxx:768
TGCheckButton::operator=
TGCheckButton & operator=(const TGCheckButton &)
TGButton::IsExclusiveToggle
virtual Bool_t IsExclusiveToggle() const
Definition: TGButton.h:122
unsigned int
TGButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:188
TGButton::fgReleaseBtn
static Window_t fgReleaseBtn
Definition: TGButton.h:91
TGCheckButton::IsDown
virtual Bool_t IsDown() const
Definition: TGButton.h:312
TGSplitButton::DrawTriangle
void DrawTriangle(const GContext_t gc, Int_t x, Int_t y)
Draw triangle (arrow) on which user can click to open Popup.
Definition: TGButton.cxx:2273
TGSplitButton::fTBWidth
UInt_t fTBWidth
Definition: TGButton.h:398
TGButton::fUserData
void * fUserData
Definition: TGButton.h:78
TGPictureButton::SetDisabledPicture
virtual void SetDisabledPicture(const TGPicture *pic)
Changes disabled picture.
Definition: TGButton.cxx:1088
TGTextButton::SetFont
virtual void SetFont(FontStruct_t font, Bool_t global=kFALSE)
Changes text font.
Definition: TGButton.cxx:833
TGSplitButton::HandleSKey
Bool_t HandleSKey(Event_t *event)
Handle key event. This function will be called when the hotkey is hit.
Definition: TGButton.cxx:2478
TGSplitButton::DoRedraw
virtual void DoRedraw()
Draw the text button.
Definition: TGButton.cxx:2567
TGButton::GetNormGC
GContext_t GetNormGC() const
Definition: TGButton.h:131
TGSplitButton::IsSplit
Bool_t IsSplit()
Definition: TGButton.h:430
TGSplitButton::SetText
virtual void SetText(TGHotString *new_label)
Set new button text.
Definition: TGButton.cxx:2720
TGButton::HandleCrossing
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse crossing event.
Definition: TGButton.cxx:357
TGSplitButton::HandleMotion
virtual Bool_t HandleMotion(Event_t *event)
Handle a motion event in a TGSplitButton.
Definition: TGButton.cxx:3111
TGPictureButton
Definition: TGButton.h:228
TGSplitButton::fSplit
Bool_t fSplit
Definition: TGButton.h:396
TGRadioButton::HandleCrossing
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse crossing event.
Definition: TGButton.cxx:1696
TGSplitButton::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle button events.
Definition: TGButton.cxx:2885
TGButton::SetGroup
virtual void SetGroup(TGButtonGroup *gr)
Sets new button-group for this button.
Definition: TGButton.cxx:275
TGRadioButton::GetDefaultGC
static const TGGC & GetDefaultGC()
Return default graphics context.
Definition: TGButton.cxx:1822
TGButton::GetState
virtual EButtonState GetState() const
Definition: TGButton.h:112
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGCheckButton::fgDefaultFont
static const TGFont * fgDefaultFont
Definition: TGButton.h:284
TGCheckButton::GetDefaultSize
virtual TGDimension GetDefaultSize() const
default size
Definition: TGButton.cxx:1189
TGButton::fState
EButtonState fState
Definition: TGButton.h:75
TGPopupMenu
Definition: TGMenu.h:123
TGTextButton::fFontStruct
FontStruct_t fFontStruct
Definition: TGButton.h:154
TGRadioButton::fgDefaultGC
static const TGGC * fgDefaultGC
Definition: TGButton.h:341
TGRadioButton::fOn
const TGPicture * fOn
Definition: TGButton.h:330
Event_t
Definition: GuiTypes.h:173
TGRadioButton::IsExclusiveToggle
virtual Bool_t IsExclusiveToggle() const
Definition: TGButton.h:369
TGButton::Pressed
virtual void Pressed()
Definition: TGButton.h:133
TGButton::GetHibckgndGC
static const TGGC & GetHibckgndGC()
Return graphics context for highlighted frame background.
Definition: TGButton.cxx:433
TGCheckButton::fDisOff
const TGPicture * fDisOff
Definition: TGButton.h:276
TGButton::fStyle
UInt_t fStyle
Definition: TGButton.h:83
TGButton::TGButton
TGButton(const TGButton &)
TGSplitButton::SetSplit
virtual void SetSplit(Bool_t split)
Set the split status of a button.
Definition: TGButton.cxx:2847
TGTextButton::GetDefaultFontStruct
static FontStruct_t GetDefaultFontStruct()
Return default font structure.
Definition: TGButton.cxx:822
TGString::GetString
const char * GetString() const
Definition: TGString.h:46
TGButton::SetOn
virtual void SetOn(Bool_t on=kTRUE, Bool_t emit=kFALSE)
Definition: TGButton.h:120
TGPictureButton::fPicD
const TGPicture * fPicD
Definition: TGButton.h:232
TGTextButton::TGTextButton
TGTextButton(const TGTextButton &)
TGButton::EmitSignals
virtual void EmitSignals(Bool_t wasUp)
Emit button signals.
Definition: TGButton.cxx:338
TGSplitButton
Definition: TGButton.h:379
TGRadioButton::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a radio button widget as a C++ statement(s) on output stream out.
Definition: TGButton.cxx:2055
TGButton
Definition: TGButton.h:68
TGFont
Definition: TGFont.h:149
TGCheckButton::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a check button widget as a C++ statement(s) on output stream out.
Definition: TGButton.cxx:1987
TGButton::operator=
TGButton & operator=(const TGButton &)
TGSplitButton::fKeyNavigate
Bool_t fKeyNavigate
Definition: TGButton.h:404
TGCheckButton::fPrevState
EButtonState fPrevState
Definition: TGButton.h:272
TGRadioButton::IsToggleButton
virtual Bool_t IsToggleButton() const
Definition: TGButton.h:368
TGButton::fStayDown
Bool_t fStayDown
Definition: TGButton.h:76
TGPictureButton::fPic
const TGPicture * fPic
Definition: TGButton.h:231
TGString
Definition: TGString.h:30
TGButton::fNormGC
GContext_t fNormGC
Definition: TGButton.h:77
TGTextButton::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a text button widget as a C++ statement(s) on output stream out.
Definition: TGButton.cxx:1869
TGButton::~TGButton
virtual ~TGButton()
Delete button.
Definition: TGButton.cxx:174
TGButton::IsToggleButton
virtual Bool_t IsToggleButton() const
Definition: TGButton.h:121
TGRadioButton::fDisOn
const TGPicture * fDisOn
Definition: TGButton.h:332
TGPictureButton::fOwnDisabledPic
Bool_t fOwnDisabledPic
Definition: TGButton.h:233
TGTextButton::~TGTextButton
virtual ~TGTextButton()
Delete a text button widget.
Definition: TGButton.cxx:548
TGCheckButton::fOff
const TGPicture * fOff
Definition: TGButton.h:274
TGTextButton::GetString
TString GetString() const
Definition: TGButton.h:191
kButtonDisabled
@ kButtonDisabled
Definition: TGButton.h:62
TQObject::Emit
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
TGSplitButton::SetMenuState
void SetMenuState(Bool_t state)
Popup the attached menu.
Definition: TGButton.cxx:2526
TGRadioButton::HandleKey
virtual Bool_t HandleKey(Event_t *event)
Handle key event. This function will be called when the hotkey is hit.
Definition: TGButton.cxx:1725
int
TGCheckButton::Init
void Init()
Common check button initialization.
Definition: TGButton.cxx:1132
TGCheckButton::HandleCrossing
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse crossing event.
Definition: TGButton.cxx:1327
TGTextButton::Layout
virtual void Layout()
layout text button
Definition: TGButton.cxx:577