Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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-2021, 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#include "TPad.h"
16#include "TAttText.h"
17
18class TButton : public TPad, public TAttText {
19
20private:
21 Bool_t fFocused; ///< If cursor is in...
22 Bool_t fFraming; ///< True if you want a frame to be painted when pressed
23 UChar_t fValidPattern[128]; ///<! pattern in memory to detect button deletion
24
25 TButton(const TButton &) = delete;
26 TButton &operator=(const TButton &) = delete;
27
28protected:
29 TString fMethod; ///< Method to be executed by this button
30
31public:
32 TButton();
33 TButton(const char *title, const char *method, Double_t x1, Double_t y1, Double_t x2, Double_t y2);
34 ~TButton() override;
35 void Divide(Int_t = 1, Int_t = 1, Float_t = 0.01, Float_t = 0.01, Int_t = 0) override {}
36 void Draw(Option_t *option = "") override;
37 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
38 virtual const char *GetMethod() const { return fMethod.Data(); }
39 void Paint(Option_t *option = "") override;
40 void PaintModified() override;
41 void Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override;
42 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
43 void SetBorderMode(Short_t bordermode) override { fBorderMode = bordermode; }
44 virtual void SetFraming(Bool_t f = kTRUE);
45 virtual Bool_t GetFraming() { return fFraming; };
46 void SetGrid(Int_t = 1, Int_t = 1) override {}
47 void SetLogx(Int_t = 1) override {}
48 void SetLogy(Int_t = 1) override {}
49 virtual void SetMethod(const char *method) { fMethod = method; } // *MENU*
50 void SetName(const char *name) override { fName = name; }
51 void x3d(Option_t * /*option */ = "") override {}
52
53 ClassDefOverride(TButton,0) //A user interface button.
54};
55
56#endif
57
#define f(i)
Definition RSha256.hxx:104
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
unsigned char UChar_t
Definition RtypesCore.h:38
float Float_t
Definition RtypesCore.h:57
short Short_t
Definition RtypesCore.h:39
double Double_t
Definition RtypesCore.h:59
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t option
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
char name[80]
Definition TGX11.cxx:110
Text Attributes class.
Definition TAttText.h:18
A TButton object is a user interface object.
Definition TButton.h:18
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Definition TButton.cxx:156
TButton & operator=(const TButton &)=delete
void SetLogy(Int_t=1) override
Definition TButton.h:48
virtual Bool_t GetFraming()
Definition TButton.h:45
virtual void SetMethod(const char *method)
Definition TButton.h:49
void Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override
Set world coordinate system for the pad.
Definition TButton.cxx:276
void x3d(Option_t *="") override
Deprecated: use TPad::GetViewer3D() instead.
Definition TButton.h:51
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
Definition TButton.cxx:284
virtual const char * GetMethod() const
Definition TButton.h:38
void Divide(Int_t=1, Int_t=1, Float_t=0.01, Float_t=0.01, Int_t=0) override
Definition TButton.h:35
TButton(const TButton &)=delete
void SetGrid(Int_t=1, Int_t=1) override
Definition TButton.h:46
void SetLogx(Int_t=1) override
Definition TButton.h:47
void SetName(const char *name) override
Definition TButton.h:50
Bool_t fFraming
True if you want a frame to be painted when pressed.
Definition TButton.h:22
void Paint(Option_t *option="") override
Paint this button with its current attributes.
Definition TButton.cxx:232
void PaintModified() override
Paint is modified.
Definition TButton.cxx:254
Bool_t fFocused
If cursor is in...
Definition TButton.h:21
~TButton() override
Button default destructor.
Definition TButton.cxx:134
void SetBorderMode(Short_t bordermode) override
Definition TButton.h:43
UChar_t fValidPattern[128]
! pattern in memory to detect button deletion
Definition TButton.h:23
virtual void SetFraming(Bool_t f=kTRUE)
if framing is set, button will be highlighted
Definition TButton.cxx:330
TButton()
Button default constructor.
Definition TButton.cxx:95
TString fMethod
Method to be executed by this button.
Definition TButton.h:29
The most important graphics class in the ROOT system.
Definition TPad.h:28
TString fName
Pad name.
Definition TPad.h:109
Short_t fBorderMode
Bordermode (-1=down, 0 = no border, 1=up)
Definition TPad.h:98
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:376
th1 Draw()