#include <CanvasInTab.hh>
Definition at line 36 of file CanvasInTab.hh.
CanvasInTab::CanvasInTab |
( |
const TGWindow * |
p, |
|
|
UInt_t |
w, |
|
|
UInt_t |
h |
|
) |
| |
Definition at line 70 of file CanvasInTab.cc.
73 fpTab =
new TGTab(
this, 200, 200);
75 fHintPlots =
new TGLayoutHints(kLHintsExpandX|kLHintsExpandY,
79 new TGLayoutHints(kLHintsExpandX |
80 kLHintsExpandY, 10,10,10,1));
85 TGHorizontalFrame* hframe=
new TGHorizontalFrame(
this, 200,40);
87 TGTextButton* save =
new TGTextButton(hframe,
"&Save as ...");
88 save->Connect(
"Clicked()",
"CanvasInTab",
this,
"SaveCanvas()");
89 hframe->AddFrame(save,
new TGLayoutHints(kLHintsCenterX,
92 TGTextButton *exit =
new TGTextButton(hframe,
"&Exit ",
93 "gApplication->Terminate()");
94 hframe->AddFrame(exit,
new TGLayoutHints(kLHintsCenterX,
97 AddFrame(hframe,
new TGLayoutHints(kLHintsCenterX,2,2,2,2));
102 SetWindowName(
"PlotG");
104 Resize(GetDefaultSize());
CanvasInTab::~CanvasInTab |
( |
| ) |
|
|
virtual |
size_t CanvasInTab::AddCanvas |
( |
const char * |
name = "New tab" | ) |
|
Definition at line 121 of file CanvasInTab.cc.
123 size_t output = fEcanvas.size();
124 auto compositeFrame = fpTab->AddTab(
name);
125 TRootEmbeddedCanvas* embeddedCanvas =
126 new TRootEmbeddedCanvas(
name,
129 embeddedCanvas->SetAutoFit();
130 fEcanvas.push_back(embeddedCanvas);
131 compositeFrame->AddFrame(embeddedCanvas, fHintPlots);
132 embeddedCanvas->SetContainer(compositeFrame);
134 fpTab->MapSubwindows();
TCanvas * CanvasInTab::GetCanvas |
( |
int |
i | ) |
|
size_t CanvasInTab::GetNCanvas |
( |
| ) |
const |
|
inline |
void CanvasInTab::SaveCanvas |
( |
| ) |
|
Definition at line 145 of file CanvasInTab.cc.
147 if(fpTab->GetNumberOfTabs() == 0)
return;
151 if(name == 0 || strlen(name) == 0)
return;
153 int current = fpTab->GetCurrent();
154 TCanvas* canvas = fEcanvas[current]->GetCanvas();
155 canvas->SaveAs(name);
const char * SaveFileDialog()
The documentation for this class was generated from the following files:
- source/geant4.10.03.p03/examples/extended/medical/dna/chem4/plot/include/CanvasInTab.hh
- source/geant4.10.03.p03/examples/extended/medical/dna/chem4/plot/src/CanvasInTab.cc