Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TButton.h
Go to the documentation of this file.
1 // @(#)root/gpad:$Id$
2 // Author: Rene Brun 01/07/96
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_TButton
13 #define ROOT_TButton
14 
15 
16 #include "TPad.h"
17 #include "TAttText.h"
18 
19 class TButton : public TPad, public TAttText {
20 
21 private:
22  Bool_t fFocused; ///< If cursor is in...
23  Bool_t fFraming; ///< True if you want a frame to be painted when pressed
24 
25  TButton(const TButton &org); // no copy ctor, use TObject::Clone()
26  TButton &operator=(const TButton &rhs); // idem
27 
28 protected:
29  TString fMethod; ///< Method to be executed by this button
30 
31 public:
32  TButton();
33  TButton(const char *title, const char *method, Double_t x1, Double_t y1, Double_t x2, Double_t y2);
34  virtual ~TButton();
35  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);
36  virtual void Draw(Option_t *option="");
37  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
38  virtual const char *GetMethod() const { return fMethod.Data(); }
39  virtual void Paint(Option_t *option="");
40  virtual void PaintModified();
41  virtual void Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2);
42  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
43  virtual void SetBorderMode(Short_t bordermode) { fBorderMode = bordermode; }
44  virtual void SetFraming(Bool_t f=1);
45  virtual Bool_t GetFraming() { return fFraming; };
46  virtual void SetGrid(Int_t valuex = 1, Int_t valuey = 1);
47  virtual void SetLogx(Int_t value = 1);
48  virtual void SetLogy(Int_t value = 1);
49  virtual void SetMethod(const char *method) { fMethod=method; } // *MENU*
50  virtual void SetName(const char *name) { fName = name; }
51  virtual void x3d(Option_t *option="");
52 
53  ClassDef(TButton,0) //A user interface button.
54 };
55 
56 inline void TButton::Divide(Int_t, Int_t, Float_t, Float_t, Int_t) { }
57 inline void TButton::SetGrid(Int_t, Int_t) { }
58 inline void TButton::SetLogx(Int_t) { }
59 inline void TButton::SetLogy(Int_t) { }
60 inline void TButton::x3d(Option_t *) { }
61 
62 #endif
63