library: libGui #include "TGButton.h"

# TGButton

class description - source file - inheritance tree (.ps)

## class TGButton : public TGFrame, public TGWidget

| Inheritance Chart:

`TObject`

<-

`TGObject`

<-

`TGWindow`

`TQObject`

<-

`TGFrame`

`TGWidget`

<-

`TGButton`

<-

`TGCheckButton`

<-

`TGColorSelect` |

`TGedSelect`

<-

`TGedMarkerSelect` |

`TGedPatternSelect` |

`TGPictureButton`

<-

`TGImageMap` |

`TGRadioButton` |

`TGTextButton` |

        protected:

          virtual void EmitSignals(Bool_t wasUp)
          virtual void SetGroup(TGButtonGroup* group)
          virtual void SetToggleButton(Bool_t)

        public:

                               TGButton(const TGWindow* p, Int_t id, GContext_t norm = GetDefaultGC()(), UInt_t option = kRaisedFrame|kDoubleBorder)
                               TGButton(const TGButton&)
                       virtual ~TGButton()
                  virtual void AllowStayDown(Bool_t a)
                static TClass* Class()
                  virtual void Clicked()
            static const TGGC& GetDefaultGC() const
                TGButtonGroup* GetGroup() const
            static const TGGC& GetHibckgndGC() const
          virtual EButtonState GetState() const
            virtual TGToolTip* GetToolTip() const
                 virtual void* GetUserData() const
                virtual Bool_t HandleButton(Event_t* event)
                virtual Bool_t HandleCrossing(Event_t* event)
               virtual TClass* IsA() const
                virtual Bool_t IsDown() const
                virtual Bool_t IsExclusiveToggle() const
                virtual Bool_t IsOn() const
                virtual Bool_t IsToggleButton() const
                  virtual void Pressed()
                  virtual void Released()
                  virtual void SavePrimitive(ofstream& out, Option_t* option)
                  virtual void SetDown(Bool_t on = kTRUE)
                  virtual void SetOn(Bool_t on = kTRUE)
                  virtual void SetState(EButtonState state)
                  virtual void SetToolTipText(const char* text, Long_t delayms = 1000)
                  virtual void SetUserData(void* userData)
                  virtual void ShowMembers(TMemberInspector& insp, char* parent)
                  virtual void Streamer(TBuffer& b)
                          void StreamerNVirtual(TBuffer& b)
                  virtual void Toggle()
                  virtual void Toggled(Bool_t on)

### Data Members

        protected:

                      UInt_t fTWidth       button width
                      UInt_t fTHeight      button height
                EButtonState fState        button state
                      Bool_t fStayDown     true if button has to stay down
                  GContext_t fNormGC       graphics context used for drawing button
                       void* fUserData     pointer to user data structure
                  TGToolTip* fTip          tool tip associated with button
              TGButtonGroup* fGroup        button group this button belongs to
          static const TGGC* fgDefaultGC
          static const TGGC* fgHibckgndGC

## Class Description

     TGButton, TGTextButton, TGPictureButton, TGCheckButton and
     TGRadioButton

     This header defines all GUI button widgets.

     TGButton is a button abstract base class. It defines general button
     behaviour.

     Selecting a text or picture button will generate the event:
     kC_COMMAND, kCM_BUTTON, button id, user data.

     Selecting a check button will generate the event:
     kC_COMMAND, kCM_CHECKBUTTON, button id, user data.

     Selecting a radio button will generate the event:
     kC_COMMAND, kCM_RADIOBUTTON, button id, user data.

     If a command string has been specified (via SetCommand()) then this
     command string will be executed via the interpreter whenever a
     button is selected. A command string can contain the macros:
     $MSG   -- kC_COMMAND, kCM[CHECK|RADIO]BUTTON packed message
               (use GET_MSG() and GET_SUBMSG() to unpack)
     $PARM1 -- button id
     $PARM2 -- user data pointer
     Before executing these macros are expanded into the respective
     Long_t's

TGButton(const TGWindow *p, Int_t id, GContext_t norm, UInt_t options) : TGFrame(p, 1, 1, options)

     Create button base class part.

~TGButton()

     Delete button.

void SetState(EButtonState state)

     Set button state.

void SetDown(Bool_t on)

void SetGroup(TGButtonGroup *group)

     Sets new button-group for this button.

Bool_t HandleButton(Event_t *event)

     Handle mouse button event.

void EmitSignals(Bool_t was)

Bool_t HandleCrossing(Event_t *event)

     Handle mouse crossing event.

void SetToolTipText(const char *text, Long_t delayms)

     Set tool tip text associated with this button. The delay is in
     milliseconds (minimum 250). To remove tool tip call method with
     text = 0.

const TGGC& GetDefaultGC()

const TGGC& GetHibckgndGC()

void SavePrimitive(ofstream &out, Option_t *option)

     Save a button widget as a C++ statement(s) on output stream out

### Inline Functions

                      void SetToggleButton(Bool_t)
                      void SetUserData(void* userData)
                     void* GetUserData() const
                TGToolTip* GetToolTip() const
              EButtonState GetState() const
                      void AllowStayDown(Bool_t a)
            TGButtonGroup* GetGroup() const
                    Bool_t IsDown() const
                    Bool_t IsOn() const
                      void SetOn(Bool_t on = kTRUE)
                    Bool_t IsToggleButton() const
                    Bool_t IsExclusiveToggle() const
                      void Toggle()
                      void Pressed()
                      void Released()
                      void Clicked()
                      void Toggled(Bool_t on)
                   TClass* Class()
                   TClass* IsA() const
                      void ShowMembers(TMemberInspector& insp, char* parent)
                      void Streamer(TBuffer& b)
                      void StreamerNVirtual(TBuffer& b)
                  TGButton TGButton(const TGButton&)

Author: Fons Rademakers 06/01/98
Last update: root/gui:$Name: $:$Id: TGButton.cxx,v 1.34 2004/06/10 14:25:39 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *