Public Member Functions | Protected Attributes | List of all members
evdb::ObjListCanvas Class Referenceabstract

#include <ObjListCanvas.h>

Inheritance diagram for evdb::ObjListCanvas:
evdb::Printable

Public Member Functions

 ObjListCanvas (TGMainFrame *mf)
 
virtual ~ObjListCanvas ()
 
virtual void Draw (const char *opt=0)=0
 
virtual const char * PrintTag () const
 
virtual const char * Description () const
 
virtual void Print (const char *f)
 
void Connect ()
 Make signal/slot connections. More...
 
- Public Member Functions inherited from evdb::Printable
 Printable ()
 
virtual ~Printable ()
 

Protected Attributes

TGCompositeFrame * fFrame
 Graphics frame. More...
 
TGLayoutHints * fLayout
 Layout hints for frame. More...
 
TRootEmbeddedCanvas * fEmbCanvas
 Embedded canvas. More...
 
TCanvas * fCanvas
 The ROOT drawing canvas. More...
 
unsigned short fXsize
 Size of the canvas;. More...
 
unsigned short fYsize
 Size of the canvas;. More...
 
float fAspectRatio
 fYsize/fXsize More...
 

Additional Inherited Members

- Static Public Member Functions inherited from evdb::Printable
static void AddToListOfPrintables (const char *name, evdb::Printable *p)
 
static void RemoveFromListOfPrintables (evdb::Printable *p)
 
static std::map< std::string, evdb::Printable * > & GetPrintables ()
 

Detailed Description

Definition at line 24 of file ObjListCanvas.h.

Constructor & Destructor Documentation

evdb::ObjListCanvas::ObjListCanvas ( TGMainFrame *  mf)

Perform the basic setup for a drawing canvas

Definition at line 30 of file ObjListCanvas.cxx.

31  {
32  TGDimension sz; // Size of the main frame
33 
34  sz = mf->GetSize();
35  fXsize = sz.fWidth - 10; // Leave small margin on left and right
36  fYsize = sz.fHeight - 58; // Leave small margin on top and bottom
37  fAspectRatio = (float)fYsize/(float)fXsize;
38 
39  // This frame is apparently for holding the buttons on the top; it's
40  // not used for anything else.
41  fFrame = new TGCompositeFrame(mf, 60, 60, kHorizontalFrame);
42 
43  // Define a layout for placing the canvas within the frame.
44  fLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX |
45  kLHintsExpandY, 5, 5, 5, 5);
46 
47  // Careful about clashes with root's naming of canvases. Make a name
48  // like "tpcEVDCanvas" using the print tag
49  std::string name(this->PrintTag());
50  name += "evdb::ObjListCanvas";
51 
52  /*
53  // Create the embedded canvas within the main ROOT graphics frame.
54  fEmbCanvas = new TRootEmbeddedCanvas(name.c_str(), mf, fXsize, fYsize,
55  kSunkenFrame, 0);
56  mf->AddFrame(fEmbCanvas, fLayout);
57  */
58  mf->AddFrame(fFrame);
59 
60  // Extract the graphical Canvas from the embedded canvas. The user
61  // will do most of their drawing in this.
62  // fCanvas = fEmbCanvas->GetCanvas();
63 
64  // this->Update();
65  }
static QCString name
Definition: declinfo.cpp:673
unsigned short fYsize
Size of the canvas;.
Definition: ObjListCanvas.h:47
float fAspectRatio
fYsize/fXsize
Definition: ObjListCanvas.h:48
TGLayoutHints * fLayout
Layout hints for frame.
Definition: ObjListCanvas.h:42
std::string string
Definition: nybbler.cc:12
virtual const char * PrintTag() const
Definition: ObjListCanvas.h:34
unsigned short fXsize
Size of the canvas;.
Definition: ObjListCanvas.h:46
TGCompositeFrame * fFrame
Graphics frame.
Definition: ObjListCanvas.h:41
evdb::ObjListCanvas::~ObjListCanvas ( )
virtual

Definition at line 79 of file ObjListCanvas.cxx.

80  {
81  // IoModule::Instance()->Disconnect(0,this,0);
82  // delete fEmbCanvas;
83  delete fLayout;
84  delete fFrame;
85  }
TGLayoutHints * fLayout
Layout hints for frame.
Definition: ObjListCanvas.h:42
TGCompositeFrame * fFrame
Graphics frame.
Definition: ObjListCanvas.h:41

Member Function Documentation

void evdb::ObjListCanvas::Connect ( )

Make signal/slot connections.

Definition at line 69 of file ObjListCanvas.cxx.

70  {
71  // Make connections for drawing and printing
72  // IoModule::Instance()->Connect("NewEvent()",
73  // "evdb::ObjListCanvas",this,"Draw()");
75  }
virtual const char * Description() const
Definition: ObjListCanvas.h:35
static void AddToListOfPrintables(const char *name, evdb::Printable *p)
Definition: Printable.cxx:29
virtual const char* evdb::ObjListCanvas::Description ( ) const
inlinevirtual

Reimplemented from evdb::Printable.

Definition at line 35 of file ObjListCanvas.h.

35 {return "sub-class needs description"; }
virtual void evdb::ObjListCanvas::Draw ( const char *  opt = 0)
pure virtual
void evdb::ObjListCanvas::Print ( const char *  f)
virtual

Implements evdb::Printable.

Definition at line 89 of file ObjListCanvas.cxx.

89 { /*fCanvas->Print(f);*/ }
virtual const char* evdb::ObjListCanvas::PrintTag ( ) const
inlinevirtual

Implements evdb::Printable.

Definition at line 34 of file ObjListCanvas.h.

34 {return "sub-class needs print tag"; }

Member Data Documentation

float evdb::ObjListCanvas::fAspectRatio
protected

fYsize/fXsize

Definition at line 48 of file ObjListCanvas.h.

TCanvas* evdb::ObjListCanvas::fCanvas
protected

The ROOT drawing canvas.

Definition at line 44 of file ObjListCanvas.h.

TRootEmbeddedCanvas* evdb::ObjListCanvas::fEmbCanvas
protected

Embedded canvas.

Definition at line 43 of file ObjListCanvas.h.

TGCompositeFrame* evdb::ObjListCanvas::fFrame
protected

Graphics frame.

Definition at line 41 of file ObjListCanvas.h.

TGLayoutHints* evdb::ObjListCanvas::fLayout
protected

Layout hints for frame.

Definition at line 42 of file ObjListCanvas.h.

unsigned short evdb::ObjListCanvas::fXsize
protected

Size of the canvas;.

Definition at line 46 of file ObjListCanvas.h.

unsigned short evdb::ObjListCanvas::fYsize
protected

Size of the canvas;.

Definition at line 47 of file ObjListCanvas.h.


The documentation for this class was generated from the following files: