Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:35

0001 // @(#)root/gpad:$Id$
0002 // Author: Rene Brun   01/07/96
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TButton
0013 #define ROOT_TButton
0014 
0015 #include "TPad.h"
0016 #include "TAttText.h"
0017 
0018 class TButton : public TPad, public TAttText {
0019 
0020 private:
0021    Bool_t fFocused;     ///< If cursor is in...
0022    Bool_t fFraming;     ///< True if you want a frame to be painted when pressed
0023 
0024    TButton(const TButton &) = delete;
0025    TButton &operator=(const TButton &) = delete;
0026 
0027 protected:
0028    TString      fMethod;      ///< Method to be executed by this button
0029 
0030 public:
0031    TButton();
0032    TButton(const char *title, const char *method, Double_t x1, Double_t y1, Double_t x2, Double_t y2);
0033    ~TButton() override;
0034    void Divide(Int_t = 1, Int_t = 1, Float_t = 0.01, Float_t = 0.01, Int_t = 0) override {}
0035    void Draw(Option_t *option = "") override;
0036    void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0037    virtual const char *GetMethod() const { return fMethod.Data(); }
0038    void Paint(Option_t *option = "") override;
0039    void PaintModified() override;
0040    void Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override;
0041    void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0042    void SetBorderMode(Short_t bordermode) override { fBorderMode = bordermode; }
0043    virtual void SetFraming(Bool_t f = kTRUE);
0044    virtual Bool_t GetFraming() { return fFraming; };
0045    void SetGrid(Int_t = 1, Int_t = 1) override {}
0046    void SetLogx(Int_t = 1) override {}
0047    void SetLogy(Int_t = 1) override {}
0048    virtual void SetMethod(const char *method) { fMethod = method; } // *MENU*
0049    void SetName(const char *name) override { fName = name; }
0050    void x3d(Option_t * /*option */ = "") override {}
0051 
0052    ClassDefOverride(TButton,0)  //A user interface button.
0053 };
0054 
0055 #endif
0056