|
Stimfit 0.12.7
|
00001 // This program is free software; you can redistribute it and/or 00002 // modify it under the terms of the GNU General Public License 00003 // as published by the Free Software Foundation; either version 2 00004 // of the License, or (at your option) any later version. 00005 00006 // This program is distributed in the hope that it will be useful, 00007 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00008 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00009 // GNU General Public License for more details. 00010 00011 // You should have received a copy of the GNU General Public License 00012 // along with this program; if not, write to the Free Software 00013 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00014 00021 #ifndef _SMALLDLGS_H 00022 #define _SMALLDLGS_H 00023 00028 #include <wx/dirctrl.h> 00029 #include <wx/filename.h> 00030 #include <vector> 00031 #include "./../../stf.h" 00032 00034 class wxStfFileInfoDlg : public wxDialog 00035 { 00036 DECLARE_EVENT_TABLE() 00037 00038 private: 00039 wxStdDialogButtonSizer* m_sdbSizer; 00040 00041 public: 00043 00053 wxStfFileInfoDlg( 00054 wxWindow* parent, 00055 const std::string& szGeneral, 00056 const std::string& szFile, 00057 const std::string& szSection, 00058 int id = wxID_ANY, 00059 wxString title = wxT("File information"), 00060 wxPoint pos = wxDefaultPosition, 00061 wxSize size = wxDefaultSize, 00062 int style = wxCAPTION 00063 ); 00064 00065 }; 00066 00068 class wxStfChannelSelDlg : public wxDialog 00069 { 00070 DECLARE_EVENT_TABLE() 00071 00072 private: 00073 int m_selChannel1, m_selChannel2; 00074 wxStdDialogButtonSizer* m_sdbSizer; 00075 wxComboBox *m_comboBoxCh1,*m_comboBoxCh2; 00076 00077 void OnComboCh1( wxCommandEvent& event ); 00078 void OnComboCh2( wxCommandEvent& event ); 00079 00081 00083 bool OnOK(); 00084 00085 public: 00087 00095 wxStfChannelSelDlg( 00096 wxWindow* parent, 00097 const std::vector<wxString>& channelNames= 00098 std::vector<wxString>(0), 00099 int id = wxID_ANY, 00100 wxString title = wxT("Select channels"), 00101 wxPoint pos = wxDefaultPosition, 00102 wxSize size = wxDefaultSize, 00103 int style = wxCAPTION 00104 ); 00105 00107 00110 virtual void EndModal(int retCode); 00111 00113 00115 int GetSelCh1() const {return m_selChannel1;} 00116 00118 00120 int GetSelCh2() const {return m_selChannel2;} 00121 }; 00122 00124 class wxStfAlignDlg : public wxDialog 00125 { 00126 DECLARE_EVENT_TABLE() 00127 00128 private: 00129 bool m_alignRise; 00130 wxRadioBox* m_radioBox; 00131 wxStdDialogButtonSizer* m_sdbSizer; 00132 00134 00136 bool OnOK(); 00137 00138 public: 00140 00147 wxStfAlignDlg( 00148 wxWindow* parent, 00149 int id = wxID_ANY, 00150 wxString title = wxT("Alignment mode"), 00151 wxPoint pos = wxDefaultPosition, 00152 wxSize size = wxDefaultSize, 00153 int style = wxCAPTION 00154 ); 00155 00157 00160 bool AlignRise() const {return m_alignRise;} 00161 00163 00166 virtual void EndModal(int retCode); 00167 }; 00168 00170 class wxStfFilterSelDlg : public wxDialog 00171 { 00172 DECLARE_EVENT_TABLE() 00173 00174 private: 00175 int m_filterSelect; 00176 wxRadioBox* m_radioBox; 00177 wxStdDialogButtonSizer* m_sdbSizer; 00178 00180 00182 bool OnOK(); 00183 00184 public: 00186 00193 wxStfFilterSelDlg( 00194 wxWindow* parent, 00195 int id = wxID_ANY, 00196 wxString title = wxT("Filter function"), 00197 wxPoint pos = wxDefaultPosition, 00198 wxSize size = wxDefaultSize, 00199 int style = wxCAPTION 00200 ); 00201 00203 00205 int GetFilterSelect() const {return m_filterSelect;} 00206 00208 00211 virtual void EndModal(int retCode); 00212 }; 00213 00215 class wxStfTransformDlg : public wxDialog 00216 { 00217 DECLARE_EVENT_TABLE() 00218 00219 private: 00220 int m_fSelect; 00221 wxRadioBox* m_radioBox; 00222 wxStdDialogButtonSizer* m_sdbSizer; 00223 00225 00227 bool OnOK(); 00228 00229 public: 00231 00238 wxStfTransformDlg( 00239 wxWindow* parent, 00240 int id = wxID_ANY, 00241 wxString title = wxT("Choose function"), 00242 wxPoint pos = wxDefaultPosition, 00243 wxSize size = wxDefaultSize, 00244 int style = wxCAPTION 00245 ); 00246 00248 00250 int GetFSelect() const {return m_fSelect;} 00251 00253 00256 virtual void EndModal(int retCode); 00257 }; 00258 00260 class wxStfFitInfoDlg : public wxDialog 00261 { 00262 DECLARE_EVENT_TABLE() 00263 00264 private: 00265 wxStdDialogButtonSizer* m_sdbSizer; 00266 00267 public: 00269 00277 wxStfFitInfoDlg( 00278 wxWindow* parent, 00279 const wxString& info, 00280 int id = wxID_ANY, 00281 wxString title = wxT("Fit information"), 00282 wxPoint pos = wxDefaultPosition, 00283 wxSize size = wxDefaultSize, 00284 int style = wxCAPTION 00285 ); 00286 }; 00287 00289 struct BatchOption { 00291 BatchOption( ) : label( wxT("\0") ), selection(false), index(-1) {} 00292 00297 BatchOption(const wxString& lab, bool sel, int id) : label(lab), selection(sel), index(id) {} 00298 00299 wxString label; 00300 bool selection; 00301 int index; 00302 }; 00303 00305 class wxStfBatchDlg : public wxDialog 00306 { 00307 DECLARE_EVENT_TABLE() 00308 00309 private: 00310 std::vector<BatchOption> batchOptions; 00311 00312 wxCheckListBox* m_checkList; 00313 wxStdDialogButtonSizer* m_sdbSizer; 00314 00316 00318 bool OnOK(); 00319 BatchOption LookUp( int index ) const; 00320 00321 enum { 00322 id_base=0, 00323 id_basesd, 00324 id_threshold, 00325 id_peakzero, 00326 id_peakbase, 00327 id_peakthreshold, 00328 id_rtLoHi, 00329 id_t50, 00330 id_slopes, 00331 id_latencies, 00332 id_fit, 00333 #ifdef WITH_PSLOPE 00334 id_pslopes, 00335 #endif 00336 id_crossings 00337 }; 00338 00339 public: 00341 00348 wxStfBatchDlg( 00349 wxWindow* parent, 00350 int id = wxID_ANY, 00351 wxString title = wxT("Choose values"), 00352 wxPoint pos = wxDefaultPosition, 00353 wxSize size = wxDefaultSize, 00354 int style = wxCAPTION 00355 ); 00356 00358 00360 bool PrintBase() const {return LookUp(id_base).selection;} 00361 00363 00365 bool PrintBaseSD() const {return LookUp(id_basesd).selection;} 00366 00368 00370 bool PrintThreshold() const {return LookUp(id_threshold).selection;} 00371 00373 00375 bool PrintPeakZero() const {return LookUp(id_peakzero).selection;} 00376 00378 00380 bool PrintPeakBase() const {return LookUp(id_peakbase).selection;} 00381 00383 00385 bool PrintPeakThreshold() const {return LookUp(id_peakthreshold).selection;} 00386 00388 00390 bool PrintRTLoHi() const {return LookUp(id_rtLoHi).selection;} 00391 00393 00395 bool PrintT50() const {return LookUp(id_t50).selection;} 00396 00398 00400 bool PrintSlopes() const {return LookUp(id_slopes).selection;} 00401 00402 #ifdef WITH_PSLOPE 00403 00404 00406 bool PrintPSlopes() const {return LookUp(id_pslopes).selection;} 00407 #endif 00408 00410 00412 bool PrintThr() const {return LookUp(id_crossings).selection;} 00413 00415 00417 bool PrintLatencies() const {return LookUp(id_latencies).selection;} 00418 00420 00422 bool PrintFitResults() const {return LookUp(id_fit).selection;} 00423 00425 00428 virtual void EndModal(int retCode); 00429 }; 00430 00432 class wxStfPreprintDlg : public wxDialog 00433 { 00434 DECLARE_EVENT_TABLE() 00435 00436 private: 00437 bool m_gimmicks,m_isFile; 00438 int m_downsampling; 00439 wxStdDialogButtonSizer* m_sdbSizer; 00440 wxCheckBox* m_checkBox; 00441 wxTextCtrl* m_textCtrl; 00442 00444 00446 bool OnOK(); 00447 00448 public: 00450 00458 wxStfPreprintDlg( 00459 wxWindow* parent, 00460 bool isFile=false, 00461 int id = wxID_ANY, 00462 wxString title = wxT("Settings"), 00463 wxPoint pos = wxDefaultPosition, 00464 wxSize size = wxDefaultSize, 00465 int style = wxCAPTION 00466 ); 00467 00469 00471 bool GetGimmicks() const {return m_gimmicks;} 00472 00474 00476 int GetDownSampling() const {return m_downsampling;} 00477 00479 00482 virtual void EndModal(int retCode); 00483 }; 00484 00486 class wxStfGaussianDlg : public wxDialog 00487 { 00488 DECLARE_EVENT_TABLE() 00489 00490 private: 00491 double m_width; 00492 double m_center; 00493 double m_amp; 00494 wxStdDialogButtonSizer* m_sdbSizer; 00495 wxSlider* m_slider; 00496 wxTextCtrl *m_textCtrlCenter, *m_textCtrlWidth; 00497 00499 00501 bool OnOK(); 00502 00503 public: 00505 00512 wxStfGaussianDlg( 00513 wxWindow* parent, 00514 int id = wxID_ANY, 00515 wxString title = wxT("Settings for Gaussian function"), 00516 wxPoint pos = wxDefaultPosition, 00517 wxSize size = wxDefaultSize, 00518 int style = wxCAPTION 00519 ); 00520 00522 00524 double Width() const {return m_width;} 00525 00527 00529 double Center() const {return m_center;} 00530 00532 00534 double Amp() const {return m_amp;} 00535 00537 00540 virtual void EndModal(int retCode); 00541 }; 00542 00544 class wxStfTextImportDlg : public wxDialog 00545 { 00546 DECLARE_EVENT_TABLE() 00547 00548 private: 00549 int m_hLines; 00550 bool m_toSection; 00551 bool m_firstIsTime; 00552 bool m_isSeries; 00553 int m_ncolumns; 00554 double m_sr; 00555 wxString m_yUnits; 00556 wxString m_yUnitsCh2; 00557 wxString m_xUnits; 00558 bool m_applyToAll; 00559 00560 void disableSenseless(); 00561 00562 wxStdDialogButtonSizer* m_sdbSizer; 00563 wxTextCtrl *m_textCtrlHLines, *m_textCtrlYUnits, *m_textCtrlYUnitsCh2, 00564 *m_textCtrlXUnits, *m_textCtrlSR; 00565 wxComboBox *m_comboBoxNcolumns,*m_comboBoxFirsttime,*m_comboBoxSecorch; 00566 wxCheckBox *m_checkBoxApplyToAll; 00567 void OnComboNcolumns( wxCommandEvent& event ); 00568 void OnComboFirsttime( wxCommandEvent& event ); 00569 void OnComboSecorch( wxCommandEvent& event ); 00570 00572 00574 bool OnOK(); 00575 00576 public: 00578 00589 wxStfTextImportDlg( 00590 wxWindow* parent, 00591 const wxString& textPreview=wxT("\0"), 00592 int hLines_=1, 00593 bool isSeries=false, 00594 int id = wxID_ANY, 00595 wxString title = wxT("Text file import settings"), 00596 wxPoint pos = wxDefaultPosition, 00597 wxSize size = wxDefaultSize, 00598 int style = wxCAPTION 00599 ); 00600 00602 00604 int GetHLines() const {return m_hLines;} 00605 00607 00609 bool ToSection() const {return m_toSection;} 00610 00612 00614 bool FirstIsTime() const {return m_firstIsTime;} 00615 00617 00619 int GetNColumns() const {return m_ncolumns;} 00620 00622 00624 double GetSR() const {return m_sr;} 00625 00627 00629 const wxString& GetYUnits() const {return m_yUnits;} 00630 00632 00634 const wxString& GetYUnitsCh2() const {return m_yUnitsCh2;} 00635 00637 00639 const wxString& GetXUnits() const {return m_xUnits;} 00640 00642 00644 bool ApplyToAll() const {return m_applyToAll;} 00645 00647 00649 stfio::txtImportSettings GetTxtImport() const; 00650 00652 00655 virtual void EndModal(int retCode); 00656 }; 00657 00658 class wxDirPickerCtrl; 00659 00661 class wxStfConvertDlg : public wxDialog 00662 { 00663 DECLARE_EVENT_TABLE() 00664 00665 private: 00666 wxDirPickerCtrl *m_srcDirPicker,*m_destDirPicker; 00667 wxTextCtrl *m_textCtrlSrcFilter; 00668 wxGenericDirCtrl *mySrcDirCtrl, *myDestDirCtrl; 00669 wxString srcDir,destDir; 00670 wxString srcFilter; 00671 00672 stfio::filetype srcFilterExt, destFilterExt; 00673 std::vector<wxString> srcFileNames; 00674 00675 bool ReadPath(const wxString& path); 00676 00677 void OnComboBoxSrcExt(wxCommandEvent& event); 00678 void OnComboBoxDestExt(wxCommandEvent& event); 00679 00681 00683 bool OnOK(); 00684 00685 public: 00687 00694 wxStfConvertDlg( wxWindow* parent, int id = wxID_ANY, wxString title = wxT("Convert file series"), 00695 wxPoint pos = wxDefaultPosition, wxSize size = wxDefaultSize, int style = wxCAPTION ); 00696 00698 00700 wxString GetSrcDir() const {return srcDir;} 00701 00703 00705 wxString GetDestDir() const {return destDir;} 00706 00708 00710 wxString GetSrcFilter() const {return srcFilter;} 00711 00713 00715 stfio::filetype GetSrcFileExt() const {return srcFilterExt;} 00716 00718 00720 stfio::filetype GetDestFileExt() const {return destFilterExt;} 00721 00723 00725 std::vector<wxString> GetSrcFileNames() const {return srcFileNames;} 00726 00728 00731 virtual void EndModal(int retCode); 00732 00733 }; 00734 00735 class wxListCtrl; 00736 00738 class wxStfOrderChannelsDlg : public wxDialog 00739 { 00740 DECLARE_EVENT_TABLE() 00741 00742 private: 00743 wxListCtrl* m_List; 00744 std::vector<int> channelOrder; 00745 00746 void OnUparrow( wxCommandEvent& event ); 00747 void OnDownarrow( wxCommandEvent& event ); 00748 void SwapItems(long itemId1, long itemId2); 00749 00751 00753 bool OnOK(); 00754 00755 public: 00757 00765 wxStfOrderChannelsDlg( 00766 wxWindow* parent, 00767 const std::vector<wxString>& channelNames= 00768 std::vector<wxString>(0), 00769 int id = wxID_ANY, 00770 wxString title = wxT("Re-order channels"), 00771 wxPoint pos = wxDefaultPosition, 00772 wxSize size = wxDefaultSize, 00773 int style = wxCAPTION 00774 ); 00775 00777 00779 std::vector<int> GetChannelOrder() const {return channelOrder;} 00780 00782 00785 virtual void EndModal(int retCode); 00786 }; 00787 00788 /* @} */ 00789 00790 #endif
1.7.4