diff --git a/src/guidict/EVBMainFrame.cpp b/src/guidict/EVBMainFrame.cpp index ce66898..d43a82f 100644 --- a/src/guidict/EVBMainFrame.cpp +++ b/src/guidict/EVBMainFrame.cpp @@ -11,6 +11,8 @@ EVBMainFrame::EVBMainFrame(const TGWindow* p, UInt_t w, UInt_t h) : SetCleanup(kDeepCleanup); MAIN_W = w; MAIN_H = h; + fInfo = new TGFileInfo(); + //Organization hints TGLayoutHints *fchints = new TGLayoutHints(kLHintsExpandX|kLHintsExpandY,5,5,5,5); TGLayoutHints *fhints = new TGLayoutHints(kLHintsExpandX|kLHintsCenterY,5,5,5,5); @@ -131,6 +133,7 @@ EVBMainFrame::EVBMainFrame(const TGWindow* p, UInt_t w, UInt_t h) : EVBMainFrame::~EVBMainFrame() { Cleanup(); + delete fInfo; delete this; } @@ -142,9 +145,17 @@ void EVBMainFrame::CloseWindow() void EVBMainFrame::HandleMenuSelection(int id) { if(id == M_SAVE_CONFIG) - new FileViewFrame(gClient->GetRoot(), this, MAIN_W*0.5, MAIN_H*0.25, this, M_SAVE_CONFIG); + { + new TGFileDialog(gClient->GetRoot(), this, kFDOpen, fInfo); + if(fInfo->fFilename) + SaveConfig(fInfo->fFilename); + } else if(id == M_LOAD_CONFIG) - new FileViewFrame(gClient->GetRoot(), this, MAIN_W*0.5, MAIN_H*0.25, this, M_LOAD_CONFIG); + { + new TGFileDialog(gClient->GetRoot(), this, kFDOpen, fInfo); + if(fInfo->fFilename) + LoadConfig(fInfo->fFilename); + } else if(id == M_EXIT) CloseWindow(); } @@ -156,12 +167,16 @@ void EVBMainFrame::DoOpenWorkdir() void EVBMainFrame::DoOpenSMapfile() { - new FileViewFrame(gClient->GetRoot(), this, MAIN_W*0.5, MAIN_H*0.25, this, SMAP); + new TGFileDialog(gClient->GetRoot(), this, kFDOpen, fInfo); + if(fInfo->fFilename) + DisplaySMap(fInfo->fFilename); } void EVBMainFrame::DoOpenScalerfile() { - new FileViewFrame(gClient->GetRoot(), this, MAIN_W*0.5, MAIN_H*0.25, this, SCALER); + new TGFileDialog(gClient->GetRoot(), this, kFDOpen, fInfo); + if(fInfo->fFilename) + DisplayScaler(fInfo->fFilename); } void EVBMainFrame::DoRun() diff --git a/src/guidict/EVBMainFrame.h b/src/guidict/EVBMainFrame.h index ac12aab..0196ae4 100644 --- a/src/guidict/EVBMainFrame.h +++ b/src/guidict/EVBMainFrame.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include "../evb/EVBApp.h" @@ -72,6 +73,8 @@ private: TGPopupMenu *fFileMenu; + TGFileInfo *fInfo; + EventBuilder::EVBApp fBuilder; int counter; diff --git a/src/guidict/FileViewFrame.cpp b/src/guidict/FileViewFrame.cpp index 9555a58..56faba3 100644 --- a/src/guidict/FileViewFrame.cpp +++ b/src/guidict/FileViewFrame.cpp @@ -29,7 +29,7 @@ FileViewFrame::FileViewFrame(const TGWindow* p, const TGFrame* main, UInt_t w, U /*Layout orgainization hints*/ TGLayoutHints *fhints = new TGLayoutHints(kLHintsCenterX|kLHintsCenterY,5,5,5,5); - TGLayoutHints *thints = new TGLayoutHints(kLHintsExpandX|kLHintsCenterY,5,5,5,5); + TGLayoutHints *thints = new TGLayoutHints(kLHintsExpandX|kLHintsBottom,5,5,5,5); TGLayoutHints *fchints = new TGLayoutHints(kLHintsExpandX|kLHintsExpandY,5,5,5,5); TGLayoutHints *lhints = new TGLayoutHints(kLHintsLeft|kLHintsTop,5,5,5,5); TGLayoutHints *fbhints = new TGLayoutHints(kLHintsCenterX|kLHintsBottom,5,5,5,5);