16 #include "TRootEmbeddedCanvas.h"
17 #include "TInterpreter.h"
31 fFileHandler(0), fPlotFrame(0), fSetupFrame(0)
35 gInterpreter->ProcessLine(
"using namespace Diana;");
39 AddFrame(
fSetupFrame,
new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 2, 2, 2, 0));
42 AddFrame(
fPlotFrame,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 2, 2, 2, 0));
45 AddFrame(
fFilenameLabel,
new TGLayoutHints(kLHintsLeft, 2, 2, 2, 0));
48 AddFrame(
fButtonsFrame,
new TGLayoutHints(kLHintsBottom, 2, 2, 2, 2));
64 (*
fPlots.begin())->SetCanvasWindow(0);
72 cout <<
"QGCanvasWindow::AddPlot(QGPlot *plot) Warning: plot == 0" << endl;
81 cout <<
"QGCanvasWindow::AddToDrawnPlots(QGPlot *plot) Warning: plot == 0" << endl;
135 list<QGPlot*>::const_iterator plotIter;
136 for (plotIter =
fPlots.begin(); plotIter !=
fPlots.end(); ++plotIter) {
137 (*plotIter)->SetRegenerate();
157 string label =
"File: ";
159 if (filenames.size() == 1) {
160 string::size_type pos = filenames[0].find(
"/");
161 if (pos == string::npos) {
162 label += filenames[0];
164 label += filenames[0].substr(filenames[0].rfind(
"/") + 1);
166 }
else if (filenames.size() > 1) {
167 label +=
"Multiple files";
176 list<QGPlot*>::const_iterator plotIter;
177 for (plotIter =
fPlots.begin(); plotIter !=
fPlots.end(); ++plotIter) {
178 if ((*plotIter)->GetEditWindow()) {
179 (*plotIter)->GetEditWindow()->FillVariablesDropDownBoxes();
Part of a canvas window for doing setup tasks.
void SetDisplay()
Set the display based on the current state.
Window containing a ROOT canvas.
TGLabel * fFilenameLabel
Filename label.
QGCanvasSetupFrame * fSetupFrame
Setup frame.
void RemovePlot(QGPlot *plot)
Remove pointer to a plot from the list of plots associated with this window.
std::list< QGPlot * > fDrawnPlots
Collection of currently drawn plots in this window.
void RemoveFromDrawnPlots(QGPlot *plot)
Remove pointer to a plot from the list of drawn plots.
void DisplayPlotFrame()
Display the plot frame.
QGCanvasWindow(const TGWindow *p=0, UInt_t w=600, UInt_t h=450)
Constructor.
QGCanvasWindowButtonsFrame * fButtonsFrame
Buttons frame.
QGFileHandler * fFileHandler
File handler.
void AddToDrawnPlots(QGPlot *plot)
Add pointer to a plot to the list of drawn plots.
void DisplaySetupFrame()
Display the setup frame.
void AddPlot(QGPlot *plot)
Add pointer to a plot to the list of plots associated with this window.
QGPlotFrame * fPlotFrame
Plot frame.
virtual ~QGCanvasWindow()
Destructor.
void SetProperty(std::string key, std::string value)
Set property (used for opening a session)
void SetPlotsToRegenerate()
Set regenerate for each plot associated with this window.
QGFileHandler * GetFileHandler() const
Get pointer to file handler.
std::list< QGPlot * > fPlots
Collection of plots associated with this window.
void ClearDrawnPlots()
Clears the collection of drawn plots.
void UpdateVariablesDropDownBoxes()
Update variables drop down boxes for plots associated with this window.
void UpdateFileLabel()
Update the file label.
Class to handle ROOT files.
bool IsFileOpen()
Check whether a file is open.
void OpenFile()
Pop up a file open dialog.
std::vector< std::string > GetFilenames()
Get a vector containing the names of the open files.
Part of a canvas window containing the ROOT canvas.
Base class for GUI plots including histograms, scatter plots, pulses, and graphical cuts.
Base class for GUI windows.
static void UpdateWindowDropDownBoxes()
Update window drop down boxes.
std::string Resize(const std::string &s, size_t len)
resize a string to len, adding spaces if necessary