CanvasPage Class Reference

#include <CanvasPage.h>

Inheritance diagram for CanvasPage:
PageABC CheezyPage EVD HistPage MCDisp MultiPage UserCanvas

List of all members.

Public Member Functions

 CanvasPage ()
 ~CanvasPage ()
virtual TObject * Init (Mint *mint, PageDisplay *pd, GuiBox &box)
virtual void Print ()
 Implement to print your display.

Protected Member Functions

TCanvas & GetCanvas ()

Private Attributes

TCanvas * fCanvas
TGWindow * fMainWindow

Detailed Description

Id
CanvasPage.h,v 1.2 2002/11/04 21:11:54 bv Exp

Definition at line 27 of file CanvasPage.h.


Constructor & Destructor Documentation

CanvasPage::CanvasPage (  ) 

Definition at line 21 of file CanvasPage.cxx.

00022     : fCanvas(0), fMainWindow(0)
00023 {
00024 }

CanvasPage::~CanvasPage (  ) 

Definition at line 26 of file CanvasPage.cxx.

00027 {
00028 }


Member Function Documentation

TCanvas & CanvasPage::GetCanvas (  )  [protected]
TObject * CanvasPage::Init ( Mint mint,
PageDisplay pd,
GuiBox box 
) [virtual]

Implement to fill box with whatever your page displays. If the page wishes to return a class to the initializer, then return an object which inherits from TObject, o.w. just return 0.

Implements PageABC.

Reimplemented in EVD, UserCanvas, CheezyPage, HistPage, MCDisp, and MultiPage.

Definition at line 30 of file CanvasPage.cxx.

References GuiCompositeFrameBase::Add(), fCanvas, and fMainWindow.

00031 {
00032     fMainWindow = dynamic_cast<TGWindow*>(&box);
00033     assert(fMainWindow);
00034 
00035     GuiCanvas* gc = SigC::manage(new GuiCanvas(box,100,100));
00036     box.Add(*gc);
00037     fCanvas = gc->GetCanvas();
00038     fCanvas->cd();
00039     return fCanvas;
00040 }

void CanvasPage::Print (  )  [virtual]

Implement to print your display.

Implements PageABC.

Definition at line 42 of file CanvasPage.cxx.

References fCanvas, and fMainWindow.

00043 {
00044     if (!fMainWindow) {
00045         std::cerr << "CanvasPage::Print no main window\n";
00046         return;
00047     }
00048 
00049     const char* filetypes[] = { "All files",    "*",
00050                                 "EPS",          "*.eps",
00051                                 "PS",           "*.ps",
00052                                 "GIF",          "*.gif",
00053                                 0,              0 };
00054     static TString dir(".");
00055     TGFileInfo fi;
00056     fi.fFileTypes = filetypes;
00057     fi.fIniDir = StrDup(dir);
00058     new TGFileDialog(gClient->GetRoot(), fMainWindow, kFDOpen, &fi);
00059     dir = fi.fIniDir;
00060     fCanvas->Print(fi.fFilename);
00061 }


Member Data Documentation

TCanvas* CanvasPage::fCanvas [private]

Definition at line 49 of file CanvasPage.h.

Referenced by GetCanvas(), Init(), and Print().

TGWindow* CanvasPage::fMainWindow [private]

Definition at line 50 of file CanvasPage.h.

Referenced by Init(), and Print().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1