TButton.h

Go to the documentation of this file.
00001 // @(#)root/gpad:$Id: TButton.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Rene Brun   01/07/96
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TButton
00013 #define ROOT_TButton
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TButton                                                              //
00019 //                                                                      //
00020 //  A TButton object is a specialized TPad including possible list
00021 //  of primitives used to build selections and options menus in a canvas.
00022 //                                                                      //
00023 //////////////////////////////////////////////////////////////////////////
00024 
00025 #ifndef ROOT_TPad
00026 #include "TPad.h"
00027 #endif
00028 #ifndef ROOT_TAttText
00029 #include "TAttText.h"
00030 #endif
00031 
00032 class TButton : public TPad, public TAttText {
00033 
00034 private:
00035    Bool_t fFocused;     // If cursor is in...
00036    Bool_t fFraming;     // True if you want a frame to be painted when pressed
00037 
00038    TButton(const TButton &org);            // no copy ctor, use TObject::Clone()
00039    TButton &operator=(const TButton &rhs); // idem
00040 
00041 protected:
00042    TString      fMethod;      //Method to be executed by this button
00043 
00044 public:
00045    TButton();
00046    TButton(const char *title, const char *method, Double_t x1, Double_t y1, Double_t x2, Double_t y2);
00047    virtual ~TButton();
00048    virtual void  Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0);
00049    virtual void  Draw(Option_t *option="");
00050    virtual void  ExecuteEvent(Int_t event, Int_t px, Int_t py);
00051    virtual const char *GetMethod() const { return fMethod.Data(); }
00052    virtual void  Paint(Option_t *option="");
00053    virtual void  PaintModified();
00054    virtual void  Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2);
00055    virtual void  SavePrimitive(ostream &out, Option_t *option = "");
00056    virtual void  SetBorderMode(Short_t bordermode) { fBorderMode = bordermode; }
00057    virtual void  SetFraming(Bool_t f=1);
00058    virtual Bool_t GetFraming() { return fFraming; };
00059    virtual void  SetGrid(Int_t valuex = 1, Int_t valuey = 1);
00060    virtual void  SetLogx(Int_t value = 1);
00061    virtual void  SetLogy(Int_t value = 1);
00062    virtual void  SetMethod(const char *method) { fMethod=method; } // *MENU*
00063    virtual void  SetName(const char *name) { fName = name; }
00064    virtual void  x3d(Option_t *option="");
00065 
00066    ClassDef(TButton,0)  //A user interface button.
00067 };
00068 
00069 inline void TButton::Divide(Int_t, Int_t, Float_t, Float_t, Int_t) { }
00070 inline void TButton::SetGrid(Int_t, Int_t) { }
00071 inline void TButton::SetLogx(Int_t) { }
00072 inline void TButton::SetLogy(Int_t) { }
00073 inline void TButton::x3d(Option_t *) { }
00074 
00075 #endif
00076 

Generated on Tue Jul 5 14:13:55 2011 for ROOT_528-00b_version by  doxygen 1.5.1