Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 09:15:25

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    UChar_t fValidPattern[128];  ///<! pattern in memory to detect button deletion
0024 
0025    TButton(const TButton &) = delete;
0026    TButton &operator=(const TButton &) = delete;
0027 
0028 protected:
0029    TString      fMethod;      ///< Method to be executed by this button
0030 
0031 public:
0032    TButton();
0033    TButton(const char *title, const char *method, Double_t x1, Double_t y1, Double_t x2, Double_t y2);
0034    ~TButton() override;
0035    void Divide(Int_t = 1, Int_t = 1, Float_t = 0.01, Float_t = 0.01, Int_t = 0) override {}
0036    void Draw(Option_t *option = "") override;
0037    void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0038    virtual const char *GetMethod() const { return fMethod.Data(); }
0039    void Paint(Option_t *option = "") override;
0040    void PaintModified() override;
0041    void Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override;
0042    void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0043    void SetBorderMode(Short_t bordermode) override { fBorderMode = bordermode; }
0044    virtual void SetFraming(Bool_t f = kTRUE);
0045    virtual Bool_t GetFraming() { return fFraming; };
0046    void SetGrid(Int_t = 1, Int_t = 1) override {}
0047    void SetLogx(Int_t = 1) override {}
0048    void SetLogy(Int_t = 1) override {}
0049    virtual void SetMethod(const char *method) { fMethod = method; } // *MENU*
0050    void SetName(const char *name) override { fName = name; }
0051    void x3d(Option_t * /*option */ = "") override {}
0052 
0053    ClassDefOverride(TButton,0)  //A user interface button.
0054 };
0055 
0056 #endif
0057