111const char *
filetypes[] = {
"All files",
"*",
"ROOT files",
"*.root",
"ROOT macros",
112 "*.C",
"Text files",
"*.[tT][xX][tT]",
nullptr,
nullptr};
122 {
"h2_s.xpm",
"TH2", 1002,
nullptr},
123 {
"h3_s.xpm",
"TH3", 1003,
nullptr},
124 {
"profile_s.xpm",
"TProfile", 1004,
nullptr},
125 {
nullptr,
nullptr, 0,
nullptr}};
128 {
"f1_s.xpm",
"TF1", 2001,
nullptr}, {
"f2_s.xpm",
"TF2", 2002,
nullptr}, {
nullptr,
nullptr, 0,
nullptr}};
131 {
"tree_s.xpm",
"TTree", 3002,
nullptr},
132 {
"chain_s.xpm",
"TChain", 3003,
nullptr},
133 {
nullptr,
nullptr, 0,
nullptr}};
135const char *
editortxt1 =
"This is the ROOT text edit widget TGTextEdit. It is not intended as\n"
136 "a full developers editor, but it is relatively complete and can ideally\n"
137 "be used to edit scripts or to present users editable config files, etc.\n\n"
138 "The text edit widget supports standard emacs style ctrl-key navigation\n"
139 "in addition to the arrow keys. By default the widget has under the right\n"
140 "mouse button a popup menu giving access to several built-in functions.\n\n"
141 "Cut, copy and paste between different editor windows and any other\n"
142 "standard text handling application is supported.\n\n"
143 "Text can be selected with the mouse while holding the left button\n"
144 "or with the arrow keys while holding the shift key pressed. Use the\n"
145 "middle mouse button to paste text at the current mouse location.";
146const char *
editortxt2 =
"Mice with scroll-ball are properly supported.\n\n"
147 "This are the currently defined key bindings:\n"
149 " Move the cursor one character leftwards.\n"
150 " Scroll when cursor is out of frame.\n"
152 " Move the cursor one character rightwards.\n"
153 " Scroll when cursor is out of frame.\n"
155 " Deletes the character on the left side of the text cursor and moves the\n"
156 " cursor one position to the left. If a text has been marked by the user";
157const char *
editortxt3 =
" (e.g. by clicking and dragging) the cursor will be put at the beginning\n"
158 " of the marked text and the marked text will be removed.\n"
160 " Moves the text cursor to the left end of the line. If mark is TRUE text\n"
161 " will be marked towards the first position, if not any marked text will\n"
162 " be unmarked if the cursor is moved.\n"
164 " Moves the text cursor to the right end of the line. If mark is TRUE text\n"
165 " will be marked towards the last position, if not any marked text will\n"
166 " be unmarked if the cursor is moved.\n"
168const char *
editortxt4 =
" Deletes the character on the right side of the text cursor. If a text\n"
169 " has been marked by the user (e.g. by clicking and dragging) the cursor\n"
170 " will be put at the beginning of the marked text and the marked text will\n"
172 "Shift - Left Arrow\n"
173 " Mark text one character leftwards.\n"
174 "Shift - Right Arrow\n"
175 " Mark text one character rightwards.\n"
177 " Select the whole text.\n"
179 " Move the cursor one character leftwards.";
181 " Copy the marked text to the clipboard.\n"
183 " Delete the character to the right of the cursor.\n"
185 " Move the cursor to the end of the line.\n"
187 " Start Search Dialog.\n"
189 " Delete the character to the left of the cursor.\n"
191 " Delete marked text if any or delete all\n"
192 " characters to the right of the cursor.\n"
194 " Start GoTo Line Dialog";
196 " Delete all characters on the line.\n"
198 " Paste the clipboard text into line edit.\n"
200 " Cut the marked text, copy to clipboard.\n"
202 " Paste the clipboard text into line edit.\n"
205 "All other keys with valid ASCII codes insert themselves into the line.";
227 TGLayoutHints *fMenuBarLayout, *fMenuBarItemLayout, *fMenuBarHelpLayout;
236 void HandleMenu(
Int_t id);
240 void Created() { Emit(
"Created()"); }
241 void Welcome() {
printf(
"TestMainFrame has been created. Welcome!\n"); }
280 void DoTab(
Int_t id);
281 void HandleButtons(
Int_t id = -1);
336 void DoSlider(
Int_t pos = 0);
357 void HandleButtons();
470 void LoadFile(
const char *file);
471 void LoadBuffer(
const char *buffer);
474 TGTextEdit *GetEditor()
const {
return fEdit; }
499 TGFrame *GetFrame()
const {
return fFrame; }
501 void SetCanvas(
TGCanvas *canvas) { fCanvas = canvas; }
502 void HandleMouseWheel(
Event_t *event);
510 fFrame->Connect(
"ProcessedEvent(Event_t*)",
"TileFrame",
this,
"HandleMouseWheel(Event_t*)");
518void TileFrame::HandleMouseWheel(
Event_t *event)
529 if (fCanvas->GetContainer()->GetHeight())
530 page =
Int_t(
Float_t(fCanvas->GetViewPort()->GetHeight() * fCanvas->GetViewPort()->GetHeight()) /
531 fCanvas->GetContainer()->GetHeight());
539 fCanvas->SetVsbPosition(
newpos);
544 fCanvas->SetVsbPosition(
newpos);
557 fMain->Connect(
"CloseWindow()",
"TestMainFrame",
this,
"CloseWindow()");
563 fMenuDock->SetWindowName(
"GuiTest Menu");
573 fMenuFile->AddEntry(
"&Close", -1);
574 fMenuFile->AddSeparator();
577 fMenuFile->AddSeparator();
603 fMenuTest->AddLabel(
"Test different features...");
634 fMenuDock->Connect(
"Undocked()",
"TestMainFrame",
this,
"HandleMenu(=M_VIEW_UNDOCK)");
639 fMenuHelp->AddSeparator();
650 fMenuFile->Connect(
"Activated(Int_t)",
"TestMainFrame",
this,
"HandleMenu(Int_t)");
651 fMenuFile->Connect(
"PoppedUp()",
"TestMainFrame",
this,
"HandlePopup()");
652 fMenuFile->Connect(
"PoppedDown()",
"TestMainFrame",
this,
"HandlePopdown()");
653 fMenuTest->Connect(
"Activated(Int_t)",
"TestMainFrame",
this,
"HandleMenu(Int_t)");
654 fMenuView->Connect(
"Activated(Int_t)",
"TestMainFrame",
this,
"HandleMenu(Int_t)");
655 fMenuHelp->Connect(
"Activated(Int_t)",
"TestMainFrame",
this,
"HandleMenu(Int_t)");
656 fCascadeMenu->Connect(
"Activated(Int_t)",
"TestMainFrame",
this,
"HandleMenu(Int_t)");
657 fCascade1Menu->Connect(
"Activated(Int_t)",
"TestMainFrame",
this,
"HandleMenu(Int_t)");
658 fCascade2Menu->Connect(
"Activated(Int_t)",
"TestMainFrame",
this,
"HandleMenu(Int_t)");
659 fMenuNew1->Connect(
"Activated(Int_t)",
"TestMainFrame",
this,
"HandleMenu(Int_t)");
660 fMenuNew2->Connect(
"Activated(Int_t)",
"TestMainFrame",
this,
"HandleMenu(Int_t)");
663 fMenuBar->AddPopup(
"&File", fMenuFile, fMenuBarItemLayout);
664 fMenuBar->AddPopup(
"&Test",
fMenuTest, fMenuBarItemLayout);
665 fMenuBar->AddPopup(
"&View",
fMenuView, fMenuBarItemLayout);
666 fMenuBar->AddPopup(
"&Help", fMenuHelp, fMenuBarHelpLayout);
668 fMenuDock->AddFrame(fMenuBar, fMenuBarLayout);
671 fCanvasWindow =
new TGCanvas(fMain, 400, 240);
672 fContainer =
new TileFrame(fCanvasWindow->GetViewPort());
673 fContainer->SetCanvas(fCanvasWindow);
674 fCanvasWindow->SetContainer(fContainer->GetFrame());
680 for (
int i = 0; i < 256; ++i)
681 fCanvasWindow->AddFrame(
691 fTestButton->Connect(
"Clicked()",
"TestMainFrame",
this,
"DoButton()");
692 fTestButton->SetToolTipText(
"Pops up\ntext editor");
695 fTestText->SetToolTipText(
"This is a text entry widget");
705 fMain->SetWindowName(
"GuiTest Signal/Slots");
707 fMain->MapSubwindows();
713 Connect(
"Created()",
"TestMainFrame",
this,
"Welcome()");
717TestMainFrame::~TestMainFrame()
735void TestMainFrame::CloseWindow()
742void TestMainFrame::DoButton()
756void TestMainFrame::HandleMenu(
Int_t id)
767 printf(
"fIniDir = %s\n",
fi.fIniDir);
769 printf(
"Open file: %s (dir: %s)\n",
fi.fFilename,
fi.fIniDir);
777 printf(
"Hiding itself, select \"Print Setup...\" to enable again\n");
782 printf(
"M_FILE_PRINTSETUP\n");
783 printf(
"Enabling \"Print\"\n");
810 if (
prop.fName !=
"")
811 printf(
"Selected font: %s, size %d, italic %s, bold %s, color 0x%lx, align %u\n",
prop.fName.Data(),
822 fMenuBar->AddPopup(
"New 1",
fMenuNew1, fMenuBarItemLayout,
p);
823 p = fMenuBar->GetPopup(
"Help");
824 fMenuBar->AddPopup(
"New 2",
fMenuNew2, fMenuBarItemLayout,
p);
825 fMenuBar->MapSubwindows();
833 fMenuBar->RemovePopup(
"New 1");
834 fMenuBar->RemovePopup(
"New 2");
872 default:
printf(
"Menu item %d selected\n",
id);
break;
882 fMain->Connect(
"CloseWindow()",
"TestDialog",
this,
"DoClose()");
883 fMain->DontCallClose();
891 fOkButton->Connect(
"Clicked()",
"TestDialog",
this,
"DoOK()");
893 fCancelButton->
Connect(
"Clicked()",
"TestDialog",
this,
"DoCancel()");
899 fFrame1->AddFrame(fCancelButton, fL1);
906 fTab =
new TGTab(fMain, 300, 300);
907 fTab->
Connect(
"Selected(Int_t)",
"TestDialog",
this,
"DoTab(Int_t)");
916 tf->AddFrame(fF1, fL3);
917 fTxt1->Resize(150,
fTxt1->GetDefaultHeight());
918 fTxt2->Resize(150,
fTxt2->GetDefaultHeight());
932 tf->AddFrame(fF2, fL3);
936 for (i = 0; i < 20; i++) {
944 fBtn1->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
945 fBtn2->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
946 fChk1->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
947 fChk2->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
948 fRad1->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
949 fRad2->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
960 fStartB->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
961 fStopB->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
973 tf->AddFrame(fF3, fL3);
974 tf->AddFrame(fF5, fL4);
976 fEc1->GetCanvas()->SetBorderMode(0);
977 fEc2->GetCanvas()->SetBorderMode(0);
979 fEc1->GetCanvas()->Connect(
"ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
"TestDialog",
this,
980 "HandleEmbeddedCanvas(Int_t,Int_t,Int_t,TObject*)");
994 bt->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
997 bt->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1001 fCheckMulti->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1002 tf->AddFrame(fF4, fL3);
1004 for (i = 0; i < 20; ++i) {
1011 fListBox->
Resize(150, 80);
1019 tf->AddFrame(
fF6, fL3);
1025 for (
j = 0;
j < 4;
j++) {
1030 tbuf->AddText(0,
"0.0");
1033 tent->Resize(50,
tent->GetDefaultHeight());
1034 tent->SetFont(
"-adobe-courier-bold-r-*-*-14-*-*-*-*-*-iso8859-1");
1041 tf->AddFrame(
fF7, fL3);
1046 bt->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1047 bt->Resize(90,
bt->GetDefaultHeight());
1050 bt->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1051 bt->Resize(90,
bt->GetDefaultHeight());
1054 bt->Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
1055 bt->Resize(90,
bt->GetDefaultHeight());
1057 fF7->Resize(
fF6->GetDefaultSize());
1062 fMain->AddFrame(fTab, fL5);
1064 fMain->MapSubwindows();
1068 fMain->CenterOnParent();
1070 fMain->SetWindowName(
"Dialog");
1076TestDialog::~TestDialog()
1080 fMain->DeleteWindow();
1083void TestDialog::FillHistos()
1090 fHpx =
new TH1F(
"hpx",
"This is the px distribution", 100, -4, 4);
1091 fHpxpy =
new TH2F(
"hpxpy",
"py vs px", 40, -4, 4, 40, -4, 4);
1122void TestDialog::DoClose()
1124 printf(
"\nTerminating dialog: via window manager\n");
1136void TestDialog::CloseWindow()
1143void TestDialog::DoOK()
1146 printf(
"\nTerminating dialog: OK pressed\n");
1167void TestDialog::DoCancel()
1170 printf(
"\nTerminating dialog: Cancel pressed\n");
1180void TestDialog::HandleButtons(
Int_t id)
1186 id =
btn->WidgetId();
1189 printf(
"DoButton: id = %d\n",
id);
1216 if (fFirstEntry <= fLastEntry) {
1225 if ((s ==
"Tab 3") && (fMain->MustCleanup() !=
kDeepCleanup)) {
1241 for (
int i = 0; i <
nt; i++) {
1263void TestDialog::DoTab(
Int_t id)
1265 printf(
"Tab item %d activated\n",
id);
1273 printf(
"event = %d, x = %d, y = %d, obj = %s::%s\n", event,
x,
y,
sel->IsA()->GetName(),
sel->GetName());
1284 fMain->Connect(
"CloseWindow()",
"TestMsgBox",
this,
"CloseWindow()");
1285 fMain->DontCallClose();
1310 fTestButton->Connect(
"Clicked()",
"TestMsgBox",
this,
"DoTest()");
1318 fCloseButton->
Connect(
"Clicked()",
"TestMsgBox",
this,
"DoClose()");
1322 f1->Resize(
fTestButton->GetDefaultWidth() + 40, fMain->GetDefaultHeight());
1329 f1->AddFrame(fCloseButton, fL1);
1331 fMain->AddFrame(
f1, fL21);
1355 for (i = 0; i < 13; ++i)
1356 fG1->AddFrame(fC[i], fL4);
1363 for (i = 0; i < 4; ++i) {
1365 fR[i]->
Connect(
"Clicked()",
"TestMsgBox",
this,
"DoRadio()");
1381 fTbmsg->AddText(0,
"This is a test message box.");
1398 fMain->AddFrame(f2, fL2);
1400 fMain->MapSubwindows();
1404 fMain->CenterOnParent();
1406 fMain->SetWindowName(
"Message Box Test");
1415TestMsgBox::~TestMsgBox()
1419 fMain->DeleteWindow();
1422void TestMsgBox::CloseWindow()
1429void TestMsgBox::DoClose()
1436void TestMsgBox::DoTest()
1444 for (i = 0; i < 13; i++)
1448 for (i = 0; i < 4; i++)
1457 fMain->Disconnect(
"CloseWindow()");
1458 fMain->Connect(
"CloseWindow()",
"TestMsgBox",
this,
"TryToClose()");
1460 fMain->Disconnect(
"CloseWindow()");
1461 fMain->Connect(
"CloseWindow()",
"TestMsgBox",
this,
"CloseWindow()");
1464void TestMsgBox::TryToClose()
1468 printf(
"Can't close the window '%s' : a message box is still open\n", fMain->GetWindowName());
1471void TestMsgBox::DoRadio()
1478 if (
id >= 21 &&
id <= 24) {
1479 for (
int i = 0; i < 4; i++)
1480 if (fR[i]->WidgetId() !=
id)
1490 fMain->Connect(
"CloseWindow()",
"TestSliders",
this,
"CloseWindow()");
1491 fMain->DontCallClose();
1502 fTbh1->AddText(0,
"0");
1503 fTbv1->AddText(0,
"0");
1505 fTeh1->Connect(
"TextChanged(char*)",
"TestSliders",
this,
"DoText(char*)");
1506 fTev1->Connect(
"TextChanged(char*)",
"TestSliders",
this,
"DoText(char*)");
1509 fHslider1->Connect(
"PositionChanged(Int_t)",
"TestSliders",
this,
"DoSlider(Int_t)");
1513 fVslider1->Connect(
"PositionChanged(Int_t)",
"TestSliders",
this,
"DoSlider(Int_t)");
1521 fTbh2->AddText(0,
"0");
1522 fTbv2->AddText(0,
"0");
1524 fTeh2->Connect(
"TextChanged(char*)",
"TestSliders",
this,
"DoText(char*)");
1525 fTev2->Connect(
"TextChanged(char*)",
"TestSliders",
this,
"DoText(char*)");
1528 fHslider2->Connect(
"PositionChanged(Int_t)",
"TestSliders",
this,
"DoSlider(Int_t)");
1534 fVslider2->Connect(
"PositionChanged()",
"TestSliders",
this,
"DoSlider()");
1556 fMain->SetWindowName(
"Slider Test");
1558 fMain->Resize(
size);
1560 fMain->SetWMSize(
size.fWidth,
size.fHeight);
1561 fMain->SetWMSizeHints(
size.fWidth,
size.fHeight,
size.fWidth,
size.fHeight, 0, 0);
1566 fMain->CenterOnParent();
1568 fMain->MapSubwindows();
1574TestSliders::~TestSliders()
1578 fMain->DeleteWindow();
1581void TestSliders::CloseWindow()
1588void TestSliders::DoText(
const char * )
1604void TestSliders::DoSlider(
Int_t pos)
1612 id =
sl->WidgetId();
1615 id =
sd->WidgetId();
1624 fTbh1->AddText(0, buf);
1626 fTeh1->SetCursorPosition(
fTeh1->GetCursorPosition());
1632 fTbv1->AddText(0, buf);
1633 fTev1->SetCursorPosition(
fTev1->GetCursorPosition());
1639 fTbh2->AddText(0, buf);
1640 fTeh2->SetCursorPosition(
fTeh2->GetCursorPosition());
1647 fTbv2->AddText(0, buf);
1648 fTev2->SetCursorPosition(
fTev2->GetCursorPosition());
1661 fMain->Connect(
"CloseWindow()",
"TestShutter",
this,
"CloseWindow()");
1662 fMain->DontCallClose();
1675 fMain->AddFrame(fShutter, fLayout);
1677 fMain->MapSubwindows();
1678 fMain->Resize(80, 300);
1681 fMain->CenterOnParent();
1683 fMain->SetWindowName(
"Shutter Test");
1695 static int id = 5001;
1702 for (
int i = 0;
data[i].pixmap_name !=
nullptr; i++) {
1712 button->Connect(
"Clicked()",
"TestShutter",
this,
"HandleButtons()");
1720TestShutter::~TestShutter()
1725 fMain->DeleteWindow();
1728void TestShutter::CloseWindow()
1733void TestShutter::HandleButtons()
1736 printf(
"Shutter button %d\n",
btn->WidgetId());
1744 fMain->Connect(
"CloseWindow()",
"TestDirList",
this,
"CloseWindow()");
1745 fMain->DontCallClose();
1756 fMain->AddFrame(canvas, lo);
1757 fContents->Connect(
"DoubleClicked(TGListTreeItem*,Int_t)",
"TestDirList",
this,
1758 "OnDoubleClick(TGListTreeItem*,Int_t)");
1759 fContents->Connect(
"Clicked(TGListTreeItem*,Int_t)",
"TestDirList",
this,
"OnDoubleClick(TGListTreeItem*,Int_t)");
1767 fMain->CenterOnParent();
1769 fMain->SetWindowName(
"List Dir Test");
1771 fMain->MapSubwindows();
1776TestDirList::~TestDirList()
1782 fMain->DeleteWindow();
1785void TestDirList::CloseWindow()
1797 while ((parent =
item->GetParent())) {
1813 item->SetUserData((
void *)1);
1830 }
else if (
fname.EndsWith(
".root")) {
1845 fMain->Connect(
"CloseWindow()",
"TestDirList",
this,
"CloseWindow()");
1846 fMain->DontCallClose();
1853 fMain->AddFrame(
mb, lo);
1855 fMenu =
mb->AddPopup(
"&View");
1858 fMenu->AddEntry(
"&List",
kLVList);
1860 fMenu->AddSeparator();
1861 fMenu->AddEntry(
"&Close", 10);
1862 fMenu->Connect(
"Activated(Int_t)",
"TestFileList",
this,
"DoMenu(Int_t)");
1866 fMain->AddFrame(
lv, lo);
1871 fContents->Connect(
"DoubleClicked(TGFrame*,Int_t)",
"TestFileList",
this,
"OnDoubleClick(TGLVEntry*,Int_t)");
1874 fMain->CenterOnParent();
1876 fMain->SetWindowName(
"File List Test");
1877 fMain->MapSubwindows();
1887TestFileList::~TestFileList()
1892 fMain->DeleteWindow();
1914 fContents->SetColHeaders(
"Name",
"Title");
1916 TIter next(file.GetListOfKeys());
1919 while ((key = (
TKey *)next())) {
1932void TestFileList::DisplayDirectory(
const TString &
fname)
1951 static TFile *file =
nullptr;
1977 const char *
fname = (
const char *)
f->GetUserData();
1981 }
else if (
name.EndsWith(
".root")) {
1984 DisplayDirectory(
name);
1991void TestFileList::CloseWindow()
2003 fMain->Connect(
"CloseWindow()",
"TestProgress",
this,
"DoClose()");
2004 fMain->DontCallClose();
2014 fVProg1->SetBarColor(
"purple");
2017 fVProg2->SetBarColor(
"green");
2026 fHProg2->SetBarColor(
"lightblue");
2032 fGO->Connect(
"Clicked()",
"TestProgress",
this,
"DoGo()");
2053 fMain->SetWindowName(
"Progress Test");
2055 fMain->Resize(
size);
2058 fMain->CenterOnParent();
2060 fMain->MapSubwindows();
2066TestProgress::~TestProgress()
2070 fMain->DeleteWindow();
2073void TestProgress::CloseWindow()
2080void TestProgress::DoClose()
2099void TestProgress::DoGo()
2109 fVProg2->SetBarColor(
"green");
2144 "Integer",
"One digit real",
"Two digit real",
"Three digit real",
"Four digit real",
"Real",
"Degree.min.sec",
2145 "Min:sec",
"Hour:min",
"Hour:min:sec",
"Day/month/year",
"Month/day/year",
"Hex"};
2157 12 * 3600 + 15 * 60,
2166 fMain->Connect(
"CloseWindow()",
"EntryTestDlg",
this,
"CloseWindow()");
2167 fMain->DontCallClose();
2179 fMain->AddFrame(fF1, fL1);
2181 for (
int i = 0; i < 13; i++) {
2187 fF[i]->AddFrame(fLabel[i], fL2);
2191 fMain->AddFrame(fF2, fL3);
2195 fLimits[0]->SetLogStep(
kFALSE);
2200 fLimits[1]->SetLogStep(
kFALSE);
2207 fSetButton->Connect(
"Clicked()",
"EntryTestDlg",
this,
"SetLimits()");
2210 fExitButton->Connect(
"Clicked()",
"EntryTestDlg",
this,
"DoOK()");
2214 fMain->SetWindowName(
"Number Entry Test");
2215 fMain->SetIconName(
"Number Entry Test");
2216 fMain->SetClassHints(
"NumberEntryDlg",
"NumberEntryDlg");
2218 fMain->MapSubwindows();
2222 fMain->CenterOnParent();
2233EntryTestDlg::~EntryTestDlg()
2237 fMain->DeleteWindow();
2240void EntryTestDlg::CloseWindow()
2245void EntryTestDlg::DoOK()
2249 fMain->SendCloseMessage();
2252void EntryTestDlg::SetLimits()
2254 Double_t min = fLimits[0]->GetNumber();
2256 Double_t max = fLimits[1]->GetNumber();
2278 for (
int i = 0; i < 13; i++) {
2289 fMain->Connect(
"CloseWindow()",
"Editor",
this,
"CloseWindow()");
2290 fMain->DontCallClose();
2297 fMain->AddFrame(fEdit, fL1);
2298 fEdit->Connect(
"Opened()",
"Editor",
this,
"DoOpen()");
2299 fEdit->Connect(
"Saved()",
"Editor",
this,
"DoSave()");
2300 fEdit->Connect(
"Closed()",
"Editor",
this,
"DoClose()");
2305 fEdit->SetSelectBack(
pxl);
2309 fOK->Connect(
"Clicked()",
"Editor",
this,
"DoOK()");
2311 fMain->AddFrame(fOK, fL2);
2315 fMain->MapSubwindows();
2327 fMain->DeleteWindow();
2330void Editor::SetTitle()
2339 snprintf(title, 256,
"ROOT Editor - Untitled");
2341 snprintf(title, 256,
"ROOT Editor - %s",
txt->GetFileName());
2343 fMain->SetWindowName(title);
2344 fMain->SetIconName(title);
2354void Editor::LoadBuffer(
const char *buffer)
2358 fEdit->LoadBuffer(buffer);
2361void Editor::LoadFile(
const char *file)
2365 fEdit->LoadFile(file);
2368void Editor::AddBuffer(
const char *buffer)
2373 txt.LoadBuffer(buffer);
2374 fEdit->AddText(&
txt);
2377void Editor::CloseWindow()
2391void Editor::DoOpen()
2396void Editor::DoSave()
2401void Editor::DoClose()
2419 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
bool Bool_t
Boolean (0=false, 1=true) (bool)
int Int_t
Signed integer 4 bytes (int)
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
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.
TDirectory::TContext keeps track and restore the current directory.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
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.
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
A list tree is a widget that can contain a number of items arranged in a tree structure.
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
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