Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 #include "Rtypes.h"
26 
27 class TCanvas;
28 class TVirtualPadPainter;
29 
30 class TCanvasImp {
31 friend class TCanvas;
32 
33 protected:
34  TCanvas *fCanvas; //TCanvas associated with this implementation
35 
36  TCanvasImp(const TCanvasImp& ci)
37  : fCanvas(ci.fCanvas) { }
38  TCanvasImp& operator=(const TCanvasImp& ci)
39  {if(this!=&ci) fCanvas=ci.fCanvas; return *this;}
40 
41  virtual void Lock();
42  virtual void Unlock() { }
43  virtual Bool_t IsLocked() { return kFALSE; }
44 
45  virtual Bool_t IsWeb() const { return kFALSE; }
46  virtual Bool_t PerformUpdate() { return kFALSE; }
47  virtual TVirtualPadPainter *CreatePadPainter() { return 0; }
48 
49 public:
50  TCanvasImp(TCanvas *c=0) : fCanvas(c) { }
51  TCanvasImp(TCanvas *c, const char *name, UInt_t width, UInt_t height);
52  TCanvasImp(TCanvas *c, const char *name, Int_t x, Int_t y, UInt_t width, UInt_t height);
53  virtual ~TCanvasImp() { }
54 
55  TCanvas *Canvas() const { return fCanvas; }
56  virtual void Close() { }
57  virtual void ForceUpdate() { }
58  virtual UInt_t GetWindowGeometry(Int_t &x, Int_t &y, UInt_t &w, UInt_t &h);
59  virtual void Iconify() { }
60  virtual Int_t InitWindow() { return 0; }
61  virtual void SetStatusText(const char *text = 0, Int_t partidx = 0);
62  virtual void SetWindowPosition(Int_t x, Int_t y);
63  virtual void SetWindowSize(UInt_t w, UInt_t h);
64  virtual void SetWindowTitle(const char *newTitle);
65  virtual void SetCanvasSize(UInt_t w, UInt_t h);
66  virtual void Show() { }
67  virtual void ShowMenuBar(Bool_t show = kTRUE);
68  virtual void ShowStatusBar(Bool_t show = kTRUE);
69  virtual void RaiseWindow();
70  virtual void ReallyDelete();
71 
72  virtual void ShowEditor(Bool_t show = kTRUE);
73  virtual void ShowToolBar(Bool_t show = kTRUE);
74  virtual void ShowToolTips(Bool_t show = kTRUE);
75 
76  virtual Bool_t HasEditor() const { return kFALSE; }
77  virtual Bool_t HasMenuBar() const { return kFALSE; }
78  virtual Bool_t HasStatusBar() const { return kFALSE; }
79  virtual Bool_t HasToolBar() const { return kFALSE; }
80  virtual Bool_t HasToolTips() const { return kFALSE; }
81 
82  ClassDef(TCanvasImp,0) //ABC describing main window protocol
83 };
84 
85 inline TCanvasImp::TCanvasImp(TCanvas *c, const char *, UInt_t, UInt_t) : fCanvas(c) { }
86 inline TCanvasImp::TCanvasImp(TCanvas *c, const char *, Int_t, Int_t, UInt_t, UInt_t) : fCanvas(c) { }
87 inline UInt_t TCanvasImp::GetWindowGeometry(Int_t &x, Int_t &y, UInt_t &w, UInt_t &h)
88  { x = y = 0; w = h = 0; return 0;}
89 inline void TCanvasImp::SetStatusText(const char *, Int_t) { }
90 inline void TCanvasImp::SetWindowPosition(Int_t, Int_t) { }
91 inline void TCanvasImp::SetWindowSize(UInt_t, UInt_t) { }
92 inline void TCanvasImp::SetWindowTitle(const char *) { }
93 inline void TCanvasImp::SetCanvasSize(UInt_t, UInt_t) { }
94 inline void TCanvasImp::ShowMenuBar(Bool_t) { }
95 inline void TCanvasImp::ShowStatusBar(Bool_t) { }
96 inline void TCanvasImp::RaiseWindow() { }
97 inline void TCanvasImp::ReallyDelete() { }
98 
99 inline void TCanvasImp::ShowEditor(Bool_t) { }
100 inline void TCanvasImp::ShowToolBar(Bool_t) { }
101 inline void TCanvasImp::ShowToolTips(Bool_t) { }
102 
103 #endif