Stimfit  0.13.15
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
parentframe.h
Go to the documentation of this file.
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 _PARENTFRAME_H
00022 #define _PARENTFRAME_H
00023 
00028 #include <wx/aui/aui.h>
00029 #include <wx/grid.h>
00030 #include <wx/dnd.h>
00031 
00032 #include "./../stf.h"
00033 
00034 class wxStfGraph;
00035 class wxStfTable;
00036 class wxStfGrid;
00037 class wxStfFileDrop;
00038 class wxProgressDialog;
00039     
00041 #ifdef WITH_AUIDOCVIEW
00042 typedef wxAuiDocMDIChildFrame wxStfChildType;
00043 #else
00044 typedef wxDocMDIChildFrame wxStfChildType;
00045 #endif
00046 
00048 #ifdef WITH_AUIDOCVIEW
00049 typedef wxAuiDocMDIParentFrame wxStfParentType;
00050 #else
00051 typedef wxDocMDIParentFrame wxStfParentType;
00052 #endif
00053 
00054 
00055 typedef wxAuiToolBar wxStfToolBar;
00056 
00057 #ifdef WITH_PYTHON
00058 struct new_wxwindow {
00059     new_wxwindow(wxWindow* cppW=NULL, PyObject* pyW=NULL) :
00060         cppWindow(cppW), pyWindow(pyW)
00061     {}
00062     wxWindow* cppWindow;
00063     PyObject* pyWindow;
00064 };
00065 #else
00066 struct new_wxwindow {
00067     new_wxwindow(wxWindow* cppW=NULL, void* pyW=NULL) :
00068         cppWindow(cppW), pyWindow(pyW)
00069     {}
00070     wxWindow* cppWindow;
00071     void* pyWindow;
00072 };
00073 #endif
00074 
00076 
00079 class StfDll wxStfParentFrame : public wxStfParentType {
00080     DECLARE_CLASS(wxStfParentFrame)
00081 public:
00083 
00091     wxStfParentFrame(wxDocManager *manager, wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size,
00092             long style);
00093 
00095     ~wxStfParentFrame();
00096 
00098 
00100     void OnAbout(wxCommandEvent& event);
00101 
00103 
00108     wxStfGraph *CreateGraph(wxView *view, wxStfChildFrame *parent);
00109 
00111 
00113     stf::cursor_type GetMouseQual() const;
00114 
00116 
00118     void SetMouseQual(stf::cursor_type value);
00119 
00121 
00123     void SetSelectedButton(bool selected);
00124 
00126 
00128     stf::zoom_channels GetZoomQual() const;
00129 
00131 
00133     void SetZoomQual(stf::zoom_channels value);
00134 
00136 
00138     void SetSingleChannel(bool value);
00139 
00141 
00143     wxPrintData* GetPrintData() { return m_printData.get(); }
00144 
00146 
00148     wxPageSetupDialogData* GetPageSetup() { return m_pageSetupData.get(); }
00149 
00151 
00153     wxAuiManager& GetMgr() { return m_mgr; }
00154     
00156 
00158     void CheckUpdate( wxProgressDialog* progDlg=NULL ) const;
00159 
00160     new_wxwindow MakePythonWindow(const std::string& windowFunc, const std::string& mgr_name="pythonShell",
00161                                   const std::string& caption="Python Shell",
00162                                   bool show=true, bool full=false, bool isfloat=true,
00163                                   int width=-1, int height=-1,
00164                                   double mpl_width=8.0, double mpl_height=6.0);
00165 
00166     int GetMplFigNo() {return mpl_figno++;}
00167 private:
00168     wxAuiManager m_mgr;
00169     wxStfToolBar *m_cursorToolBar, *m_scaleToolBar;
00170     wxStfFileDrop* m_drop;
00171 #ifdef WITH_PYTHON
00172     wxString python_code2; // python import code
00173     void RedirectStdio();
00174 #endif
00175     // print data, to remember settings during the session
00176     boost::shared_ptr<wxPrintData> m_printData;
00177 
00178     // page setup data
00179     boost::shared_ptr<wxPageSetupDialogData> m_pageSetupData;
00180     bool firstResize;
00181 
00182     int mpl_figno;
00183     wxStfToolBar* CreateStdTb();
00184     wxStfToolBar* CreateScaleTb();
00185     wxStfToolBar* CreateEditTb();
00186     wxStfToolBar* CreateCursorTb();
00187 
00188     void OnHelp(wxCommandEvent& event);
00189     void OnCheckUpdate(wxCommandEvent& event);
00190     
00191     void OnToggleSelect(wxCommandEvent& event);
00192     void OnToolFirst(wxCommandEvent& event);
00193     void OnToolNext(wxCommandEvent& event);
00194     void OnToolPrevious(wxCommandEvent& event);
00195     void OnToolLast(wxCommandEvent& event);
00196     void OnToolXenl(wxCommandEvent& event);
00197     void OnToolXshrink(wxCommandEvent& event);
00198     void OnToolYenl(wxCommandEvent& event);
00199     void OnToolYshrink(wxCommandEvent& event);
00200     void OnToolUp(wxCommandEvent& event);
00201     void OnToolDown(wxCommandEvent& event);
00202     void OnToolFit(wxCommandEvent& event);
00203     void OnToolLeft(wxCommandEvent& event);
00204     void OnToolRight(wxCommandEvent& event);
00205     void OnToolCh1(wxCommandEvent& event);
00206     void OnToolCh2(wxCommandEvent& event);
00207 
00208     void OnToolSnapshotwmf(wxCommandEvent& event);
00209 
00210     void OnToolMeasure(wxCommandEvent& event);
00211     void OnToolPeak(wxCommandEvent& event);
00212     void OnToolBase(wxCommandEvent& event);
00213     void OnToolDecay(wxCommandEvent& event);
00214     void OnToolLatency(wxCommandEvent& event);
00215     void OnToolZoom(wxCommandEvent& event);
00216     void OnToolEvent(wxCommandEvent& event);
00217 
00218 #ifdef WITH_PSLOPE
00219     void OnToolPSlope(wxCommandEvent& event);
00220 #endif
00221     
00222 //    void OnSwapChannels(wxCommandEvent& event);
00223     void OnCh2base(wxCommandEvent& event);
00224     void OnCh2pos(wxCommandEvent& event);
00225     void OnCh2zoom(wxCommandEvent& event);
00226     void OnCh2basezoom(wxCommandEvent& event);
00227     void OnAverage(wxCommandEvent& event);
00228     void OnAlignedAverage(wxCommandEvent& event);
00229     void OnExportfile(wxCommandEvent& event);
00230     void OnExportatf(wxCommandEvent& event);
00231     void OnExportigor(wxCommandEvent& event);
00232     void OnExporthdf5(wxCommandEvent& event);
00233     void OnConvert(wxCommandEvent& event);
00234 
00235     void OnPrint(wxCommandEvent& event);
00236 
00237     void OnScale(wxCommandEvent& event);
00238     void OnMpl(wxCommandEvent& event);
00239     void OnMplSpectrum(wxCommandEvent& event);
00240     void OnPageSetup(wxCommandEvent& event);
00241     void OnViewResults(wxCommandEvent& event);
00242     void OnSaveperspective(wxCommandEvent& event);
00243     void OnLoadperspective(wxCommandEvent& event);
00244     void OnRestoreperspective(wxCommandEvent& event);
00245 #ifdef WITH_PYTHON
00246     void OnViewshell(wxCommandEvent& event);
00247     void OnUserdef(wxCommandEvent& event);
00248 #endif
00249     void OnLStartMaxslope(wxCommandEvent& event);
00250     void OnLStartHalfrise(wxCommandEvent& event);
00251     void OnLStartPeak(wxCommandEvent& event);
00252     void OnLStartManual(wxCommandEvent& event);
00253     void OnLEndFoot(wxCommandEvent& event);
00254     void OnLEndMaxslope(wxCommandEvent& event);
00255     void OnLEndHalfrise(wxCommandEvent& event);
00256     void OnLEndPeak(wxCommandEvent& event);
00257     void OnLEndManual(wxCommandEvent& event);
00258     void OnLWindow(wxCommandEvent& event);
00259     DECLARE_EVENT_TABLE()
00260 };
00263 #endif
00264 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines