Logo ROOT   6.08/07
Reference Guide
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 #ifndef ROOT_TPad
17 #include "TPad.h"
18 #endif
19 #ifndef ROOT_TAttText
20 #include "TAttText.h"
21 #endif
22 
23 class TButton : public TPad, public TAttText {
24 
25 private:
26  Bool_t fFocused; ///< If cursor is in...
27  Bool_t fFraming; ///< True if you want a frame to be painted when pressed
28 
29  TButton(const TButton &org); // no copy ctor, use TObject::Clone()
30  TButton &operator=(const TButton &rhs); // idem
31 
32 protected:
33  TString fMethod; ///< Method to be executed by this button
34 
35 public:
36  TButton();
37  TButton(const char *title, const char *method, Double_t x1, Double_t y1, Double_t x2, Double_t y2);
38  virtual ~TButton();
39  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);
40  virtual void Draw(Option_t *option="");
41  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
42  virtual const char *GetMethod() const { return fMethod.Data(); }
43  virtual void Paint(Option_t *option="");
44  virtual void PaintModified();
45  virtual void Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2);
46  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
47  virtual void SetBorderMode(Short_t bordermode) { fBorderMode = bordermode; }
48  virtual void SetFraming(Bool_t f=1);
49  virtual Bool_t GetFraming() { return fFraming; };
50  virtual void SetGrid(Int_t valuex = 1, Int_t valuey = 1);
51  virtual void SetLogx(Int_t value = 1);
52  virtual void SetLogy(Int_t value = 1);
53  virtual void SetMethod(const char *method) { fMethod=method; } // *MENU*
54  virtual void SetName(const char *name) { fName = name; }
55  virtual void x3d(Option_t *option="");
56 
57  ClassDef(TButton,0) //A user interface button.
58 };
59 
61 inline void TButton::SetGrid(Int_t, Int_t) { }
62 inline void TButton::SetLogx(Int_t) { }
63 inline void TButton::SetLogy(Int_t) { }
64 inline void TButton::x3d(Option_t *) { }
65 
66 #endif
67 
const int nx
Definition: kalman.C:16
virtual void Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Set world coordinate system for the pad.
Definition: TButton.cxx:261
float Float_t
Definition: RtypesCore.h:53
virtual void SetBorderMode(Short_t bordermode)
Definition: TButton.h:47
const char Option_t
Definition: RtypesCore.h:62
virtual void SetLogy(Int_t value=1)
Set Lin/Log scale for Y.
Definition: TButton.h:63
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Bool_t fFraming
True if you want a frame to be painted when pressed.
Definition: TButton.h:27
virtual void Draw(Option_t *option="")
Draw this button with its current attributes.
Definition: TButton.cxx:139
static const double x2[5]
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TButton.cxx:269
virtual void PaintModified()
Paint is modified.
Definition: TButton.cxx:239
const int ny
Definition: kalman.C:17
TButton & operator=(const TButton &rhs)
TButton()
Button default constructor.
Definition: TButton.cxx:96
TString fMethod
Method to be executed by this button.
Definition: TButton.h:33
virtual const char * GetMethod() const
Definition: TButton.h:42
Bool_t fFocused
If cursor is in...
Definition: TButton.h:26
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)
Automatic pad generation by division.
Definition: TButton.h:60
Text Attributes class.
Definition: TAttText.h:24
virtual void SetName(const char *name)
Definition: TButton.h:54
virtual ~TButton()
Button default destructor.
Definition: TButton.cxx:131
The most important graphics class in the ROOT system.
Definition: TPad.h:37
short Short_t
Definition: RtypesCore.h:35
virtual void SetGrid(Int_t valuex=1, Int_t valuey=1)
Definition: TButton.h:61
A TButton object is a user interface object.
Definition: TButton.h:23
virtual void Paint(Option_t *option="")
Paint this button with its current attributes.
Definition: TButton.cxx:217
virtual void SetFraming(Bool_t f=1)
if framing is set, button will be highlighted
Definition: TButton.cxx:334
static const double x1[5]
double f(double x)
double Double_t
Definition: RtypesCore.h:55
virtual void SetMethod(const char *method)
Definition: TButton.h:53
virtual void SetLogx(Int_t value=1)
Set Lin/Log scale for X.
Definition: TButton.h:62
#define org(otri, vertexptr)
Definition: triangle.c:1037
virtual void x3d(Option_t *option="")
Deprecated: use TPad::GetViewer3D() instead.
Definition: TButton.h:64
TString fName
Pad name.
Definition: TPad.h:116
virtual Bool_t GetFraming()
Definition: TButton.h:49
char name[80]
Definition: TGX11.cxx:109
Short_t fBorderMode
Bordermode (-1=down, 0 = no border, 1=up)
Definition: TPad.h:105
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TButton.cxx:149
const char * Data() const
Definition: TString.h:349