Test program for ROOT native GUI classes Exactly like $ROOTSYS/test/guitest.cxx but using the new signal and slots communication mechanism.
It is now possible to run this entire test program in the interpreter. Do either:
#include <cstdlib>
enum ETestCommandIdentifiers {
M_FILE_OPEN,
M_FILE_SAVE,
M_FILE_SAVEAS,
M_FILE_PRINT,
M_FILE_PRINTSETUP,
M_FILE_EXIT,
M_TEST_DLG,
M_TEST_MSGBOX,
M_TEST_SLIDER,
M_TEST_SHUTTER,
M_TEST_DIRLIST,
M_TEST_FILELIST,
M_TEST_PROGRESS,
M_TEST_NUMBERENTRY,
M_TEST_FONTDIALOG,
M_TEST_NEWMENU,
M_VIEW_ENBL_DOCK,
M_VIEW_ENBL_HIDE,
M_VIEW_DOCK,
M_VIEW_UNDOCK,
M_HELP_CONTENTS,
M_HELP_SEARCH,
M_HELP_ABOUT,
M_CASCADE_1,
M_CASCADE_2,
M_CASCADE_3,
M_NEW_REMOVEMENU,
VId1,
HId1,
VId2,
HId2,
VSId1,
HSId1,
VSId2,
HSId2
};
const char *filetypes[] = {"All files", "*", "ROOT files", "*.root", "ROOT macros",
"*.C", "Text files", "*.[tT][xX][tT]", nullptr, nullptr};
struct shutterData_t {
const char *pixmap_name;
const char *tip_text;
TGButton *button;
};
shutterData_t histo_data[] = {{"h1_s.xpm", "TH1", 1001, nullptr},
{"h2_s.xpm", "TH2", 1002, nullptr},
{"h3_s.xpm", "TH3", 1003, nullptr},
{"profile_s.xpm", "TProfile", 1004, nullptr},
{nullptr, nullptr, 0, nullptr}};
shutterData_t function_data[] = {
{"f1_s.xpm", "TF1", 2001, nullptr}, {"f2_s.xpm", "TF2", 2002, nullptr}, {nullptr, nullptr, 0, nullptr}};
shutterData_t tree_data[] = {{"ntuple_s.xpm", "TNtuple", 3001, nullptr},
{"tree_s.xpm", "TTree", 3002, nullptr},
{"chain_s.xpm", "TChain", 3003, nullptr},
{nullptr, nullptr, 0, nullptr}};
const char *editortxt1 = "This is the ROOT text edit widget TGTextEdit. It is not intended as\n"
"a full developers editor, but it is relatively complete and can ideally\n"
"be used to edit scripts or to present users editable config files, etc.\n\n"
"The text edit widget supports standard emacs style ctrl-key navigation\n"
"in addition to the arrow keys. By default the widget has under the right\n"
"mouse button a popup menu giving access to several built-in functions.\n\n"
"Cut, copy and paste between different editor windows and any other\n"
"standard text handling application is supported.\n\n"
"Text can be selected with the mouse while holding the left button\n"
"or with the arrow keys while holding the shift key pressed. Use the\n"
"middle mouse button to paste text at the current mouse location.";
const char *editortxt2 = "Mice with scroll-ball are properly supported.\n\n"
"This are the currently defined key bindings:\n"
"Left Arrow\n"
" Move the cursor one character leftwards.\n"
" Scroll when cursor is out of frame.\n"
"Right Arrow\n"
" Move the cursor one character rightwards.\n"
" Scroll when cursor is out of frame.\n"
"Backspace\n"
" Deletes the character on the left side of the text cursor and moves the\n"
" cursor one position to the left. If a text has been marked by the user";
const char *editortxt3 = " (e.g. by clicking and dragging) the cursor will be put at the beginning\n"
" of the marked text and the marked text will be removed.\n"
"Home\n"
" Moves the text cursor to the left end of the line. If mark is TRUE text\n"
" will be marked towards the first position, if not any marked text will\n"
" be unmarked if the cursor is moved.\n"
"End\n"
" Moves the text cursor to the right end of the line. If mark is TRUE text\n"
" will be marked towards the last position, if not any marked text will\n"
" be unmarked if the cursor is moved.\n"
"Delete";
const char *editortxt4 = " Deletes the character on the right side of the text cursor. If a text\n"
" has been marked by the user (e.g. by clicking and dragging) the cursor\n"
" will be put at the beginning of the marked text and the marked text will\n"
" be removed.\n"
"Shift - Left Arrow\n"
" Mark text one character leftwards.\n"
"Shift - Right Arrow\n"
" Mark text one character rightwards.\n"
"Control-A\n"
" Select the whole text.\n"
"Control-B\n"
" Move the cursor one character leftwards.";
const char *editortxt5 = "Control-C\n"
" Copy the marked text to the clipboard.\n"
"Control-D\n"
" Delete the character to the right of the cursor.\n"
"Control-E\n"
" Move the cursor to the end of the line.\n"
"Control-F\n"
" Start Search Dialog.\n"
"Control-H\n"
" Delete the character to the left of the cursor.\n"
"Control-K\n"
" Delete marked text if any or delete all\n"
" characters to the right of the cursor.\n"
"Control-L\n"
" Start GoTo Line Dialog";
const char *editortxt6 = "Control-U\n"
" Delete all characters on the line.\n"
"Control-V\n"
" Paste the clipboard text into line edit.\n"
"Control-X\n"
" Cut the marked text, copy to clipboard.\n"
"Control-Y\n"
" Paste the clipboard text into line edit.\n"
"Control-Z\n"
" Undo action.\n\n"
"All other keys with valid ASCII codes insert themselves into the line.";
class TileFrame;
class TestMainFrame {
private:
TGMainFrame *fMain;
TGDockableFrame *fMenuDock;
TGCompositeFrame *fStatusFrame;
TGCanvas *fCanvasWindow;
TileFrame *fContainer;
TGTextEntry *fTestText;
TGButton *fTestButton;
TGColorSelect *fColorSel;
TGMenuBar *fMenuBar;
TGPopupMenu *fMenuFile, *fMenuTest, *fMenuView, *fMenuHelp;
TGPopupMenu *fCascadeMenu, *fCascade1Menu, *fCascade2Menu;
TGPopupMenu *fMenuNew1, *fMenuNew2;
TGLayoutHints *fMenuBarLayout, *fMenuBarItemLayout, *fMenuBarHelpLayout;
public:
virtual ~TestMainFrame();
void CloseWindow();
void DoButton();
void HandleMenu(
Int_t id);
void HandlePopup() { printf("menu popped up\n"); }
void HandlePopdown() { printf("menu popped down\n"); }
void Created() { Emit("Created()"); }
void Welcome() { printf("TestMainFrame has been created. Welcome!\n"); }
};
class TestDialog {
private:
TGTransientFrame *fMain;
TGCompositeFrame *fFrame1, *fF1, *fF2, *fF3, *fF4, *fF5;
TGGroupFrame *fF6, *fF7;
TGButton *fOkButton, *fCancelButton, *fStartB, *fStopB;
TGButton *fBtn1, *fBtn2, *fChk1, *fChk2, *fRad1, *fRad2;
TGPictureButton *fPicBut1;
TGCheckButton *fCheck1;
TGCheckButton *fCheckMulti;
TGListBox *fListBox;
TGComboBox *fCombo;
TGTab *fTab;
TGTextEntry *fTxt1, *fTxt2;
TGLayoutHints *fL1, *fL2, *fL3, *fL4;
TRootEmbeddedCanvas *fEc1, *fEc2;
TH1F *fHpx;
TH2F *fHpxpy;
void FillHistos();
public:
virtual ~TestDialog();
void DoClose();
void CloseWindow();
void DoOK();
void DoCancel();
void HandleButtons(
Int_t id = -1);
};
class TestMsgBox {
private:
TGTransientFrame *fMain;
TGCompositeFrame *
f1, *f2, *f3, *f4, *f5;
TGButton *fTestButton, *fCloseButton;
TGPictureButton *fPictButton;
TGRadioButton *fR[4];
TGCheckButton *fC[13];
TGGroupFrame *fG1, *fG2;
TGLayoutHints *fL1, *fL2, *fL3, *fL4, *fL5, *fL6, *fL21;
TGTextEntry *fTitle, *fMsg;
TGTextBuffer *fTbtitle, *fTbmsg;
TGLabel *fLtitle, *fLmsg;
TGGC fRedTextGC;
public:
virtual ~TestMsgBox();
void TryToClose();
void CloseWindow();
void DoClose();
void DoRadio();
void DoTest();
};
class TestSliders {
private:
TGTransientFrame *fMain;
TGVerticalFrame *fVframe1, *fVframe2;
TGLayoutHints *fBly, *fBfly1;
TGHSlider *fHslider1, *fHslider2;
TGVSlider *fVslider1;
TGDoubleVSlider *fVslider2;
TGTextEntry *fTeh1, *fTev1, *fTeh2, *fTev2;
TGTextBuffer *fTbh1, *fTbv1, *fTbh2, *fTbv2;
public:
virtual ~TestSliders();
void CloseWindow();
void DoText(const
char *
text);
void DoSlider(
Int_t pos = 0);
};
class TestShutter {
private:
TGTransientFrame *fMain;
TGShutter *fShutter;
TGLayoutHints *fLayout;
const TGPicture *fDefaultPic;
public:
~TestShutter();
void AddShutterItem(const
char *
name, shutterData_t *data);
void CloseWindow();
void HandleButtons();
};
class TestDirList {
protected:
TGTransientFrame *fMain;
TGListTree *fContents;
const TGPicture *fIcon;
TString DirName(TGListTreeItem *item);
public:
virtual ~TestDirList();
void OnDoubleClick(TGListTreeItem *item,
Int_t btn);
void CloseWindow();
};
class TestFileList {
protected:
TGTransientFrame *fMain;
TGFileContainer *fContents;
TGPopupMenu *fMenu;
void DisplayFile(const TString &fname);
void DisplayDirectory(const TString &fname);
void DisplayObject(const TString &fname, const TString &
name);
public:
virtual ~TestFileList();
void OnDoubleClick(TGLVEntry *,
Int_t);
void CloseWindow();
};
class TestProgress {
private:
TGTransientFrame *fMain;
TGHorizontalFrame *fHframe1;
TGVerticalFrame *fVframe1;
TGLayoutHints *fHint1, *fHint2, *fHint3, *fHint4, *fHint5;
TGHProgressBar *fHProg1, *fHProg2, *fHProg3;
TGVProgressBar *fVProg1, *fVProg2;
TGTextButton *fGO;
public:
virtual ~TestProgress();
void CloseWindow();
void DoClose();
void DoGo();
};
class EntryTestDlg {
private:
TGTransientFrame *fMain;
TGVerticalFrame *fF1;
TGVerticalFrame *fF2;
TGHorizontalFrame *fF[13];
TGLayoutHints *fL1;
TGLayoutHints *fL2;
TGLayoutHints *fL3;
TGLabel *fLabel[13];
TGNumberEntry *fNumericEntries[13];
TGCheckButton *fLowerLimit;
TGCheckButton *fUpperLimit;
TGNumberEntry *fLimits[2];
TGCheckButton *fPositive;
TGCheckButton *fNonNegative;
TGButton *fSetButton;
TGButton *fExitButton;
public:
EntryTestDlg(
const TGWindow *p,
const TGWindow *
main);
virtual ~EntryTestDlg();
void CloseWindow();
void SetLimits();
void DoOK();
};
class Editor {
private:
TGTransientFrame *fMain;
TGTextEdit *fEdit;
TGTextButton *fOK;
TGLayoutHints *fL1;
TGLayoutHints *fL2;
public:
virtual ~Editor();
void LoadFile(const char *file);
void LoadBuffer(const char *buffer);
void AddBuffer(const char *buffer);
TGTextEdit *GetEditor() const { return fEdit; }
void SetTitle();
void Popup();
void CloseWindow();
void DoOK();
void DoOpen();
void DoSave();
void DoClose();
};
class TileFrame {
private:
TGCompositeFrame *fFrame;
TGCanvas *fCanvas;
public:
TileFrame(const TGWindow *p);
virtual ~TileFrame() { delete fFrame; }
TGFrame *GetFrame() const { return fFrame; }
void SetCanvas(TGCanvas *canvas) { fCanvas = canvas; }
void HandleMouseWheel(Event_t *event);
};
TileFrame::TileFrame(const TGWindow *p)
{
fFrame->Connect("ProcessedEvent(Event_t*)", "TileFrame", this, "HandleMouseWheel(Event_t*)");
fCanvas = nullptr;
fFrame->SetLayoutManager(new TGTileLayout(fFrame, 8));
}
void TileFrame::HandleMouseWheel(Event_t *event)
{
return;
if (!fCanvas)
return;
if (fCanvas->GetContainer()->GetHeight())
page =
Int_t(
Float_t(fCanvas->GetViewPort()->GetHeight() * fCanvas->GetViewPort()->GetHeight()) /
fCanvas->GetContainer()->GetHeight());
}
Int_t newpos = fCanvas->GetVsbPosition() - page;
if (newpos < 0)
newpos = 0;
fCanvas->SetVsbPosition(newpos);
}
Int_t newpos = fCanvas->GetVsbPosition() + page;
fCanvas->SetVsbPosition(newpos);
}
}
TestMainFrame::TestMainFrame(
const TGWindow *p,
UInt_t w,
UInt_t h)
{
fMain =
new TGMainFrame(p, w,
h);
fMain->Connect("CloseWindow()", "TestMainFrame", this, "CloseWindow()");
fMenuDock = new TGDockableFrame(fMain);
fMain->AddFrame(fMenuDock,
new TGLayoutHints(
kLHintsExpandX, 0, 0, 1, 0));
fMenuDock->SetWindowName("GuiTest Menu");
fMenuFile =
new TGPopupMenu(
gClient->GetRoot());
fMenuFile->AddEntry("&Open...", M_FILE_OPEN);
fMenuFile->AddEntry("&Save", M_FILE_SAVE);
fMenuFile->AddEntry("S&ave as...", M_FILE_SAVEAS);
fMenuFile->AddEntry("&Close", -1);
fMenuFile->AddSeparator();
fMenuFile->AddEntry("&Print", M_FILE_PRINT);
fMenuFile->AddEntry("P&rint setup...", M_FILE_PRINTSETUP);
fMenuFile->AddSeparator();
fMenuFile->AddEntry("E&xit", M_FILE_EXIT);
fMenuFile->DisableEntry(M_FILE_SAVEAS);
fMenuFile->HideEntry(M_FILE_PRINT);
fCascade2Menu =
new TGPopupMenu(
gClient->GetRoot());
fCascade2Menu->AddEntry("ID = 2&3", M_CASCADE_1);
fCascade2Menu->AddEntry("ID = 2&4", M_CASCADE_2);
fCascade2Menu->AddEntry("ID = 2&5", M_CASCADE_3);
fCascade1Menu =
new TGPopupMenu(
gClient->GetRoot());
fCascade1Menu->AddEntry("ID = 4&1", 41);
fCascade1Menu->AddEntry("ID = 4&2", 42);
fCascade1Menu->AddEntry("ID = 4&3", 43);
fCascade1Menu->AddSeparator();
fCascade1Menu->AddPopup("Cascade&d 2", fCascade2Menu);
fCascadeMenu =
new TGPopupMenu(
gClient->GetRoot());
fCascadeMenu->AddEntry("ID = 5&1", 51);
fCascadeMenu->AddEntry("ID = 5&2", 52);
fCascadeMenu->AddEntry("ID = 5&3", 53);
fCascadeMenu->AddSeparator();
fCascadeMenu->AddPopup("&Cascaded 1", fCascade1Menu);
fMenuTest =
new TGPopupMenu(
gClient->GetRoot());
fMenuTest->AddLabel("Test different features...");
fMenuTest->AddSeparator();
fMenuTest->AddEntry("&Dialog...", M_TEST_DLG);
fMenuTest->AddEntry("&Message Box...", M_TEST_MSGBOX);
fMenuTest->AddEntry("&Sliders...", M_TEST_SLIDER);
fMenuTest->AddEntry("Sh&utter...", M_TEST_SHUTTER);
fMenuTest->AddEntry("&List Directory...", M_TEST_DIRLIST);
fMenuTest->AddEntry("&File List...", M_TEST_FILELIST);
fMenuTest->AddEntry("&Progress...", M_TEST_PROGRESS);
fMenuTest->AddEntry("&Number Entry...", M_TEST_NUMBERENTRY);
fMenuTest->AddEntry("F&ont Dialog...", M_TEST_FONTDIALOG);
fMenuTest->AddSeparator();
fMenuTest->AddEntry("Add New Menus", M_TEST_NEWMENU);
fMenuTest->AddSeparator();
fMenuTest->AddPopup("&Cascaded menus", fCascadeMenu);
fMenuView =
new TGPopupMenu(
gClient->GetRoot());
fMenuView->AddEntry("&Dock", M_VIEW_DOCK);
fMenuView->AddEntry("&Undock", M_VIEW_UNDOCK);
fMenuView->AddSeparator();
fMenuView->AddEntry("Enable U&ndock", M_VIEW_ENBL_DOCK);
fMenuView->AddEntry("Enable &Hide", M_VIEW_ENBL_HIDE);
fMenuView->DisableEntry(M_VIEW_DOCK);
fMenuDock->EnableUndock(
kTRUE);
fMenuDock->EnableHide(
kTRUE);
fMenuView->CheckEntry(M_VIEW_ENBL_DOCK);
fMenuView->CheckEntry(M_VIEW_ENBL_HIDE);
fMenuDock->Connect("Undocked()", "TestMainFrame", this, "HandleMenu(=M_VIEW_UNDOCK)");
fMenuHelp =
new TGPopupMenu(
gClient->GetRoot());
fMenuHelp->AddEntry("&Contents", M_HELP_CONTENTS);
fMenuHelp->AddEntry("&Search...", M_HELP_SEARCH);
fMenuHelp->AddSeparator();
fMenuHelp->AddEntry("&About", M_HELP_ABOUT);
fMenuNew1 = new TGPopupMenu();
fMenuNew1->AddEntry("Remove New Menus", M_NEW_REMOVEMENU);
fMenuNew2 = new TGPopupMenu();
fMenuNew2->AddEntry("Remove New Menus", M_NEW_REMOVEMENU);
fMenuFile->Connect("Activated(Int_t)", "TestMainFrame", this, "HandleMenu(Int_t)");
fMenuFile->Connect("PoppedUp()", "TestMainFrame", this, "HandlePopup()");
fMenuFile->Connect("PoppedDown()", "TestMainFrame", this, "HandlePopdown()");
fMenuTest->Connect("Activated(Int_t)", "TestMainFrame", this, "HandleMenu(Int_t)");
fMenuView->Connect("Activated(Int_t)", "TestMainFrame", this, "HandleMenu(Int_t)");
fMenuHelp->Connect("Activated(Int_t)", "TestMainFrame", this, "HandleMenu(Int_t)");
fCascadeMenu->Connect("Activated(Int_t)", "TestMainFrame", this, "HandleMenu(Int_t)");
fCascade1Menu->Connect("Activated(Int_t)", "TestMainFrame", this, "HandleMenu(Int_t)");
fCascade2Menu->Connect("Activated(Int_t)", "TestMainFrame", this, "HandleMenu(Int_t)");
fMenuNew1->Connect("Activated(Int_t)", "TestMainFrame", this, "HandleMenu(Int_t)");
fMenuNew2->Connect("Activated(Int_t)", "TestMainFrame", this, "HandleMenu(Int_t)");
fMenuBar->AddPopup("&File", fMenuFile, fMenuBarItemLayout);
fMenuBar->AddPopup("&Test", fMenuTest, fMenuBarItemLayout);
fMenuBar->AddPopup("&View", fMenuView, fMenuBarItemLayout);
fMenuBar->AddPopup("&Help", fMenuHelp, fMenuBarHelpLayout);
fMenuDock->AddFrame(fMenuBar, fMenuBarLayout);
fCanvasWindow = new TGCanvas(fMain, 400, 240);
fContainer = new TileFrame(fCanvasWindow->GetViewPort());
fContainer->SetCanvas(fCanvasWindow);
fCanvasWindow->SetContainer(fContainer->GetFrame());
for (int i = 0; i < 256; ++i)
fCanvasWindow->AddFrame(
new TGFrame(fCanvasWindow->GetContainer(), 32, 32, 0,
TColor::RGB2Pixel(0, 0, (i + 1) & 255)),
fTestButton = new TGTextButton(fStatusFrame, "&Open editor...", 150);
fTestButton->
Connect(
"Clicked()",
"TestMainFrame",
this,
"DoButton()");
fTestText = new TGTextEntry(fStatusFrame, new TGTextBuffer(100));
fTestText->SetToolTipText("This is a text entry widget");
fTestText->Resize(300, fTestText->GetDefaultHeight());
gClient->GetColorByName(
"yellow", yellow);
fColorSel = new TGColorSelect(fStatusFrame, yellow, 0);
fMain->SetWindowName("GuiTest Signal/Slots");
fMain->MapSubwindows();
fMain->Resize();
fMain->MapWindow();
fMain->Print();
Connect("Created()", "TestMainFrame", this, "Welcome()");
Created();
}
TestMainFrame::~TestMainFrame()
{
delete fMenuFile;
delete fMenuTest;
delete fMenuView;
delete fMenuHelp;
delete fCascadeMenu;
delete fCascade1Menu;
delete fCascade2Menu;
delete fMenuNew1;
delete fMenuNew2;
delete fContainer;
delete fMain;
}
void TestMainFrame::CloseWindow()
{
}
void TestMainFrame::DoButton()
{
Editor *ed = new Editor(fMain, 600, 400);
ed->LoadBuffer(editortxt1);
ed->AddBuffer(editortxt2);
ed->AddBuffer(editortxt3);
ed->AddBuffer(editortxt4);
ed->AddBuffer(editortxt5);
ed->AddBuffer(editortxt6);
ed->Popup();
}
void TestMainFrame::HandleMenu(
Int_t id)
{
switch (id) {
case M_FILE_OPEN: {
static TString dir(".");
TGFileInfo fi;
printf(
"fIniDir = %s\n", fi.
fIniDir);
} break;
case M_FILE_SAVE: printf("M_FILE_SAVE\n"); break;
case M_FILE_PRINT:
printf("M_FILE_PRINT\n");
printf("Hiding itself, select \"Print Setup...\" to enable again\n");
fMenuFile->HideEntry(M_FILE_PRINT);
break;
case M_FILE_PRINTSETUP:
printf("M_FILE_PRINTSETUP\n");
printf("Enabling \"Print\"\n");
fMenuFile->EnableEntry(M_FILE_PRINT);
break;
case M_FILE_EXIT:
CloseWindow();
break;
case M_TEST_DLG:
new TestDialog(
gClient->GetRoot(), fMain, 400, 200);
break;
case M_TEST_MSGBOX:
new TestMsgBox(
gClient->GetRoot(), fMain, 400, 200);
break;
case M_TEST_SLIDER:
new TestSliders(
gClient->GetRoot(), fMain, 400, 200);
break;
case M_TEST_SHUTTER:
new TestShutter(
gClient->GetRoot(), fMain, 400, 200);
break;
case M_TEST_DIRLIST:
new TestDirList(
gClient->GetRoot(), fMain, 400, 200);
break;
case M_TEST_FILELIST:
new TestFileList(
gClient->GetRoot(), fMain, 400, 200);
break;
case M_TEST_PROGRESS:
new TestProgress(
gClient->GetRoot(), fMain, 600, 300);
break;
case M_TEST_NUMBERENTRY:
new EntryTestDlg(
gClient->GetRoot(), fMain);
break;
case M_TEST_FONTDIALOG: {
TGFontDialog::FontProp_t prop;
new TGFontDialog(
gClient->GetRoot(), fMain, &prop);
printf(
"Selected font: %s, size %d, italic %s, bold %s, color 0x%lx, align %u\n", prop.
fName.
Data(),
} break;
case M_TEST_NEWMENU: {
if (fMenuTest->IsEntryChecked(M_TEST_NEWMENU)) {
HandleMenu(M_NEW_REMOVEMENU);
return;
}
fMenuTest->CheckEntry(M_TEST_NEWMENU);
TGPopupMenu *p = fMenuBar->GetPopup("Test");
fMenuBar->AddPopup("New 1", fMenuNew1, fMenuBarItemLayout, p);
p = fMenuBar->GetPopup("Help");
fMenuBar->
AddPopup(
"New 2", fMenuNew2, fMenuBarItemLayout, p);
fMenuBar->MapSubwindows();
fMenuBar->Layout();
TGMenuEntry *
e = fMenuTest->GetEntry(
"Add New Menus");
fMenuTest->AddEntry(
"Remove New Menus", M_NEW_REMOVEMENU,
nullptr,
nullptr,
e);
} break;
case M_NEW_REMOVEMENU: {
fMenuBar->RemovePopup("New 1");
fMenuBar->RemovePopup("New 2");
fMenuBar->Layout();
fMenuTest->DeleteEntry(M_NEW_REMOVEMENU);
fMenuTest->UnCheckEntry(M_TEST_NEWMENU);
} break;
case M_VIEW_ENBL_DOCK:
fMenuDock->EnableUndock(!fMenuDock->EnableUndock());
if (fMenuDock->EnableUndock()) {
fMenuView->CheckEntry(M_VIEW_ENBL_DOCK);
fMenuView->EnableEntry(M_VIEW_UNDOCK);
} else {
fMenuView->UnCheckEntry(M_VIEW_ENBL_DOCK);
fMenuView->DisableEntry(M_VIEW_UNDOCK);
}
break;
case M_VIEW_ENBL_HIDE:
fMenuDock->EnableHide(!fMenuDock->EnableHide());
if (fMenuDock->EnableHide()) {
fMenuView->CheckEntry(M_VIEW_ENBL_HIDE);
} else {
fMenuView->UnCheckEntry(M_VIEW_ENBL_HIDE);
}
break;
case M_VIEW_DOCK:
fMenuDock->DockContainer();
fMenuView->EnableEntry(M_VIEW_UNDOCK);
fMenuView->DisableEntry(M_VIEW_DOCK);
break;
case M_VIEW_UNDOCK:
fMenuDock->UndockContainer();
fMenuView->EnableEntry(M_VIEW_DOCK);
fMenuView->DisableEntry(M_VIEW_UNDOCK);
break;
default: printf("Menu item %d selected\n", id); break;
}
}
{
fMain =
new TGTransientFrame(p,
main, w,
h, options);
fMain->Connect("CloseWindow()", "TestDialog", this, "DoClose()");
fMain->DontCallClose();
fFrame1 =
new TGHorizontalFrame(fMain, 60, 20,
kFixedWidth);
fOkButton = new TGTextButton(fFrame1, "&Ok", 1);
fOkButton->
Connect(
"Clicked()",
"TestDialog",
this,
"DoOK()");
fCancelButton = new TGTextButton(fFrame1, "&Cancel", 2);
fCancelButton->
Connect(
"Clicked()",
"TestDialog",
this,
"DoCancel()");
fMain->AddFrame(fFrame1, fL2);
fTab = new TGTab(fMain, 300, 300);
fTab->
Connect(
"Selected(Int_t)",
"TestDialog",
this,
"DoTab(Int_t)");
TGCompositeFrame *tf = fTab->
AddTab(
"Tab 1");
fF1->
AddFrame(
new TGTextButton(fF1,
"&Test button", 0), fL3);
fF1->
AddFrame(fTxt1 =
new TGTextEntry(fF1,
new TGTextBuffer(100)), fL3);
fF1->
AddFrame(fTxt2 =
new TGTextEntry(fF1,
new TGTextBuffer(100)), fL3);
fF2->
AddFrame(fBtn1 =
new TGTextButton(fF2,
"&Button 1", 61), fL1);
fF2->
AddFrame(fBtn2 =
new TGTextButton(fF2,
"B&utton 2", 62), fL1);
fF2->
AddFrame(fChk1 =
new TGCheckButton(fF2,
"C&heck 1", 71), fL1);
fF2->
AddFrame(fChk2 =
new TGCheckButton(fF2,
"Chec&k 2", 72), fL1);
fF2->
AddFrame(fRad1 =
new TGRadioButton(fF2,
"&Radio 1", 81), fL1);
fF2->
AddFrame(fRad2 =
new TGRadioButton(fF2,
"R&adio 2", 82), fL1);
fCombo = new TGComboBox(fF2, 88);
int i;
char tmp[20];
for (i = 0; i < 20; i++) {
}
fBtn1->
Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
fBtn2->
Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
fChk1->
Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
fChk2->
Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
fRad1->
Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
fRad2->
Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
fHpx = nullptr;
fHpxpy = nullptr;
fStartB = new TGTextButton(fF3, "Start &Filling Hists", 40);
fStopB = new TGTextButton(fF3, "&Stop Filling Hists", 41);
fStartB->
Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
fStopB->
Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
fEc1 = new TRootEmbeddedCanvas("ec1", fF5, 100, 100);
fEc2 = new TRootEmbeddedCanvas("ec2", fF5, 100, 100);
fEc1->
GetCanvas()->
Connect(
"ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
"TestDialog",
this,
"HandleEmbeddedCanvas(Int_t,Int_t,Int_t,TObject*)");
gClient->GetColorByName(
"yellow", yellow);
TGTabElement *tabel = fTab->
GetTabTab(
"Tab 3");
TGTextButton *bt;
fF4->
AddFrame(bt =
new TGTextButton(fF4,
"A&dd Entry", 90), fL3);
bt->
Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
fF4->
AddFrame(bt =
new TGTextButton(fF4,
"Remove &Entry", 91), fL3);
bt->
Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
fF4->
AddFrame(fListBox =
new TGListBox(fF4, 89), fL3);
fF4->
AddFrame(fCheckMulti =
new TGCheckButton(fF4,
"&Mutli Selectable", 92), fL3);
fCheckMulti->
Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
for (i = 0; i < 20; ++i) {
}
fFirstEntry = 0;
fLastEntry = 20;
char buff[100];
int j;
for (j = 0; j < 4; j++) {
snprintf(buff, 100,
"Module %i", j + 1);
fF6->
AddFrame(
new TGLabel(fF6,
new TGHotString(buff)));
TGTextBuffer *tbuf = new TGTextBuffer(10);
TGTextEntry *tent = new TGTextEntry(fF6, tbuf);
tent->
SetFont(
"-adobe-courier-bold-r-*-*-14-*-*-*-*-*-iso8859-1");
}
fF7->
AddFrame(bt =
new TGTextButton(fF7,
"Remove Tab", 101));
bt->
Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
fF7->
AddFrame(bt =
new TGTextButton(fF7,
"Add Tab", 103));
bt->
Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
fF7->
AddFrame(bt =
new TGTextButton(fF7,
"Remove Tab 5", 102));
bt->
Connect(
"Clicked()",
"TestDialog",
this,
"HandleButtons()");
fMain->AddFrame(fTab, fL5);
fMain->MapSubwindows();
fMain->Resize();
fMain->CenterOnParent();
fMain->SetWindowName("Dialog");
fMain->MapWindow();
}
TestDialog::~TestDialog()
{
fMain->DeleteWindow();
}
void TestDialog::FillHistos()
{
if (!fHpx) {
fHpx = new TH1F("hpx", "This is the px distribution", 100, -4, 4);
fHpxpy = new TH2F("hpxpy", "py vs px", 40, -4, 4, 40, -4, 4);
}
float px, py;
while (fFillHistos) {
}
}
}
}
void TestDialog::DoClose()
{
printf("\nTerminating dialog: via window manager\n");
if (fFillHistos) {
} else
CloseWindow();
}
void TestDialog::CloseWindow()
{
delete this;
}
void TestDialog::DoOK()
{
printf("\nTerminating dialog: OK pressed\n");
}
void TestDialog::DoCancel()
{
printf("\nTerminating dialog: Cancel pressed\n");
}
void TestDialog::HandleButtons(
Int_t id)
{
if (id == -1) {
}
printf("DoButton: id = %d\n", id);
char tmp[20];
static int newtab = 0;
switch (id) {
case 40:
FillHistos();
break;
case 41:
break;
case 61:
break;
case 62:
break;
case 90:
fLastEntry++;
snprintf(tmp, 20,
"Entry %i", fLastEntry);
break;
case 91:
if (fFirstEntry <= fLastEntry) {
fFirstEntry++;
}
break;
case 101:
{
if ((s ==
"Tab 3") && (fMain->MustCleanup() !=
kDeepCleanup)) {
delete fEc1;
fEc1 = nullptr;
delete fEc2;
fEc2 = nullptr;
}
} break;
case 102:
{
for (int i = 0; i < nt; i++) {
if (s == "Tab 5") {
break;
}
}
} break;
case 103:
snprintf(tmp, 20,
"New Tab %d", ++newtab);
break;
default: break;
}
}
void TestDialog::DoTab(
Int_t id)
{
printf("Tab item %d activated\n", id);
}
{
printf(
"event = %d, x = %d, y = %d, obj = %s::%s\n", event,
x,
y, sel->
IsA()->
GetName(), sel->
GetName());
}
: fRedTextGC(TGButton::GetDefaultGC())
{
fMain->Connect("CloseWindow()", "TestMsgBox", this, "CloseWindow()");
fMain->DontCallClose();
gClient->GetColorByName(
"red", red);
int i;
fTestButton->
Connect(
"Clicked()",
"TestMsgBox",
this,
"DoTest()");
gClient->GetColorByName(
"green", green);
fCloseButton->
Connect(
"Clicked()",
"TestMsgBox",
this,
"DoClose()");
f1->AddFrame(fTestButton, fL1);
f1->AddFrame(fCloseButton, fL1);
f1->AddFrame(fPictButton, fL1);
fMain->AddFrame(
f1, fL21);
for (i = 0; i < 13; ++i)
for (i = 0; i < 4; ++i) {
fR[i]->
Connect(
"Clicked()",
"TestMsgBox",
this,
"DoRadio()");
}
fTbmsg->
AddText(0,
"This is a test message box.");
fMain->AddFrame(f2, fL2);
fMain->MapSubwindows();
fMain->Resize();
fMain->CenterOnParent();
fMain->SetWindowName("Message Box Test");
fMain->MapWindow();
}
TestMsgBox::~TestMsgBox()
{
fMain->DeleteWindow();
}
void TestMsgBox::CloseWindow()
{
delete this;
}
void TestMsgBox::DoClose()
{
CloseWindow();
}
void TestMsgBox::DoTest()
{
int i, buttons, retval;
buttons = 0;
for (i = 0; i < 13; i++)
buttons |= mb_button_id[i];
for (i = 0; i < 4; i++)
icontype = mb_icon[i];
break;
}
fMain->Disconnect("CloseWindow()");
fMain->Connect("CloseWindow()", "TestMsgBox", this, "TryToClose()");
fMain->Disconnect("CloseWindow()");
fMain->Connect("CloseWindow()", "TestMsgBox", this, "CloseWindow()");
}
void TestMsgBox::TryToClose()
{
printf("Can't close the window '%s' : a message box is still open\n", fMain->GetWindowName());
}
void TestMsgBox::DoRadio()
{
if (id >= 21 && id <= 24) {
for (int i = 0; i < 4; i++)
if (fR[i]->WidgetId() != id)
}
}
{
fMain->Connect("CloseWindow()", "TestSliders", this, "CloseWindow()");
fMain->DontCallClose();
fTeh1->
Connect(
"TextChanged(char*)",
"TestSliders",
this,
"DoText(char*)");
fTev1->
Connect(
"TextChanged(char*)",
"TestSliders",
this,
"DoText(char*)");
fHslider1->
Connect(
"PositionChanged(Int_t)",
"TestSliders",
this,
"DoSlider(Int_t)");
fVslider1->
Connect(
"PositionChanged(Int_t)",
"TestSliders",
this,
"DoSlider(Int_t)");
fTeh2->
Connect(
"TextChanged(char*)",
"TestSliders",
this,
"DoText(char*)");
fTev2->
Connect(
"TextChanged(char*)",
"TestSliders",
this,
"DoText(char*)");
fHslider2->
Connect(
"PositionChanged(Int_t)",
"TestSliders",
this,
"DoSlider(Int_t)");
fVslider2->
Connect(
"PositionChanged()",
"TestSliders",
this,
"DoSlider()");
fMain->AddFrame(fVframe2, fBfly1);
fMain->AddFrame(fVframe1, fBfly1);
fMain->SetWindowName("Slider Test");
fMain->SetWMSize(
size.fWidth,
size.fHeight);
fMain->SetWMSizeHints(
size.fWidth,
size.fHeight,
size.fWidth,
size.fHeight, 0, 0);
fMain->CenterOnParent();
fMain->MapSubwindows();
fMain->MapWindow();
}
TestSliders::~TestSliders()
{
fMain->DeleteWindow();
}
void TestSliders::CloseWindow()
{
delete this;
}
void TestSliders::DoText(const char * )
{
switch (id) {
default: break;
}
}
void TestSliders::DoSlider(
Int_t pos)
{
} else {
}
char buf[32];
#ifdef CINT_FIXED
switch (id) {
case HSId1:
#else
if (id == HSId1) {
#endif
#ifdef CINT_FIXED
break;
case VSId1:
#else
} else if (id == VSId1) {
#endif
#ifdef CINT_FIXED
break;
case HSId2:
#else
} else if (id == HSId2) {
#endif
#ifdef CINT_FIXED
break;
case VSId2:
#else
} else if (id == VSId2) {
#endif
#ifdef CINT_FIXED
break;
default: break;
#endif
}
}
{
fMain->Connect("CloseWindow()", "TestShutter", this, "CloseWindow()");
fMain->DontCallClose();
fDefaultPic =
gClient->GetPicture(
"folder_s.xpm");
AddShutterItem("Histograms", histo_data);
AddShutterItem("Functions", function_data);
AddShutterItem("Trees", tree_data);
fMain->AddFrame(fShutter, fLayout);
fMain->MapSubwindows();
fMain->Resize(80, 300);
fMain->CenterOnParent();
fMain->SetWindowName("Shutter Test");
fMain->MapWindow();
}
void TestShutter::AddShutterItem(
const char *
name, shutterData_t *data)
{
static int id = 5001;
for (int i = 0; data[i].pixmap_name != nullptr; i++) {
buttonpic =
gClient->GetPicture(data[i].pixmap_name);
if (!buttonpic) {
printf("<TestShutter::AddShutterItem>: missing pixmap \"%s\", using default", data[i].pixmap_name);
buttonpic = fDefaultPic;
}
button->
Connect(
"Clicked()",
"TestShutter",
this,
"HandleButtons()");
data[i].button = button;
}
}
TestShutter::~TestShutter()
{
fMain->DeleteWindow();
}
void TestShutter::CloseWindow()
{
delete this;
}
void TestShutter::HandleButtons()
{
printf(
"Shutter button %d\n", btn->
WidgetId());
}
{
fMain->Connect("CloseWindow()", "TestDirList", this, "CloseWindow()");
fMain->DontCallClose();
fIcon =
gClient->GetPicture(
"rootdb_t.xpm");
fMain->AddFrame(canvas, lo);
fContents->
Connect(
"DoubleClicked(TGListTreeItem*,Int_t)",
"TestDirList",
this,
"OnDoubleClick(TGListTreeItem*,Int_t)");
fContents->
Connect(
"Clicked(TGListTreeItem*,Int_t)",
"TestDirList",
this,
"OnDoubleClick(TGListTreeItem*,Int_t)");
#ifdef R__WIN32
#else
#endif
fMain->CenterOnParent();
fMain->SetWindowName("List Dir Test");
fMain->MapSubwindows();
fMain->Resize();
fMain->MapWindow();
}
TestDirList::~TestDirList()
{
delete fContents;
}
void TestDirList::CloseWindow()
{
delete this;
}
{
item = parent;
}
return dirname;
}
{
return;
TList *files = dir.GetListOfFiles();
if (files) {
if ((fname != "..") && (fname != ".")) {
}
fContents->
AddItem(item, fname, fIcon, fIcon);
}
}
delete files;
}
}
{
fMain->Connect("CloseWindow()", "TestDirList", this, "CloseWindow()");
fMain->DontCallClose();
fMain->AddFrame(mb, lo);
fMenu->AddSeparator();
fMenu->AddEntry("&Close", 10);
fMenu->Connect("Activated(Int_t)", "TestFileList", this, "DoMenu(Int_t)");
gClient->GetColorByName(
"white", white);
fContents->
Connect(
"DoubleClicked(TGFrame*,Int_t)",
"TestFileList",
this,
"OnDoubleClick(TGLVEntry*,Int_t)");
fMain->CenterOnParent();
fMain->SetWindowName("File List Test");
fMain->MapSubwindows();
fMain->MapWindow();
fContents->SetDefaultHeaders();
fContents->DisplayDirectory();
fContents->AddFile("..");
fContents->StopRefreshTimer();
}
TestFileList::~TestFileList()
{
delete fContents;
}
void TestFileList::DoMenu(
Int_t mode)
{
if (mode < 10) {
} else {
delete this;
}
}
void TestFileList::DisplayFile(
const TString &fname)
{
fContents->AddFile(
gSystem->WorkingDirectory());
fContents->SetColHeaders("Name", "Title");
TIter next(file.GetListOfKeys());
while ((key = (
TKey *)next())) {
}
fMain->Resize();
}
void TestFileList::DisplayDirectory(
const TString &fname)
{
fContents->SetDefaultHeaders();
fContents->ChangeDirectory(fname);
fContents->DisplayDirectory();
fContents->AddFile("..");
}
{
static TFile *file =
nullptr;
if (file)
delete file;
if (obj) {
} else
}
}
{
return;
const char *fname = (
const char *)
f->GetUserData();
if (fname) {
DisplayObject(fname,
name);
}
else if (
name.EndsWith(
".root")) {
} else {
}
}
void TestFileList::CloseWindow()
{
delete this;
}
{
fMain->Connect("CloseWindow()", "TestProgress", this, "DoClose()");
fMain->DontCallClose();
fVProg1->SetBarColor("purple");
fVProg2->SetBarColor("green");
fHframe1->Resize(300, 300);
fHProg1->ShowPosition();
fHProg2->SetBarColor("lightblue");
fGO->Connect("Clicked()", "TestProgress", this, "DoGo()");
fHframe1->AddFrame(fVProg1, fHint1);
fHframe1->AddFrame(fVProg2, fHint1);
fMain->AddFrame(fHframe1, fHint4);
fMain->AddFrame(fVframe1, fHint5);
fMain->SetWindowName("Progress Test");
fMain->CenterOnParent();
fMain->MapSubwindows();
fMain->MapWindow();
}
TestProgress::~TestProgress()
{
fMain->DeleteWindow();
}
void TestProgress::CloseWindow()
{
delete this;
}
void TestProgress::DoClose()
{
if (fClose)
CloseWindow();
else {
}
}
void TestProgress::DoGo()
{
fVProg1->Reset();
fVProg2->Reset();
fHProg1->Reset();
fHProg2->Reset();
fHProg3->Reset();
fVProg2->SetBarColor("green");
int cnt1 = 0, cnt2 = 0, cnt3 = 0, cnt4 = 0;
int inc1 = 4, inc2 = 3, inc3 = 2, inc4 = 1;
while (cnt1 < 100 || cnt2 < 100 || cnt3 < 100 || cnt4 < 100) {
if (cnt1 < 100) {
cnt1 += inc1;
fVProg1->Increment(inc1);
}
if (cnt2 < 100) {
cnt2 += inc2;
fVProg2->Increment(inc2);
if (cnt2 > 75)
fVProg2->SetBarColor("red");
}
if (cnt3 < 100) {
cnt3 += inc3;
fHProg1->Increment(inc3);
}
if (cnt4 < 100) {
cnt4 += inc4;
fHProg2->Increment(inc4);
fHProg3->Increment(inc4);
}
if (fClose)
return;
}
}
const char *numlabel[] = {
"Integer", "One digit real", "Two digit real", "Three digit real", "Four digit real", "Real", "Degree.min.sec",
"Min:sec", "Hour:min", "Hour:min:sec", "Day/month/year", "Month/day/year", "Hex"};
1.0,
1.00,
1.000,
1.0000,
1.2E-12,
90 * 3600,
120 * 60,
12 * 60,
12 * 3600 + 15 * 60,
19991121,
19991121,
{
fMain->Connect("CloseWindow()", "EntryTestDlg", this, "CloseWindow()");
fMain->DontCallClose();
TGFont *myfont =
gClient->GetFont(
"-adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-iso8859-1");
if (myfont)
fMain->AddFrame(fF1, fL1);
for (int i = 0; i < 13; i++) {
fF[i]->AddFrame(fNumericEntries[i], fL2);
fF[i]->AddFrame(fLabel[i], fL2);
}
fMain->AddFrame(fF2, fL3);
fLimits[0]->SetLogStep(
kFALSE);
fLimits[1]->SetLogStep(
kFALSE);
fSetButton->Connect("Clicked()", "EntryTestDlg", this, "SetLimits()");
fExitButton->Connect("Clicked()", "EntryTestDlg", this, "DoOK()");
fMain->SetWindowName("Number Entry Test");
fMain->SetIconName("Number Entry Test");
fMain->SetClassHints("NumberEntryDlg", "NumberEntryDlg");
fMain->MapSubwindows();
UInt_t width = fMain->GetDefaultWidth();
UInt_t height = fMain->GetDefaultHeight();
fMain->Resize(width, height);
fMain->CenterOnParent();
fMain->SetWMSize(width, height);
fMain->SetWMSizeHints(width, height, width, height, 0, 0);
fMain->MapWindow();
}
EntryTestDlg::~EntryTestDlg()
{
fMain->DeleteWindow();
}
void EntryTestDlg::CloseWindow()
{
delete this;
}
void EntryTestDlg::DoOK()
{
fMain->SendCloseMessage();
}
void EntryTestDlg::SetLimits()
{
if (low && high) {
} else if (low) {
} else if (high) {
} else {
}
if (pos) {
} else if (nneg) {
} else {
}
for (int i = 0; i < 13; i++) {
fNumericEntries[i]->SetFormat(fNumericEntries[i]->GetNumStyle(), attr);
fNumericEntries[i]->SetLimits(lim, min, max);
}
}
{
fMain->Connect("CloseWindow()", "Editor", this, "CloseWindow()");
fMain->DontCallClose();
fMain->AddFrame(fEdit, fL1);
fEdit->Connect("Opened()", "Editor", this, "DoOpen()");
fEdit->Connect("Saved()", "Editor", this, "DoSave()");
fEdit->Connect("Closed()", "Editor", this, "DoClose()");
gClient->GetColorByName(
"#3399ff", pxl);
fEdit->SetSelectBack(pxl);
fOK->Connect("Clicked()", "Editor", this, "DoOK()");
fMain->AddFrame(fOK, fL2);
SetTitle();
fMain->MapSubwindows();
fMain->Resize();
}
Editor::~Editor()
{
fMain->DeleteWindow();
}
void Editor::SetTitle()
{
TGText *txt = GetEditor()->GetText();
char title[256];
if (untitled)
snprintf(title, 256,
"ROOT Editor - Untitled");
else
fMain->SetWindowName(title);
fMain->SetIconName(title);
}
void Editor::Popup()
{
fMain->MapWindow();
}
void Editor::LoadBuffer(const char *buffer)
{
fEdit->LoadBuffer(buffer);
}
void Editor::LoadFile(const char *file)
{
fEdit->LoadFile(file);
}
void Editor::AddBuffer(const char *buffer)
{
fEdit->AddText(&txt);
}
void Editor::CloseWindow()
{
delete this;
}
void Editor::DoOK()
{
CloseWindow();
}
void Editor::DoOpen()
{
SetTitle();
}
void Editor::DoSave()
{
SetTitle();
}
void Editor::DoClose()
{
CloseWindow();
}
void guitest()
{
new TestMainFrame(
gClient->GetRoot(), 400, 220);
}
#ifdef STANDALONE
int main(
int argc,
char **argv)
{
fprintf(stderr, "%s: cannot run in batch mode\n", argv[0]);
return 1;
}
guitest();
theApp.Run();
return 0;
}
#endif
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
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
externTApplication * gApplication
char * StrDup(const char *str)
Duplicate the string str.
This class creates the ROOT Application Environment that interfaces to the windowing system eventloop...
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
static ULong_t RGB2Pixel(Int_t r, Int_t g, Int_t b)
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.
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 SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
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.
DoubleSlider widgets allow easy selection of a min and a max value out of a range.
virtual Float_t GetMinPosition() const
virtual void SetRange(Float_t min, Float_t max)
virtual void SetPosition(Float_t min, Float_t max)
Dragging the slider will generate the event:
char * fFilename
selected file name
const char ** fFileTypes
file types used to filter selectable files
char * fIniDir
on input: initial directory, on output: new directory
void SetIniDir(const char *inidir)
Set directory name.
Encapsulate fonts used in the GUI system.
FontStruct_t GetFontStruct() const
FontH_t GetFontHandle() const
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 GetDefaultWidth() const
virtual UInt_t GetDefaultHeight() const
TClass * IsA() const override
virtual void DeleteWindow()
Delete window.
virtual void ChangeBackground(Pixel_t back)
Change frame background color.
Encapsulate a graphics context used in the low level graphics.
void SetFont(FontH_t v)
Set font.
void SetForeground(Pixel_t v)
Set foreground color.
A composite frame with a border and a title.
TGDimension GetDefaultSize() const override
Returns default size.
virtual void SetTitlePos(ETitlePos pos=kLeft)
Concrete class for horizontal slider.
A composite frame that layout their children in horizontal way.
TGHotString is a string with a "hot" character underlined.
virtual void SetSubnames(const char *n1="", const char *n2="", const char *n3="", const char *n4="", const char *n5="", const char *n6="", const char *n7="", const char *n8="", const char *n9="", const char *n10="", const char *n11="", const char *n12="")
Sets new subnames.
void SetUserData(void *userData)
This class handles GUI labels.
This class describes layout hints used by the layout classes.
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.
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.
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.
virtual void SetPosition(Int_t pos)
Set slider position.
virtual void SetRange(Int_t min, Int_t max)
Set slider range.
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
const char * GetString() const
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.
void AddText(Int_t pos, const char *text)
const char * GetString() const
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.
Int_t GetCursorPosition() const
void Deselect()
Deselects all text (i.e.
virtual void SetCursorPosition(Int_t pos)
Set the cursor position to newPos.
virtual void SetFont(TGFont *font, Bool_t local=kTRUE)
Changes text font specified by pointer to TGFont object.
A TGText is a multi line text buffer.
Bool_t LoadBuffer(const char *txtbuf)
Load a 0 terminated buffer. Lines will be split at ' '.
const char * GetFileName() const
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.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
void Draw(Option_t *option="") override
Draw this histogram with options.
Int_t Fill(Double_t) override
Invalid Fill method.
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 const char * GetName() const
Returns name of object.
virtual void Browse(TBrowser *b)
Browse object. May be overridden for another default action.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual TClass * IsA() const
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
void SetBorderMode(Short_t bordermode) override
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.
TCanvas * GetCanvas() const
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
const char * Data() const
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.
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.
int main(int argc, char **argv)
__device__ AFloat max(AFloat x, AFloat y)
EGEventType fType
of event (see EGEventType)
UInt_t fCode
key or button code
Bool_t fItalic
italic flag
UInt_t fAlign
text alignment