91 setAttribute(Qt::WA_DeleteOnClose);
98 fMenuBar->setMinimumWidth(50);
99 fMenuBar->setNativeMenuBar(
kFALSE);
101 auto fileMenu = fMenuBar->addMenu(
"F&ile");
125 fMenuBar->addMenu(
"&Edit");
127 auto viewMenu = fMenuBar->addMenu(
"&View");
129 act->setEnabled(
false);
151 act->setEnabled(
false);
159 fMenuBar->addMenu(
"&Options");
161 fMenuBar->addMenu(
"&Tools");
164 spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
165 fMenuBar->setCornerWidget(
spacer, Qt::TopRightCorner);
167 fMenuBar->addMenu(
"&Help");
173 fToolBar->setIconSize(
QSize(16, 16));
177 fToolBar->addSeparator();
188 auto canv = GetPaintWidget()->getCanvas();
191 case kFileNewCanvas: NewCanvas(); break;
192 case kFileOpen: OpenRootFile(); break;
193 case kFileSaveAs: SaveCanvasAs(); break;
194 case kFilePrint: PrintCanvas(); break;
195 case kOptionInterrupt: gROOT->SetInterrupt(); break;
198 canv->Modified(kTRUE);
211 case kToolsBrowser: break;
212 case kToolModify: gROOT->SetEditorMode(); break;
214 gROOT->SetEditorMode(
"Arc");
217 gROOT->SetEditorMode(
"Line");
220 gROOT->SetEditorMode(
"Arrow");
223 gROOT->SetEditorMode(
"Diamond");
226 gROOT->SetEditorMode(
"Ellipse");
229 gROOT->SetEditorMode(
"Pad");
232 gROOT->SetEditorMode(
"Pave");
235 gROOT->SetEditorMode(
"PaveLabel");
238 gROOT->SetEditorMode(
"PaveText");
241 gROOT->SetEditorMode(
"PavesText");
244 gROOT->SetEditorMode(
"PolyLine");
247 gROOT->SetEditorMode(
"CurlyLine");
250 gROOT->SetEditorMode(
"CurlyArc");
253 gROOT->SetEditorMode(
"Text");
256 gROOT->SetEditorMode(
"Marker");
259 gROOT->SetEditorMode(
"CutG");
278 gROOT->MakeDefCanvas();
287 "Select a ROOT file(s) to open them",
289 QString(
"Root files (*.root);;Root xml files (*.xml);;All files (*.*)"));
291 fd.setFileMode(QFileDialog::ExistingFiles);
293 if (fd.exec() != QDialog::Accepted)
297 for (
auto &fileName : list) {
299 TFile::Open(fileName.toLatin1().constData(),
"update");
317 "Post Script",
"ps",
"ps",
318 "Post Script Portrait",
"ps",
"Portrait",
319 "Post Script Landscape",
"ps",
"Landscape",
320 "Encapsulated Post Script",
"eps",
"eps",
321 "Encapsulated Post Script preview",
"eps",
"Preview",
322 "GIF format",
"gif",
"gif",
323 "PDF format",
"pdf",
"pdf",
324 "SVG format",
"svg",
"svg",
325 "XPM format",
"xpm",
"xpm",
326 "PNG format",
"png",
"png",
327 "JPG format",
"jpg",
"jpg",
328 "BMP format",
"bmp",
"bmp",
329 "TIFF format",
"tiff",
"tiff",
330 "C++ Macro",
"C",
"cxx",
331 "json file",
"json",
"json",
332 "html file",
"html",
"html",
333 "root file",
"root",
"root" };
345 for (std::size_t pos = 0; pos <
fmts.size(); pos += 3) {
367 canv->SaveAs(
fname.toLatin1().constData());
382 fd.setFileMode( QFileDialog::AnyFile );
383 fd.setAcceptMode(QFileDialog::AcceptSave);
387 for (std::size_t pos = 0; pos <
fmts.size(); pos += 3) {
388 QString filter = QString(
fmts[pos].c_str()) +
" (*." +
fmts[pos+1].c_str() +
")";
392 fd.setNameFilters(flt);
398 QObject::connect(&fd, &QFileDialog::filterSelected, [
filename0, &fd](
const QString &
fltr) {
405 auto p =
fltr.indexOf(
"(*."),
p2 =
fltr.lastIndexOf(
")");
409 if (fd.exec() != QDialog::Accepted)
413 if (
flst.isEmpty())
return;
421 for (std::size_t pos = 0; pos <
fmts.size(); pos += 3) {
422 QString filter = QString(
fmts[pos].c_str()) +
" (*." +
fmts[pos+1].c_str() +
")";
423 if (filter != fd.selectedNameFilter())
426 if (!
filename.endsWith(QString(
".") +
fmts[pos+1].c_str())) {
435 canv->Print(
filename.toLatin1().constData(), opt.c_str());
443 ::Info(
"QCanvasWidget::PrintCanvas",
"To be implemented");
463 fToolBar->setVisible(
on);
472 fStatusBar->setVisible(
on);
481 if (fStatusBar && fStatusBar->isVisible())
482 fStatusBar->showMessage(
msg);
492 fPaintWidget->SetShowToolTip(
on);
514 auto m =
new TCanvas(
"markers",
"Marker Types",600,200);
R__EXTERN TApplication * gApplication
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Draw the ROOT Color Wheel.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
static void DisplayMarkerTypes()
Display the table of markers with their numbers.
static const TString & GetIconPath()
Get the icon path in the installation. Static utility function.
const char * Data() const
TString & Append(const char *cs)
static void SingleShot(Int_t milliSec, const char *receiver_class, void *receiver, const char *method)
This static function calls a slot after a given time interval.
small helper class to store/restore gPad context in TPad methods