1
- // @(#)root/gui:$Name: $:$Id: TGButton.h,v 1.44 2006/07/26 13:36:42 rdm Exp $
1
+ // @(#)root/gui:$Name: $:$Id: TGButton.h,v 1.45 2007/06/07 08:42:55 antcheva Exp $
2
2
// Author: Fons Rademakers 06/01/98
3
3
4
4
/* ************************************************************************
@@ -144,6 +144,8 @@ class TGTextButton : public TGButton {
144
144
Int_t fHKeycode ; // hotkey
145
145
FontStruct_t fFontStruct ; // font to draw text
146
146
Bool_t fHasOwnFont ; // kTRUE - font defined locally, kFALSE - globally
147
+ Bool_t fStateOn ; // bit to save the state across disable/enable
148
+ Bool_t fPrevStateOn ; // bit to save previos state On/Off
147
149
148
150
static const TGFont *fgDefaultFont;
149
151
@@ -238,7 +240,12 @@ class TGPictureButton : public TGButton {
238
240
class TGCheckButton : public TGTextButton {
239
241
240
242
protected:
241
- EButtonState fPrevState ; // previous check button state
243
+ EButtonState fPrevState ; // previous check button state
244
+ const TGPicture *fOn ; // button ON picture
245
+ const TGPicture *fOff ; // button OFF picture
246
+ const TGPicture *fDisOn ; // button disabled and was ON picture
247
+ const TGPicture *fDisOff ; // button disabled and was OFF picture
248
+
242
249
243
250
void Init ();
244
251
void PSetState (EButtonState state, Bool_t emit);
@@ -275,6 +282,7 @@ class TGCheckButton : public TGTextButton {
275
282
virtual Bool_t IsToggleButton () const { return kTRUE ; }
276
283
virtual Bool_t IsOn () const { return fState == kButtonDown ; }
277
284
virtual Bool_t IsDown () const { return fState == kButtonDown ; }
285
+ virtual void SetDisabledAndSelected (Bool_t);
278
286
virtual void SetState (EButtonState state, Bool_t emit = kFALSE );
279
287
virtual void SavePrimitive (ostream &out, Option_t *option = " " );
280
288
@@ -289,9 +297,11 @@ class TGRadioButton : public TGTextButton {
289
297
TGRadioButton& operator =(const TGRadioButton&);
290
298
291
299
protected:
292
- EButtonState fPrevState ; // radio button state
300
+ EButtonState fPrevState ; // previous radio button state
293
301
const TGPicture *fOn ; // button ON picture
294
302
const TGPicture *fOff ; // button OFF picture
303
+ const TGPicture *fDisOn ; // button disabled and was ON picture
304
+ const TGPicture *fDisOff ; // button disabled and was OFF picture
295
305
296
306
void Init ();
297
307
void PSetState (EButtonState state, Bool_t emit);
@@ -326,10 +336,11 @@ class TGRadioButton : public TGTextButton {
326
336
virtual Bool_t HandleKey (Event_t *event);
327
337
virtual Bool_t HandleCrossing (Event_t *event);
328
338
virtual void SetState (EButtonState state, Bool_t emit = kFALSE );
339
+ virtual void SetDisabledAndSelected (Bool_t);
329
340
virtual Bool_t IsToggleButton () const { return kTRUE ; }
330
341
virtual Bool_t IsExclusiveToggle () const { return kTRUE ; }
331
- virtual Bool_t IsOn () const { return fState == kButtonDown ; }
332
- virtual Bool_t IsDown () const { return fState == kButtonDown ; }
342
+ virtual Bool_t IsOn () const { return fStateOn ; }
343
+ virtual Bool_t IsDown () const { return fStateOn ; }
333
344
virtual void SavePrimitive (ostream &out, Option_t *option = " " );
334
345
335
346
ClassDef (TGRadioButton,0 ) // A radio button widget
0 commit comments