// @(#)root/gpad:$Id$
// Author: Rene Brun   01/07/96

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TButton
#define ROOT_TButton


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TButton                                                              //
//                                                                      //
//  A TButton object is a specialized TPad including possible list
//  of primitives used to build selections and options menus in a canvas.
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TPad
#include "TPad.h"
#endif
#ifndef ROOT_TAttText
#include "TAttText.h"
#endif

class TButton : public TPad, public TAttText {

private:
   Bool_t fFocused;     // If cursor is in...
   Bool_t fFraming;     // True if you want a frame to be painted when pressed

   TButton(const TButton &org);            // no copy ctor, use TObject::Clone()
   TButton &operator=(const TButton &rhs); // idem

protected:
   TString      fMethod;      //Method to be executed by this button

public:
   TButton();
   TButton(const char *title, const char *method, Double_t x1, Double_t y1, Double_t x2, Double_t y2);
   virtual ~TButton();
   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);
   virtual void  Draw(Option_t *option="");
   virtual void  ExecuteEvent(Int_t event, Int_t px, Int_t py);
   virtual const char *GetMethod() const { return fMethod.Data(); }
   virtual void  Paint(Option_t *option="");
   virtual void  PaintModified();
   virtual void  Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2);
   virtual void  SavePrimitive(std::ostream &out, Option_t *option = "");
   virtual void  SetBorderMode(Short_t bordermode) { fBorderMode = bordermode; }
   virtual void  SetFraming(Bool_t f=1);
   virtual Bool_t GetFraming() { return fFraming; };
   virtual void  SetGrid(Int_t valuex = 1, Int_t valuey = 1);
   virtual void  SetLogx(Int_t value = 1);
   virtual void  SetLogy(Int_t value = 1);
   virtual void  SetMethod(const char *method) { fMethod=method; } // *MENU*
   virtual void  SetName(const char *name) { fName = name; }
   virtual void  x3d(Option_t *option="");

   ClassDef(TButton,0)  //A user interface button.
};

inline void TButton::Divide(Int_t, Int_t, Float_t, Float_t, Int_t) { }
inline void TButton::SetGrid(Int_t, Int_t) { }
inline void TButton::SetLogx(Int_t) { }
inline void TButton::SetLogy(Int_t) { }
inline void TButton::x3d(Option_t *) { }

#endif

 TButton.h:1
 TButton.h:2
 TButton.h:3
 TButton.h:4
 TButton.h:5
 TButton.h:6
 TButton.h:7
 TButton.h:8
 TButton.h:9
 TButton.h:10
 TButton.h:11
 TButton.h:12
 TButton.h:13
 TButton.h:14
 TButton.h:15
 TButton.h:16
 TButton.h:17
 TButton.h:18
 TButton.h:19
 TButton.h:20
 TButton.h:21
 TButton.h:22
 TButton.h:23
 TButton.h:24
 TButton.h:25
 TButton.h:26
 TButton.h:27
 TButton.h:28
 TButton.h:29
 TButton.h:30
 TButton.h:31
 TButton.h:32
 TButton.h:33
 TButton.h:34
 TButton.h:35
 TButton.h:36
 TButton.h:37
 TButton.h:38
 TButton.h:39
 TButton.h:40
 TButton.h:41
 TButton.h:42
 TButton.h:43
 TButton.h:44
 TButton.h:45
 TButton.h:46
 TButton.h:47
 TButton.h:48
 TButton.h:49
 TButton.h:50
 TButton.h:51
 TButton.h:52
 TButton.h:53
 TButton.h:54
 TButton.h:55
 TButton.h:56
 TButton.h:57
 TButton.h:58
 TButton.h:59
 TButton.h:60
 TButton.h:61
 TButton.h:62
 TButton.h:63
 TButton.h:64
 TButton.h:65
 TButton.h:66
 TButton.h:67
 TButton.h:68
 TButton.h:69
 TButton.h:70
 TButton.h:71
 TButton.h:72
 TButton.h:73
 TButton.h:74
 TButton.h:75
 TButton.h:76