Stimfit @PACKAGE_VERSION@
Loading...
Searching...
No Matches
childframe.h
Go to the documentation of this file.
1// This program is free software; you can redistribute it and/or
2// modify it under the terms of the GNU General Public License
3// as published by the Free Software Foundation; either version 2
4// of the License, or (at your option) any later version.
5
6// This program is distributed in the hope that it will be useful,
7// but WITHOUT ANY WARRANTY; without even the implied warranty of
8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9// GNU General Public License for more details.
10
11// You should have received a copy of the GNU General Public License
12// along with this program; if not, write to the Free Software
13// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14
20
21#ifndef _CHILDFRAME_H
22#define _CHILDFRAME_H
23
27
28#include <wx/aui/aui.h>
29#include <wx/grid.h>
30#include <wx/dnd.h>
31#include <wx/spinctrl.h>
32
33#include "./../stf.h"
34
35// Define a new frame
36class wxStfGraph;
37class wxStfTable;
38class wxStfGrid;
39
41
43wxT("layout2| \
44name=Results;caption=Results;state=2044;dir=1;layer=0;row=0;pos=1;prop=167270; \
45bestw=200;besth=184;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1| \
46name=Selection;caption=Trace selection;state=2044;dir=1;layer=0;row=0;pos=0;prop=32730; \
47bestw=128;besth=64;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1| \
48name=Traces;caption=Traces;state=18428;dir=5;layer=0;row=0;pos=0;prop=100000; \
49bestw=20;besth=20;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|");
50
51#if wxUSE_DRAG_AND_DROP
52class wxStfFileDrop : public wxFileDropTarget {
53protected:
54 virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames);
55};
56#endif
57
59
63{
64 DECLARE_CLASS( wxStfChildFrame )
65public:
67
78 wxDocument* doc,
79 wxView* view,
80 wxStfParentType* parent,
81 wxWindowID id,
82 const wxString& title,
83 const wxPoint& pos = wxPoint(48,48),
84 const wxSize& size = wxDefaultSize,
85 long style = wxDEFAULT_FRAME_STYLE,
86 const wxString& name = wxT("frame")
87 );
90
92
95 void ShowTable(const stfnum::Table& table,const wxString& caption);
96
98
100 std::size_t GetCurTrace() const;
101
103
105 void SetCurTrace(std::size_t);
106
108
110 void CreateMenuTraces(std::size_t value);
111
112
114
116 void CreateComboChannels( const wxArrayString& channelNames );
117
119
121 void SetSelected(std::size_t value);
122
124
127 void SetChannels( std::size_t act, std::size_t inact );
128
131
133
137
139
141 wxAuiManager* GetMgr() {return &m_mgr;}
142
144
146 wxStfGrid* GetCopyGrid() {return m_table;}
147
150
153
156
158
160 bool ShowSelected() const {return pShowSelected->IsChecked();}
161
163
165 bool ShowSecond();// const {return pShowSecond->IsChecked();}
166
168
170 bool ShowAll() const {return pShowAll->IsChecked();}
171
174
175 void OnActivate(wxActivateEvent &event);
176
178
180 virtual wxMenuBar *GetMenuBar() const;
181
182 private:
183 wxStfParentType* m_parent;
184 wxAuiManager m_mgr;
185 wxAuiNotebook* m_notebook;
186 long m_notebook_style;
187 wxPanel *m_traceCounter;
188 wxPanel *m_channelCounter;
189 wxStaticText *pSize;
190 wxComboBox *pActChannel, *pInactChannel;
191 wxSpinCtrl *trace_spinctrl;
192 wxStfGrid* m_table;
193 wxCheckBox *pZeroIndex, *pShowSelected, *pShowSecond, *pShowAll;
194 std::size_t sizemax;
195
196 wxAuiNotebook* CreateNotebook();
197 wxPanel* CreateTraceCounter();
198 wxPanel* CreateChannelCounter();
199 wxStfGrid* CreateTable();
200 void OnMenuHighlight(wxMenuEvent& event);
201 void OnShowselected(wxCommandEvent& event);
202 void OnZeroIndex(wxCommandEvent& event);
203 void OnSpinCtrlTraces(wxSpinEvent& event);
204 void OnComboActChannel(wxCommandEvent& event);
205 void OnComboInactChannel(wxCommandEvent& event);
206
207 DECLARE_EVENT_TABLE()
208};
209
211
212#endif
213
WORD TSTime TpMarker WORD size
Definition Son.h:337
A table used for printing information.
Definition stfnum.h:152
See http://www.wxwidgets.org/manuals/stable/wx_wxcheckbox.html (wxWidgets documentation)
See http://www.wxwidgets.org/manuals/stable/wx_wxcommandevent.html (wxWidgets documentation)
See http://www.wxwidgets.org/manuals/stable/wx_wxdocument.html (wxWidgets documentation)
See http://www.wxwidgets.org/manuals/stable/wx_wxpoint.html (wxWidgets documentation)
See http://www.wxwidgets.org/manuals/stable/wx_wxsize.html (wxWidgets documentation)
Handles drawing of traces and keyboard or mouse input.
Definition graph.h:49
Derived from wxGrid. Allows to copy cells to the clipboard.
Definition copygrid.h:29
Adapts stfnum::Table to be used by wxStfGrid.
Definition table.h:31
See http://www.wxwidgets.org/manuals/stable/wx_wxstring.html (wxWidgets documentation)
See http://www.wxwidgets.org/manuals/stable/wx_wxview.html (wxWidgets documentation)
void ActivateGraph()
Activated the current graph.
void SetSelected(std::size_t value)
Refreshes the trace selection string.
void ShowTable(const stfnum::Table &table, const wxString &caption)
Adds a table to the results notebook.
const wxString defaultPersp
Default perspective string.
Definition childframe.h:42
void SetChannels(std::size_t act, std::size_t inact)
Sets the channels in the combo boxes. Checks and corrects equal channels in both boxes.
std::size_t GetCurTrace() const
Retrieves the current trace from the trace selection combo box.
void Loadperspective()
Load the saved AUI perspective from the configuration.
bool ShowSelected() const
Indicates whether all selected traces should be plotted.
Definition childframe.h:160
void CreateMenuTraces(std::size_t value)
Creates the trace selection menu.
void Restoreperspective()
Restore the default AUI perspective.
void UpdateResults()
Updates the results table.
bool ShowAll() const
Indicates whether all channels should be plotted.
Definition childframe.h:170
void Saveperspective()
Write the current AUI perspective to the configuration.
~wxStfChildFrame()
Destructor.
void OnActivate(wxActivateEvent &event)
wxAuiManager * GetMgr()
Retrieve the wxAuiManager.
Definition childframe.h:141
void SetCurTrace(std::size_t)
Sets the current trace from the trace selection combo box.
wxStfGrid * GetCopyGrid()
Retrieve the wxStfGrid that contains the results table.
Definition childframe.h:146
wxStfChildFrame(wxDocument *doc, wxView *view, wxStfParentType *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxPoint(48, 48), const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE, const wxString &name=wxT("frame"))
Constructor.
void CreateComboChannels(const wxArrayString &channelNames)
Creates the channel selection combo boxes.
void UpdateChannels()
Updates the channels according to the current combo boy selection.
bool ShowSecond()
Indicates whether the second channel should be plotted.
virtual wxMenuBar * GetMenuBar() const
Override default GetMenuBar.
wxDocMDIParentFrame wxStfParentType
parent frame type; depends on whether aui is used for the doc/view interface
Definition stf.h:86
wxDocMDIChildFrame wxStfChildType
child frame type; depends on whether aui is used for the doc/view interface
Definition stf.h:83
#define StfDll
Defines dll export or import functions for Windows.
Definition stf.h:55