Skip to content

Commit 2c7f585

Browse files
Ilka AntchevaIlka Antcheva
Ilka Antcheva
authored and
Ilka Antcheva
committed
From Valeri Fine:
(unsigned int)(-1) cast to 64-bit pointer is wrong on 64-bit platform because (unsigned int) is 32-bit value. It may or may not cause the assert. git-svn-id: http://root.cern.ch/svn/root/trunk@19234 27541ba8-7e3a-0410-8455-c3a389f83636
1 parent 45f90d5 commit 2c7f585

11 files changed

+335
-212
lines changed

gui/inc/TGButton.h

+16-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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 $
22
// Author: Fons Rademakers 06/01/98
33

44
/*************************************************************************
@@ -144,6 +144,8 @@ class TGTextButton : public TGButton {
144144
Int_t fHKeycode; // hotkey
145145
FontStruct_t fFontStruct; // font to draw text
146146
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
147149

148150
static const TGFont *fgDefaultFont;
149151

@@ -238,7 +240,12 @@ class TGPictureButton : public TGButton {
238240
class TGCheckButton : public TGTextButton {
239241

240242
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+
242249

243250
void Init();
244251
void PSetState(EButtonState state, Bool_t emit);
@@ -275,6 +282,7 @@ class TGCheckButton : public TGTextButton {
275282
virtual Bool_t IsToggleButton() const { return kTRUE; }
276283
virtual Bool_t IsOn() const { return fState == kButtonDown; }
277284
virtual Bool_t IsDown() const { return fState == kButtonDown; }
285+
virtual void SetDisabledAndSelected(Bool_t);
278286
virtual void SetState(EButtonState state, Bool_t emit = kFALSE);
279287
virtual void SavePrimitive(ostream &out, Option_t *option = "");
280288

@@ -289,9 +297,11 @@ class TGRadioButton : public TGTextButton {
289297
TGRadioButton& operator=(const TGRadioButton&);
290298

291299
protected:
292-
EButtonState fPrevState; // radio button state
300+
EButtonState fPrevState; // previous radio button state
293301
const TGPicture *fOn; // button ON picture
294302
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
295305

296306
void Init();
297307
void PSetState(EButtonState state, Bool_t emit);
@@ -326,10 +336,11 @@ class TGRadioButton : public TGTextButton {
326336
virtual Bool_t HandleKey(Event_t *event);
327337
virtual Bool_t HandleCrossing(Event_t *event);
328338
virtual void SetState(EButtonState state, Bool_t emit = kFALSE);
339+
virtual void SetDisabledAndSelected(Bool_t);
329340
virtual Bool_t IsToggleButton() const { return kTRUE; }
330341
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; }
333344
virtual void SavePrimitive(ostream &out, Option_t *option = "");
334345

335346
ClassDef(TGRadioButton,0) // A radio button widget

0 commit comments

Comments
 (0)