Logo ROOT   6.08/07
Reference Guide
TCanvasImp.h
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Fons Rademakers 16/11/95
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 
13 #ifndef ROOT_TCanvasImp
14 #define ROOT_TCanvasImp
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TCanvasImp //
19 // //
20 // ABC describing GUI independent main window (with menubar, scrollbars //
21 // and a drawing area). //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #ifndef ROOT_Rtypes
26 #include "Rtypes.h"
27 #endif
28 
29 class TCanvas;
30 
31 
32 class TCanvasImp {
33 friend class TCanvas;
34 
35 protected:
36  TCanvas *fCanvas; //TCanvas associated with this implementation
37 
39  : fCanvas(ci.fCanvas) { }
41  {if(this!=&ci) fCanvas=ci.fCanvas; return *this;}
42 
43  virtual void Lock() { }
44  virtual void Unlock() { }
45  virtual Bool_t IsLocked() { return kFALSE; }
46 
47 public:
48  TCanvasImp(TCanvas *c=0) : fCanvas(c) { }
49  TCanvasImp(TCanvas *c, const char *name, UInt_t width, UInt_t height);
50  TCanvasImp(TCanvas *c, const char *name, Int_t x, Int_t y, UInt_t width, UInt_t height);
51  virtual ~TCanvasImp() { }
52 
53  TCanvas *Canvas() const { return fCanvas; }
54  virtual void Close() { }
55  virtual void ForceUpdate() { }
56  virtual UInt_t GetWindowGeometry(Int_t &x, Int_t &y, UInt_t &w, UInt_t &h);
57  virtual void Iconify() { }
58  virtual Int_t InitWindow() { return 0; }
59  virtual void SetStatusText(const char *text = 0, Int_t partidx = 0);
60  virtual void SetWindowPosition(Int_t x, Int_t y);
61  virtual void SetWindowSize(UInt_t w, UInt_t h);
62  virtual void SetWindowTitle(const char *newTitle);
63  virtual void SetCanvasSize(UInt_t w, UInt_t h);
64  virtual void Show() { }
65  virtual void ShowMenuBar(Bool_t show = kTRUE);
66  virtual void ShowStatusBar(Bool_t show = kTRUE);
67  virtual void RaiseWindow();
68  virtual void ReallyDelete();
69 
70  virtual void ShowEditor(Bool_t show = kTRUE);
71  virtual void ShowToolBar(Bool_t show = kTRUE);
72  virtual void ShowToolTips(Bool_t show = kTRUE);
73 
74  virtual Bool_t HasEditor() const { return kFALSE; }
75  virtual Bool_t HasMenuBar() const { return kFALSE; }
76  virtual Bool_t HasStatusBar() const { return kFALSE; }
77  virtual Bool_t HasToolBar() const { return kFALSE; }
78  virtual Bool_t HasToolTips() const { return kFALSE; }
79 
80  ClassDef(TCanvasImp,0) //ABC describing main window protocol
81 };
82 
83 inline TCanvasImp::TCanvasImp(TCanvas *c, const char *, UInt_t, UInt_t) : fCanvas(c) { }
84 inline TCanvasImp::TCanvasImp(TCanvas *c, const char *, Int_t, Int_t, UInt_t, UInt_t) : fCanvas(c) { }
86  { x = y = 0; w = h = 0; return 0;}
87 inline void TCanvasImp::SetStatusText(const char *, Int_t) { }
90 inline void TCanvasImp::SetWindowTitle(const char *) { }
94 inline void TCanvasImp::RaiseWindow() { }
95 inline void TCanvasImp::ReallyDelete() { }
96 
100 
101 #endif
ABC describing GUI independent main window (with menubar, scrollbars and a drawing area)...
Definition: TCanvasImp.h:32
TCanvasImp & operator=(const TCanvasImp &ci)
Definition: TCanvasImp.h:40
virtual void ReallyDelete()
Definition: TCanvasImp.h:95
return c
virtual void SetWindowPosition(Int_t x, Int_t y)
Definition: TCanvasImp.h:88
TH1 * h
Definition: legend2.C:5
virtual Bool_t HasToolBar() const
Definition: TCanvasImp.h:77
TCanvasImp(TCanvas *c=0)
Definition: TCanvasImp.h:48
virtual void SetWindowTitle(const char *newTitle)
Definition: TCanvasImp.h:90
TCanvasImp(const TCanvasImp &ci)
Definition: TCanvasImp.h:38
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual Bool_t HasMenuBar() const
Definition: TCanvasImp.h:75
virtual Bool_t HasStatusBar() const
Definition: TCanvasImp.h:76
virtual void RaiseWindow()
Definition: TCanvasImp.h:94
virtual Bool_t IsLocked()
Definition: TCanvasImp.h:45
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void ShowEditor(Bool_t show=kTRUE)
Definition: TCanvasImp.h:97
virtual void Show()
Definition: TCanvasImp.h:64
virtual void Close()
Definition: TCanvasImp.h:54
virtual void ShowToolBar(Bool_t show=kTRUE)
Definition: TCanvasImp.h:98
virtual void ShowMenuBar(Bool_t show=kTRUE)
Definition: TCanvasImp.h:92
virtual Bool_t HasToolTips() const
Definition: TCanvasImp.h:78
virtual void ForceUpdate()
Definition: TCanvasImp.h:55
virtual void Iconify()
Definition: TCanvasImp.h:57
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual void ShowStatusBar(Bool_t show=kTRUE)
Definition: TCanvasImp.h:93
The Canvas class.
Definition: TCanvas.h:41
TText * text
Double_t y[n]
Definition: legend1.C:17
virtual Bool_t HasEditor() const
Definition: TCanvasImp.h:74
virtual void SetWindowSize(UInt_t w, UInt_t h)
Definition: TCanvasImp.h:89
virtual void Lock()
Definition: TCanvasImp.h:43
TCanvas * Canvas() const
Definition: TCanvasImp.h:53
virtual void ShowToolTips(Bool_t show=kTRUE)
Definition: TCanvasImp.h:99
virtual Int_t InitWindow()
Definition: TCanvasImp.h:58
virtual UInt_t GetWindowGeometry(Int_t &x, Int_t &y, UInt_t &w, UInt_t &h)
Definition: TCanvasImp.h:85
virtual void SetStatusText(const char *text=0, Int_t partidx=0)
Definition: TCanvasImp.h:87
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual void SetCanvasSize(UInt_t w, UInt_t h)
Definition: TCanvasImp.h:91
virtual ~TCanvasImp()
Definition: TCanvasImp.h:51
virtual void Unlock()
Definition: TCanvasImp.h:44
TCanvas * fCanvas
Definition: TCanvasImp.h:36
char name[80]
Definition: TGX11.cxx:109