[Thplot-cvs] CVS: thplot/src/Gui MainWindow.cpp,1.2,1.3 MainWindow.h,1.1.1.1,1.2
Status: Pre-Alpha
Brought to you by:
apeden
From: Tony P. <ap...@us...> - 2002-07-03 13:33:00
|
Update of /cvsroot/thplot/thplot/src/Gui In directory usw-pr-cvs1:/tmp/cvs-serv27319/src/Gui Modified Files: MainWindow.cpp MainWindow.h Log Message: Temporary fix for directory open bug, open parameter select dialog automatically after a file is opened. Index: MainWindow.cpp =================================================================== RCS file: /cvsroot/thplot/thplot/src/Gui/MainWindow.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** MainWindow.cpp 2 Jul 2002 17:20:42 -0000 1.2 --- MainWindow.cpp 3 Jul 2002 13:32:56 -0000 1.3 *************** *** 28,33 **** --- 28,37 ---- #include <iostream> + #include <FL/filename.H> + #include <Gui/MainWindow.h> + + MainWindow::MainWindow(Globals *g, int argc, char **argv) { global=g; *************** *** 68,91 **** while(flc->shown()) Fl::wait(); if(flc->value()){ ! glw->getPlot()->getGrid(0)->clearData(); ! delete csvdata; ! csvdata = new csvData(global,flc->value()); } } void MainWindow::param_select_cb(Fl_Widget* flw) { ! //cout << data << endl; ! if(csvdata) { ! ps = new ParameterSelect(global); ! ps->showDialog(csvdata); ! if( ps->selectionAvailable() ) { ! cout << "Calling setData()" << endl; ! glw->getPlot()->getGrid(0)->setData(csvdata, ! ps->getSelectedIndependent(), ! ps->getSelectedDependents() ); ! Fl::redraw(); ! } ! delete ps; ! } } --- 72,86 ---- while(flc->shown()) Fl::wait(); if(flc->value()){ ! if( fl_filename_match( flc->value(),"*.csv") ) { ! glw->getPlot()->getGrid(0)->clearData(); ! delete csvdata; ! csvdata = new csvData(global,flc->value()); ! doParameterSelect(); ! } } } void MainWindow::param_select_cb(Fl_Widget* flw) { ! doParameterSelect(); } *************** *** 112,113 **** --- 107,122 ---- } + void MainWindow::doParameterSelect(void){ + if(csvdata) { + ps = new ParameterSelect(global); + ps->showDialog(csvdata); + if( ps->selectionAvailable() ) { + cout << "Calling setData()" << endl; + glw->getPlot()->getGrid(0)->setData(csvdata, + ps->getSelectedIndependent(), + ps->getSelectedDependents() ); + Fl::redraw(); + } + delete ps; + } + } Index: MainWindow.h =================================================================== RCS file: /cvsroot/thplot/thplot/src/Gui/MainWindow.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** MainWindow.h 22 Jun 2002 11:57:08 -0000 1.1.1.1 --- MainWindow.h 3 Jul 2002 13:32:57 -0000 1.2 *************** *** 73,76 **** --- 73,77 ---- void defineMenu(void); + void doParameterSelect(void); }; |