116const char *
filetypes[] = {
"All files",
"*",
117 "ROOT files",
"*.root",
118 "ROOT macros",
"*.C",
119 "Text files",
"*.[tT][xX][tT]",
130 {
"h1_s.xpm",
"TH1", 1001,
nullptr },
131 {
"h2_s.xpm",
"TH2", 1002,
nullptr },
132 {
"h3_s.xpm",
"TH3", 1003,
nullptr },
133 {
"profile_s.xpm",
"TProfile", 1004,
nullptr },
134 {
nullptr,
nullptr, 0,
nullptr }
138 {
"f1_s.xpm",
"TF1", 2001,
nullptr },
139 {
"f2_s.xpm",
"TF2", 2002,
nullptr },
140 {
nullptr,
nullptr, 0,
nullptr }
144 {
"ntuple_s.xpm",
"TNtuple", 3001,
nullptr },
145 {
"tree_s.xpm",
"TTree", 3002,
nullptr },
146 {
"chain_s.xpm",
"TChain", 3003,
nullptr },
147 {
nullptr,
nullptr, 0,
nullptr }
152"This is the ROOT text edit widget TGTextEdit. It is not intended as\n"
153"a full developers editor, but it is relatively complete and can ideally\n"
154"be used to edit scripts or to present users editable config files, etc.\n\n"
155"The text edit widget supports standard emacs style ctrl-key navigation\n"
156"in addition to the arrow keys. By default the widget has under the right\n"
157"mouse button a popup menu giving access to several built-in functions.\n\n"
158"Cut, copy and paste between different editor windows and any other\n"
159"standard text handling application is supported.\n\n"
160"Text can be selected with the mouse while holding the left button\n"
161"or with the arrow keys while holding the shift key pressed. Use the\n"
162"middle mouse button to paste text at the current mouse location."
165"Mice with scroll-ball are properly supported.\n\n"
166"This are the currently defined key bindings:\n"
168" Move the cursor one character leftwards.\n"
169" Scroll when cursor is out of frame.\n"
171" Move the cursor one character rightwards.\n"
172" Scroll when cursor is out of frame.\n"
174" Deletes the character on the left side of the text cursor and moves the\n"
175" cursor one position to the left. If a text has been marked by the user"
178" (e.g. by clicking and dragging) the cursor will be put at the beginning\n"
179" of the marked text and the marked text will be removed.\n"
181" Moves the text cursor to the left end of the line. If mark is TRUE text\n"
182" will be marked towards the first position, if not any marked text will\n"
183" be unmarked if the cursor is moved.\n"
185" Moves the text cursor to the right end of the line. If mark is TRUE text\n"
186" will be marked towards the last position, if not any marked text will\n"
187" be unmarked if the cursor is moved.\n"
191" Deletes the character on the right side of the text cursor. If a text\n"
192" has been marked by the user (e.g. by clicking and dragging) the cursor\n"
193" will be put at the beginning of the marked text and the marked text will\n"
195"Shift - Left Arrow\n"
196" Mark text one character leftwards.\n"
197"Shift - Right Arrow\n"
198" Mark text one character rightwards.\n"
200" Select the whole text.\n"
202" Move the cursor one character leftwards."
206" Copy the marked text to the clipboard.\n"
208" Delete the character to the right of the cursor.\n"
210" Move the cursor to the end of the line.\n"
212" Start Search Dialog.\n"
214" Delete the character to the left of the cursor.\n"
216" Delete marked text if any or delete all\n"
217" characters to the right of the cursor.\n"
219" Start GoTo Line Dialog"
223" Delete all characters on the line.\n"
225" Paste the clipboard text into line edit.\n"
227" Cut the marked text, copy to clipboard.\n"
229" Paste the clipboard text into line edit.\n"
232"All other keys with valid ASCII codes insert themselves into the line.";
256 TGLayoutHints *fMenuBarLayout, *fMenuBarItemLayout, *fMenuBarHelpLayout;
265 void HandleMenu(
Int_t id);
269 void Created() { Emit(
"Created()"); }
270 void Welcome() {
printf(
"TestMainFrame has been created. Welcome!\n"); }
310 void DoTab(
Int_t id);
311 void HandleButtons(
Int_t id = -1);
367 void DoText(const
char *
text);
368 void DoSlider(
Int_t pos = 0);
390 void HandleButtons();
507 void LoadFile(
const char *file);
508 void LoadBuffer(
const char *buffer);
509 void AddBuffer(
const char *buffer);
511 TGTextEdit *GetEditor()
const {
return fEdit; }
537 TGFrame *GetFrame()
const {
return fFrame; }
539 void SetCanvas(
TGCanvas *canvas) { fCanvas = canvas; }
540 void HandleMouseWheel(
Event_t *event);
549 fFrame->Connect(
"ProcessedEvent(Event_t*)",
"TileFrame",
this,
550 "HandleMouseWheel(Event_t*)");
559void TileFrame::HandleMouseWheel(
Event_t *event)
568 if (!fCanvas)
return;
569 if (fCanvas->GetContainer()->GetHeight())
571 fCanvas->GetViewPort()->GetHeight()) /
572 fCanvas->GetContainer()->GetHeight());
579 fCanvas->SetVsbPosition(
newpos);
584 fCanvas->SetVsbPosition(
newpos);
598 fMain->Connect(
"CloseWindow()",
"TestMainFrame",
this,
"CloseWindow()");
604 fMenuDock->SetWindowName(
"GuiTest Menu");
614 fMenuFile->AddEntry(
"&Close", -1);
615 fMenuFile->AddSeparator();
618 fMenuFile->AddSeparator();
637 fCascadeMenu->AddEntry(
"ID = 5&1", 51);
638 fCascadeMenu->AddEntry(
"ID = 5&2", 52);
639 fCascadeMenu->AddEntry(
"ID = 5&3", 53);
640 fCascadeMenu->AddSeparator();
644 fMenuTest->AddLabel(
"Test different features...");
658 fMenuTest->AddPopup(
"&Cascaded menus", fCascadeMenu);
675 fMenuDock->Connect(
"Undocked()",
"TestMainFrame",
this,
"HandleMenu(=M_VIEW_UNDOCK)");
680 fMenuHelp->AddSeparator();
691 fMenuFile->Connect(
"Activated(Int_t)",
"TestMainFrame",
this,
692 "HandleMenu(Int_t)");
693 fMenuFile->Connect(
"PoppedUp()",
"TestMainFrame",
this,
"HandlePopup()");
694 fMenuFile->Connect(
"PoppedDown()",
"TestMainFrame",
this,
"HandlePopdown()");
695 fMenuTest->Connect(
"Activated(Int_t)",
"TestMainFrame",
this,
696 "HandleMenu(Int_t)");
697 fMenuView->Connect(
"Activated(Int_t)",
"TestMainFrame",
this,
698 "HandleMenu(Int_t)");
699 fMenuHelp->Connect(
"Activated(Int_t)",
"TestMainFrame",
this,
700 "HandleMenu(Int_t)");
701 fCascadeMenu->Connect(
"Activated(Int_t)",
"TestMainFrame",
this,
702 "HandleMenu(Int_t)");
703 fCascade1Menu->Connect(
"Activated(Int_t)",
"TestMainFrame",
this,
704 "HandleMenu(Int_t)");
705 fCascade2Menu->Connect(
"Activated(Int_t)",
"TestMainFrame",
this,
706 "HandleMenu(Int_t)");
707 fMenuNew1->Connect(
"Activated(Int_t)",
"TestMainFrame",
this,
708 "HandleMenu(Int_t)");
709 fMenuNew2->Connect(
"Activated(Int_t)",
"TestMainFrame",
this,
710 "HandleMenu(Int_t)");
713 fMenuBar->AddPopup(
"&File", fMenuFile, fMenuBarItemLayout);
714 fMenuBar->AddPopup(
"&Test",
fMenuTest, fMenuBarItemLayout);
715 fMenuBar->AddPopup(
"&View",
fMenuView, fMenuBarItemLayout);
716 fMenuBar->AddPopup(
"&Help", fMenuHelp, fMenuBarHelpLayout);
718 fMenuDock->AddFrame(fMenuBar, fMenuBarLayout);
721 fCanvasWindow =
new TGCanvas(fMain, 400, 240);
722 fContainer =
new TileFrame(fCanvasWindow->GetViewPort());
723 fContainer->SetCanvas(fCanvasWindow);
724 fCanvasWindow->SetContainer(fContainer->GetFrame());
730 for (
int i=0; i < 256; ++i)
731 fCanvasWindow->AddFrame(
new TGFrame(fCanvasWindow->GetContainer(),
743 fTestButton->Connect(
"Clicked()",
"TestMainFrame",
this,
"DoButton()");
744 fTestButton->SetToolTipText(
"Pops up\ntext editor");
748 fTestText->SetToolTipText(
"This is a text entry widget");
761 fMain->SetWindowName(
"GuiTest Signal/Slots");
763 fMain->MapSubwindows();
769 Connect(
"Created()",
"TestMainFrame",
this,
"Welcome()");
773TestMainFrame::~TestMainFrame()
791void TestMainFrame::CloseWindow()
798void TestMainFrame::DoButton()
812void TestMainFrame::HandleMenu(
Int_t id)
824 printf(
"fIniDir = %s\n",
fi.fIniDir);
826 printf(
"Open file: %s (dir: %s)\n",
fi.fFilename,
fi.fIniDir);
837 printf(
"Hiding itself, select \"Print Setup...\" to enable again\n");
842 printf(
"M_FILE_PRINTSETUP\n");
843 printf(
"Enabling \"Print\"\n");
887 if (
prop.fName !=
"")
888 printf(
"Selected font: %s, size %d, italic %s, bold %s, color 0x%lx, align %u\n",
889 prop.fName.Data(),
prop.fSize,
prop.fItalic ?
"yes" :
"no",
902 fMenuBar->AddPopup(
"New 1",
fMenuNew1, fMenuBarItemLayout,
p);
903 p = fMenuBar->GetPopup(
"Help");
904 fMenuBar->AddPopup(
"New 2",
fMenuNew2, fMenuBarItemLayout,
p);
905 fMenuBar->MapSubwindows();
915 fMenuBar->RemovePopup(
"New 1");
916 fMenuBar->RemovePopup(
"New 2");
956 printf(
"Menu item %d selected\n",
id);
969 fMain->Connect(
"CloseWindow()",
"TestDialog",
this,
"DoClose()");
970 fMain->DontCallClose();
978 fOkButton->
Connect(
"Clicked()",
"TestDialog",
this,
"DoOK()");
980 fCancelButton->
Connect(
"Clicked()",
"TestDialog",
this,
"DoCancel()");
986 fFrame1->AddFrame(fOkButton, fL1);
987 fFrame1->AddFrame(fCancelButton, fL1);
994 fTab =
new TGTab(fMain, 300, 300);
995 fTab->
Connect(
"Selected(Int_t)",
"TestDialog",
this,
"DoTab(Int_t)");
1004 tf->AddFrame(fF1, fL3);
1005 fTxt1->Resize(150,
fTxt1->GetDefaultHeight());
1006 fTxt2->Resize(150,
fTxt2->GetDefaultHeight());
1021 tf->AddFrame(fF2, fL3);
1025 for (i = 0; i < 20; i++) {
1027 snprintf(tmp, 20,
"Entry %i", i+1);
1033 fBtn1->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1034 fBtn2->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1035 fChk1->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1036 fChk2->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1037 fRad1->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1038 fRad2->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1049 fStartB->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1050 fStopB->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1063 tf->AddFrame(fF3, fL3);
1064 tf->AddFrame(fF5, fL4);
1066 fEc1->GetCanvas()->SetBorderMode(0);
1067 fEc2->GetCanvas()->SetBorderMode(0);
1069 fEc1->GetCanvas()->Connect(
"ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
1071 "HandleEmbeddedCanvas(Int_t,Int_t,Int_t,TObject*)");
1085 bt->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1088 bt->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1092 fCheckMulti->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1093 tf->AddFrame(fF4, fL3);
1095 for (i = 0; i < 20; ++i) {
1102 fListBox->
Resize(150, 80);
1110 tf->AddFrame(
fF6, fL3);
1116 for (
j = 0;
j < 4;
j++) {
1121 tbuf->AddText(0,
"0.0");
1124 tent->Resize(50,
tent->GetDefaultHeight());
1125 tent->SetFont(
"-adobe-courier-bold-r-*-*-14-*-*-*-*-*-iso8859-1");
1132 tf->AddFrame(
fF7, fL3);
1137 bt->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1138 bt->Resize(90,
bt->GetDefaultHeight());
1141 bt->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1142 bt->Resize(90,
bt->GetDefaultHeight());
1145 bt->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1146 bt->Resize(90,
bt->GetDefaultHeight());
1148 fF7->Resize(
fF6->GetDefaultSize());
1154 fMain->AddFrame(fTab, fL5);
1156 fMain->MapSubwindows();
1160 fMain->CenterOnParent();
1162 fMain->SetWindowName(
"Dialog");
1168TestDialog::~TestDialog()
1172 fMain->DeleteWindow();
1175void TestDialog::FillHistos()
1182 fHpx =
new TH1F(
"hpx",
"This is the px distribution",100,-4,4);
1183 fHpxpy =
new TH2F(
"hpxpy",
"py vs px",40,-4,4,40,-4,4);
1214void TestDialog::DoClose()
1216 printf(
"\nTerminating dialog: via window manager\n");
1228void TestDialog::CloseWindow()
1235void TestDialog::DoOK()
1238 printf(
"\nTerminating dialog: OK pressed\n");
1260void TestDialog::DoCancel()
1263 printf(
"\nTerminating dialog: Cancel pressed\n");
1273void TestDialog::HandleButtons(
Int_t id)
1279 id =
btn->WidgetId();
1282 printf(
"DoButton: id = %d\n",
id);
1303 snprintf(tmp, 20,
"Entry %i", fLastEntry);
1304 fListBox->
AddEntry(tmp, fLastEntry);
1309 if (fFirstEntry <= fLastEntry) {
1318 if ((s ==
"Tab 3") && (fMain->MustCleanup() !=
kDeepCleanup)) {
1333 for (
int i = 0 ; i <
nt; i++) {
1363void TestDialog::DoTab(
Int_t id)
1365 printf(
"Tab item %d activated\n",
id);
1374 printf(
"event = %d, x = %d, y = %d, obj = %s::%s\n", event,
x,
y,
1375 sel->IsA()->GetName(),
sel->GetName());
1387 fMain->Connect(
"CloseWindow()",
"TestMsgBox",
this,
"CloseWindow()");
1388 fMain->DontCallClose();
1413 fTestButton->Connect(
"Clicked()",
"TestMsgBox",
this,
"DoTest()");
1421 fCloseButton->
Connect(
"Clicked()",
"TestMsgBox",
this,
"DoClose()");
1425 f1->Resize(
fTestButton->GetDefaultWidth()+40, fMain->GetDefaultHeight());
1435 f1->AddFrame(fCloseButton, fL1);
1437 fMain->AddFrame(
f1, fL21);
1464 for (i=0; i<13; ++i)
fG1->AddFrame(fC[i], fL4);
1471 for (i = 0; i < 4; ++i) {
1473 fR[i]->
Connect(
"Clicked()",
"TestMsgBox",
this,
"DoRadio()");
1489 fTbmsg->AddText(0,
"This is a test message box.");
1508 fMain->AddFrame(f2, fL2);
1510 fMain->MapSubwindows();
1514 fMain->CenterOnParent();
1516 fMain->SetWindowName(
"Message Box Test");
1525TestMsgBox::~TestMsgBox()
1529 fMain->DeleteWindow();
1532void TestMsgBox::CloseWindow()
1539void TestMsgBox::DoClose()
1546void TestMsgBox::DoTest()
1554 for (i = 0; i < 13; i++)
1558 for (i = 0; i < 4; i++)
1567 fMain->Disconnect(
"CloseWindow()");
1568 fMain->Connect(
"CloseWindow()",
"TestMsgBox",
this,
"TryToClose()");
1572 fMain->Disconnect(
"CloseWindow()");
1573 fMain->Connect(
"CloseWindow()",
"TestMsgBox",
this,
"CloseWindow()");
1577void TestMsgBox::TryToClose()
1581 printf(
"Can't close the window '%s' : a message box is still open\n", fMain->GetWindowName());
1584void TestMsgBox::DoRadio()
1591 if (
id >= 21 &&
id <= 24) {
1592 for (
int i = 0; i < 4; i++)
1593 if (fR[i]->WidgetId() !=
id)
1605 fMain->Connect(
"CloseWindow()",
"TestSliders",
this,
"CloseWindow()");
1606 fMain->DontCallClose();
1617 fTbh1->AddText(0,
"0");
1618 fTbv1->AddText(0,
"0");
1620 fTeh1->Connect(
"TextChanged(char*)",
"TestSliders",
this,
"DoText(char*)");
1621 fTev1->Connect(
"TextChanged(char*)",
"TestSliders",
this,
"DoText(char*)");
1624 fHslider1->Connect(
"PositionChanged(Int_t)",
"TestSliders",
this,
"DoSlider(Int_t)");
1628 fVslider1->Connect(
"PositionChanged(Int_t)",
"TestSliders",
this,
"DoSlider(Int_t)");
1636 fTbh2->AddText(0,
"0");
1637 fTbv2->AddText(0,
"0");
1639 fTeh2->Connect(
"TextChanged(char*)",
"TestSliders",
this,
"DoText(char*)");
1640 fTev2->Connect(
"TextChanged(char*)",
"TestSliders",
this,
"DoText(char*)");
1643 fHslider2->Connect(
"PositionChanged(Int_t)",
"TestSliders",
this,
"DoSlider(Int_t)");
1649 fVslider2->Connect(
"PositionChanged()",
"TestSliders",
this,
"DoSlider()");
1671 fMain->SetWindowName(
"Slider Test");
1673 fMain->Resize(
size);
1675 fMain->SetWMSize(
size.fWidth,
size.fHeight);
1676 fMain->SetWMSizeHints(
size.fWidth,
size.fHeight,
size.fWidth,
size.fHeight, 0, 0);
1684 fMain->CenterOnParent();
1686 fMain->MapSubwindows();
1692TestSliders::~TestSliders()
1696 fMain->DeleteWindow();
1699void TestSliders::CloseWindow()
1706void TestSliders::DoText(
const char * )
1725 atoi(
fTbv2->GetString())+2);
1732void TestSliders::DoSlider(
Int_t pos)
1740 id =
sl->WidgetId();
1743 id =
sd->WidgetId();
1756 fTbh1->AddText(0, buf);
1758 fTeh1->SetCursorPosition(
fTeh1->GetCursorPosition());
1766 else if (
id ==
VSId1) {
1769 fTbv1->AddText(0, buf);
1770 fTev1->SetCursorPosition(
fTev1->GetCursorPosition());
1778 else if (
id ==
HSId2) {
1781 fTbh2->AddText(0, buf);
1782 fTeh2->SetCursorPosition(
fTeh2->GetCursorPosition());
1790 else if (
id ==
VSId2) {
1794 fTbv2->AddText(0, buf);
1795 fTev2->SetCursorPosition(
fTev2->GetCursorPosition());
1813 fMain->Connect(
"CloseWindow()",
"TestShutter",
this,
"CloseWindow()");
1814 fMain->DontCallClose();
1827 fMain->AddFrame(fShutter, fLayout);
1829 fMain->MapSubwindows();
1830 fMain->Resize(80, 300);
1833 fMain->CenterOnParent();
1835 fMain->SetWindowName(
"Shutter Test");
1847 static int id = 5001;
1855 for (
int i=0;
data[i].pixmap_name !=
nullptr; i++) {
1858 printf(
"<TestShutter::AddShutterItem>: missing pixmap \"%s\", using default",
1866 button->Connect(
"Clicked()",
"TestShutter",
this,
"HandleButtons()");
1874TestShutter::~TestShutter()
1879 fMain->DeleteWindow();
1882void TestShutter::CloseWindow()
1887void TestShutter::HandleButtons()
1890 printf(
"Shutter button %d\n",
btn->WidgetId());
1900 fMain->Connect(
"CloseWindow()",
"TestDirList",
this,
"CloseWindow()");
1901 fMain->DontCallClose();
1912 fMain->AddFrame(canvas,lo);
1913 fContents->
Connect(
"DoubleClicked(TGListTreeItem*,Int_t)",
"TestDirList",
this,
1914 "OnDoubleClick(TGListTreeItem*,Int_t)");
1915 fContents->
Connect(
"Clicked(TGListTreeItem*,Int_t)",
"TestDirList",
this,
1916 "OnDoubleClick(TGListTreeItem*,Int_t)");
1920 fContents->
AddItem(
nullptr,
"/");
1924 fMain->CenterOnParent();
1926 fMain->SetWindowName(
"List Dir Test");
1928 fMain->MapSubwindows();
1933TestDirList::~TestDirList()
1939 fMain->DeleteWindow();
1942void TestDirList::CloseWindow()
1986 }
else if (
fname.EndsWith(
".root")) {
2002 fMain->Connect(
"CloseWindow()",
"TestDirList",
this,
"CloseWindow()");
2003 fMain->DontCallClose();
2010 fMain->AddFrame(
mb, lo);
2012 fMenu =
mb->AddPopup(
"&View");
2015 fMenu->AddEntry(
"&List",
kLVList);
2017 fMenu->AddSeparator();
2018 fMenu->AddEntry(
"&Close", 10);
2019 fMenu->Connect(
"Activated(Int_t)",
"TestFileList",
this,
"DoMenu(Int_t)");
2023 fMain->AddFrame(
lv,lo);
2028 fContents->
Connect(
"DoubleClicked(TGFrame*,Int_t)",
"TestFileList",
this,
2029 "OnDoubleClick(TGLVEntry*,Int_t)");
2032 fMain->CenterOnParent();
2034 fMain->SetWindowName(
"File List Test");
2035 fMain->MapSubwindows();
2037 fContents->SetDefaultHeaders();
2038 fContents->DisplayDirectory();
2039 fContents->AddFile(
"..");
2041 fContents->StopRefreshTimer();
2045TestFileList::~TestFileList()
2050 fMain->DeleteWindow();
2072 fContents->SetColHeaders(
"Name",
"Title");
2074 TIter next(file.GetListOfKeys());
2077 while ((key=(
TKey*)next())) {
2090void TestFileList::DisplayDirectory(
const TString &
fname)
2094 fContents->SetDefaultHeaders();
2096 fContents->ChangeDirectory(
fname);
2097 fContents->DisplayDirectory();
2098 fContents->AddFile(
"..");
2108 static TFile *file =
nullptr;
2109 if (file)
delete file;
2116 }
else obj->
Print();
2132 const char*
fname = (
const char*)
f->GetUserData();
2136 }
else if (
name.EndsWith(
".root")) {
2139 DisplayDirectory(
name);
2146void TestFileList::CloseWindow()
2159 fMain->Connect(
"CloseWindow()",
"TestProgress",
this,
"DoClose()");
2160 fMain->DontCallClose();
2170 fVProg1->SetBarColor(
"purple");
2173 fVProg2->SetBarColor(
"green");
2182 fHProg2->SetBarColor(
"lightblue");
2188 fGO->Connect(
"Clicked()",
"TestProgress",
this,
"DoGo()");
2209 fMain->SetWindowName(
"Progress Test");
2211 fMain->Resize(
size);
2214 fMain->CenterOnParent();
2216 fMain->MapSubwindows();
2222TestProgress::~TestProgress()
2226 fMain->DeleteWindow();
2229void TestProgress::CloseWindow()
2236void TestProgress::DoClose()
2255void TestProgress::DoGo()
2262 fVProg2->SetBarColor(
"green");
2314 12345, 1.0, 1.00, 1.000, 1.0000, 1.2E-12,
2315 90 * 3600, 120 * 60, 12 * 60, 12 * 3600 + 15 * 60,
2316 19991121, 19991121, (
Double_t) 0xDEADFACEU
2323 fMain->Connect(
"CloseWindow()",
"EntryTestDlg",
this,
"CloseWindow()");
2324 fMain->DontCallClose();
2335 fMain->AddFrame(fF1, fL1);
2337 for (
int i = 0; i < 13; i++) {
2344 fF[i]->AddFrame(fLabel[i], fL2);
2348 fMain->AddFrame(fF2, fL3);
2352 fLimits[0]->SetLogStep(
kFALSE);
2357 fLimits[1]->SetLogStep(
kFALSE);
2364 fSetButton->Connect(
"Clicked()",
"EntryTestDlg",
this,
"SetLimits()");
2367 fExitButton->Connect(
"Clicked()",
"EntryTestDlg",
this,
"DoOK()");
2371 fMain->SetWindowName(
"Number Entry Test");
2372 fMain->SetIconName(
"Number Entry Test");
2373 fMain->SetClassHints(
"NumberEntryDlg",
"NumberEntryDlg");
2375 fMain->MapSubwindows();
2379 fMain->CenterOnParent();
2392EntryTestDlg::~EntryTestDlg()
2396 fMain->DeleteWindow();
2399void EntryTestDlg::CloseWindow()
2404void EntryTestDlg::DoOK()
2408 fMain->SendCloseMessage();
2411void EntryTestDlg::SetLimits()
2413 Double_t min = fLimits[0]->GetNumber();
2415 Double_t max = fLimits[1]->GetNumber();
2437 for (
int i = 0; i < 13; i++) {
2449 fMain->Connect(
"CloseWindow()",
"Editor",
this,
"CloseWindow()");
2450 fMain->DontCallClose();
2457 fMain->AddFrame(fEdit, fL1);
2458 fEdit->Connect(
"Opened()",
"Editor",
this,
"DoOpen()");
2459 fEdit->Connect(
"Saved()",
"Editor",
this,
"DoSave()");
2460 fEdit->Connect(
"Closed()",
"Editor",
this,
"DoClose()");
2465 fEdit->SetSelectBack(
pxl);
2469 fOK->Connect(
"Clicked()",
"Editor",
this,
"DoOK()");
2471 fMain->AddFrame(fOK, fL2);
2475 fMain->MapSubwindows();
2487 fMain->DeleteWindow();
2490void Editor::SetTitle()
2499 snprintf(title, 256,
"ROOT Editor - Untitled");
2501 snprintf(title, 256,
"ROOT Editor - %s",
txt->GetFileName());
2503 fMain->SetWindowName(title);
2504 fMain->SetIconName(title);
2514void Editor::LoadBuffer(
const char *buffer)
2518 fEdit->LoadBuffer(buffer);
2521void Editor::LoadFile(
const char *file)
2525 fEdit->LoadFile(file);
2528void Editor::AddBuffer(
const char *buffer)
2533 txt.LoadBuffer(buffer);
2534 fEdit->AddText(&
txt);
2537void Editor::CloseWindow()
2551void Editor::DoOpen()
2556void Editor::DoSave()
2561void Editor::DoClose()
2580 if (
gROOT->IsBatch()) {
const Mask_t kButtonPressMask
const Mask_t kAnyModifier
const Mask_t kPointerMotionMask
const Mask_t kButtonReleaseMask
ULong_t Pixel_t
Pixel value.
#define RQ_OBJECT(sender_class)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
R__EXTERN TApplication * gApplication
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
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 Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
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 Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h prop
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
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 cname
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t attr
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t button
Option_t Option_t TPoint TPoint const char text
R__EXTERN void * gTQSender
R__EXTERN TRandom * gRandom
char * StrDup(const char *str)
Duplicate the string str.
R__EXTERN TSystem * gSystem
This class creates the ROOT Application Environment that interfaces to the windowing system eventloop...
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
static ULong_t RGB2Pixel(Int_t r, Int_t g, Int_t b)
Convert r,g,b to graphics system dependent pixel value.
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
Describe directory structure in memory.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Like a checkbutton but instead of the check mark there is color area with a little down arrow.
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
virtual void AddEntry(TGString *s, Int_t id)
virtual void Select(Int_t id, Bool_t emit=kTRUE)
Make the selected item visible in the combo box window and emit signals according to the second param...
The base class for composite widgets (menu bars, list boxes, etc.).
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
void Layout() override
Layout the elements of the composite frame.
void RemoveAll() override
Remove all items from the container.
virtual void SetPagePosition(const TGPosition &pos)
Set page position.
A frame with handles that allow it to be undocked (i.e.
DoubleSlider widgets allow easy selection of a min and a max value out of a range.
Dragging the slider will generate the event:
This class creates a file selection dialog.
Font selection dialog, allowing to select one in the list of available fonts in the system.
Encapsulate fonts used in the GUI system.
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
static Pixel_t GetWhitePixel()
Get white pixel value.
virtual UInt_t GetDefaultHeight() const
Encapsulate a graphics context used in the low level graphics.
A composite frame with a border and a title.
Concrete class for horizontal slider.
A composite frame that layout their children in horizontal way.
TGHotString is a string with a "hot" character underlined.
This class handles GUI labels.
This class describes layout hints used by the layout classes.
A listbox is a box, possibly with scrollbar, containing entries.
virtual void RemoveEntry(Int_t id=-1)
remove entry with id.
void Resize(UInt_t w, UInt_t h) override
Resize the listbox widget.
virtual void AddEntry(TGString *s, Int_t id)
Add entry with specified string and id to listbox.
void Layout() override
Layout the listbox components.
virtual void SetMultipleSelections(Bool_t multi=kTRUE)
virtual const char * GetText() const =0
TGListTreeItem * GetParent() const
virtual void * GetUserData() const =0
virtual void SetUserData(void *, Bool_t=kFALSE)
A list tree is a widget that can contain a number of items arranged in a tree structure.
void AddItem(TGListTreeItem *parent, TGListTreeItem *item)
Add given item to list tree.
A list view is a widget that can contain a number of items arranged in a grid or list.
Defines top level windows that interact with the system Window Manager.
This layout managers does not make use of TGLayoutHints.
TGNumberEntry is a number entry input widget with up/down buttons.
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Pixmap_t GetPicture() const
TGFrame * GetContainer() const
A shutter widget contains a set of shutter items that can be open and closed like a shutter.
virtual void AddItem(TGShutterItem *item)
Add shutter item to shutter frame.
Slider widgets allow easy selection of a range.
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Service classes of the tab widget.
const char * GetString() const
A tab widget contains a set of composite frames each with a little tab with a name (like a set of fol...
TGTabElement * GetTabTab(Int_t tabIndex) const
Return the tab element of tab with index tabIndex.
Int_t GetNumberOfTabs() const
Return number of tabs.
virtual void RemoveTab(Int_t tabIndex=-1, Bool_t storeRemoved=kTRUE)
Remove container and tab of tab with index tabIndex.
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
Yield an action as soon as it is clicked.
A TGTextEdit is a specialization of TGTextView.
A TGTextEntry is a one line text input widget.
A TGText is a multi line text buffer.
This is a layout manager for the TGListView widget.
Defines transient windows that typically are used for dialogs windows.
Concrete class for vertical slider.
A composite frame that layout their children in vertical way.
ROOT GUI Window base class.
1-D histogram with a float per channel (see TH1 documentation)
2-D histogram with a float per channel (see TH1 documentation)
Book space in a file, create I/O buffers, to fill them, (un)compress them.
const char * GetTitle() const override
Returns title (title can contain 32x32 xpm thumbnail/icon).
virtual const char * GetClassName() const
const char * GetName() const override
Returns name of object.
Mother of all ROOT objects.
virtual Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
virtual void Browse(TBrowser *b)
Browse object. May be overridden for another default action.
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
virtual void Rannor(Float_t &a, Float_t &b)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1.
This class creates a TGCanvas in which a TCanvas is created.
Describes an Operating System directory for the browser.
A TSystemFile describes an operating system file.
virtual Bool_t IsDirectory(const char *dir=nullptr) const
Check if object is a directory.
virtual const char * PrependPathName(const char *dir, TString &name)
Concatenate a directory and a file name.
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
virtual const char * WorkingDirectory()
Return working directory.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
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.
static TVirtualPadEditor * GetPadEditor(Bool_t load=kTRUE)
Returns the pad editor dialog. Static method.
static void Terminate()
Close the global pad editor. Static method.
EGEventType fType
of event (see EGEventType)
UInt_t fCode
key or button code