Stimfit
0.13.15
|
Handles drawing of traces and keyboard or mouse input. More...
#include <graph.h>
Public Member Functions | |
wxStfGraph (wxView *v, wxStfChildFrame *frame, const wxPoint &pos, const wxSize &size, long style) | |
Constructor. | |
virtual void | OnDraw (wxDC &dc) |
The central drawing function. Used for drawing to any output device, such as a printer or a screen. | |
void | Snapshotwmf () |
Copies the drawing to the clipboard as a windows metafile. | |
void | OnMouseEvent (wxMouseEvent &event) |
Handles mouse events. | |
void | OnKeyDown (wxKeyEvent &event) |
Handles keyboard input. | |
void | OnNext () |
Show and analyse next trace. | |
void | OnPrevious () |
Show and analyse previous trace. | |
void | OnLast () |
Show and analyse last trace. | |
void | OnFirst () |
Show and analyse first trace. | |
void | OnUp () |
Moves the traces up by 20 px. | |
void | OnDown () |
Moves the traces down by 20 px. | |
void | OnRight () |
Moves the traces right by 20 px. | |
void | OnLeft () |
Moves the traces left by 20 px. | |
void | OnXenlhi () |
Enlarges the x-scale by a factor of 2. | |
void | OnXenllo () |
Enlarges the x-scale by a factor of 1.1. | |
void | OnXshrinklo () |
Shrinks the x-scale by a factor of 1.1. | |
void | OnXshrinkhi () |
Shrinks the x-scale by a factor of 2. | |
void | OnYenlhi () |
Enlarges the y-scale by a factor of 2. | |
void | OnYenllo () |
Enlarges the y-scale by a factor of 1.1. | |
void | OnYshrinklo () |
Shrinks the y-scale by a factor of 1.1. | |
void | OnYshrinkhi () |
Shrinks the y-scale by a factor of 2. | |
void | Ch2base () |
Adjust y-positioning so that the baselines of channel 1 and 2 are at the same y-position. | |
void | Ch2pos () |
Adjust y-positioning so that channel 1 and 2 are at the same absolute y-position. | |
void | Ch2zoom () |
Adjust y-scale so that channel 1 and 2 have the same y-scale. | |
void | Ch2basezoom () |
Combines Ch2zoom() and Ch2base(). | |
void | Fittowindow (bool refresh) |
Fits the graph to the window. | |
void | set_isPrinted (bool value) |
Set to true if the graph is drawn on a printer. | |
void | set_printScale (double value) |
Sets the printing scale to the specified value. | |
void | set_printRect (wxRect value) |
Sets the size of the printout to the epcified rectangle. | |
void | set_noGimmicks (bool value) |
Set to true if the results table and the cursors should be printed. | |
void | set_downsampling (int value) |
Prints every n-th point. | |
bool | get_noGimmicks () const |
Indicates whether everything (cursors, results table, etc.) is printed out. | |
int | get_eventPos () const |
Returns the y-position of a right click when in event-detection mode. | |
double | get_plot_xmin () const |
Returns x value of the left screen border. | |
double | get_plot_xmax () const |
Returns x value of the right screen border. | |
double | get_plot_ymin () const |
Returns y value of the bottom screen border. | |
double | get_plot_ymax () const |
Returns y value of the top screen border. | |
double | get_plot_y2min () const |
Returns y value of the bottom screen border for the reference channel. | |
double | get_plot_y2max () const |
Returns y value of the top screen border for the reference channel. | |
Public Attributes | |
wxStfView * | view |
Returns the current zoom struct. |
Handles drawing of traces and keyboard or mouse input.
Derived from wxScrolledWindow, although no scrolling is implemented at this time. All the trace scaling and drawing happens here. Mouse and keyboard input is handled here as well.
wxStfGraph::wxStfGraph | ( | wxView * | v, |
wxStfChildFrame * | frame, | ||
const wxPoint & | pos, | ||
const wxSize & | size, | ||
long | style | ||
) |
Constructor.
v | is a pointer to the attached wxView. |
frame | is a pointer to the attached child frame. |
pos | and |
size | indicate the initial position and size of this frame. |
style | is the window style. |
void wxStfGraph::Ch2basezoom | ( | ) |
void wxStfGraph::Fittowindow | ( | bool | refresh | ) |
Fits the graph to the window.
Fits the graph to 100% of the width and 50% of the height of the window and centers it.
refresh | Set to true if the graph should be refreshed after fitting it to the window. |
int wxStfGraph::get_eventPos | ( | ) | const [inline] |
bool wxStfGraph::get_noGimmicks | ( | ) | const [inline] |
double wxStfGraph::get_plot_xmax | ( | ) | const |
Returns x value of the right screen border.
double wxStfGraph::get_plot_xmin | ( | ) | const |
Returns x value of the left screen border.
double wxStfGraph::get_plot_y2max | ( | ) | const |
Returns y value of the top screen border for the reference channel.
double wxStfGraph::get_plot_y2min | ( | ) | const |
Returns y value of the bottom screen border for the reference channel.
double wxStfGraph::get_plot_ymax | ( | ) | const |
Returns y value of the top screen border.
double wxStfGraph::get_plot_ymin | ( | ) | const |
Returns y value of the bottom screen border.
void wxStfGraph::OnDown | ( | ) |
Moves the traces down by 20 px.
Called when either the down arrow cursor key is pressed or the "Move traces down"-button is clicked.
virtual void wxStfGraph::OnDraw | ( | wxDC & | dc | ) | [virtual] |
The central drawing function. Used for drawing to any output device, such as a printer or a screen.
dc | is the device context used for drawing (can be a printer, a screen or a file). |
void wxStfGraph::OnFirst | ( | ) |
Show and analyse first trace.
Called when the "first trace"-button is clicked.
void wxStfGraph::OnKeyDown | ( | wxKeyEvent & | event | ) |
Handles keyboard input.
Key modifiers (e.g. Shift or Ctrl) ar handled within this function.
event | The keyboard event. Contains information about the key that was pressed. |
void wxStfGraph::OnLast | ( | ) |
Show and analyse last trace.
Called when the "last trace"-button is clicked.
void wxStfGraph::OnLeft | ( | ) |
Moves the traces left by 20 px.
Called when either the left arrow cursor key and Ctrl are pressed at the same time or the "Move traces left"-button is clicked.
void wxStfGraph::OnMouseEvent | ( | wxMouseEvent & | event | ) |
Handles mouse events.
The different possibilities (e.g. left or right click) split up within this function.
event | The mouse event. Contains information such as whether the left or right button was clicked. |
void wxStfGraph::OnNext | ( | ) |
Show and analyse next trace.
Called when either the "next trace"-button is clicked or the right arrow cursor key is pressed. Wraps around when last trace is reached.
void wxStfGraph::OnPrevious | ( | ) |
Show and analyse previous trace.
Called when either the "previous trace"-button is clicked or the left arrow cursor key is pressed. Wraps around when first trace is reached.
void wxStfGraph::OnRight | ( | ) |
Moves the traces right by 20 px.
Called when either the right arrow cursor key and Ctrl are pressed at the same time or the "Move traces right"-button is clicked.
void wxStfGraph::OnUp | ( | ) |
Moves the traces up by 20 px.
Called when either the up arrow cursor key is pressed or the "Move traces up"-button is clicked.
void wxStfGraph::OnXenlhi | ( | ) |
Enlarges the x-scale by a factor of 2.
This is currently never called and might be removed in the future.
void wxStfGraph::OnXenllo | ( | ) |
Enlarges the x-scale by a factor of 1.1.
Called when either the "+" key and Ctrl are pressed at the same time or the "Enlarge x-scale"-button is clicked.
void wxStfGraph::OnXshrinkhi | ( | ) |
Shrinks the x-scale by a factor of 2.
This is currently never called and might be removed in the future.
void wxStfGraph::OnXshrinklo | ( | ) |
Shrinks the x-scale by a factor of 1.1.
Called when either the "-" key and Ctrl are pressed at the same time or the "Shrink x-scale"-button is clicked.
void wxStfGraph::OnYenlhi | ( | ) |
Enlarges the y-scale by a factor of 2.
This is currently never called and might be removed in the future.
void wxStfGraph::OnYenllo | ( | ) |
Enlarges the y-scale by a factor of 1.1.
Called when either the "+" key is pressed or the "Enlarge x-scale"-button is clicked.
void wxStfGraph::OnYshrinkhi | ( | ) |
Shrinks the y-scale by a factor of 2.
This is currently never called and might be removed in the future.
void wxStfGraph::OnYshrinklo | ( | ) |
Shrinks the y-scale by a factor of 1.1.
Called when either the "-" key is pressed or the "Shrink x-scale"-button is clicked.
void wxStfGraph::set_downsampling | ( | int | value | ) | [inline] |
void wxStfGraph::set_isPrinted | ( | bool | value | ) |
Set to true if the graph is drawn on a printer.
value | boolean determining whether the graph is printed. |
void wxStfGraph::set_noGimmicks | ( | bool | value | ) | [inline] |
void wxStfGraph::set_printRect | ( | wxRect | value | ) | [inline] |
void wxStfGraph::set_printScale | ( | double | value | ) | [inline] |
void wxStfGraph::Snapshotwmf | ( | ) |
Copies the drawing to the clipboard as a windows metafile.
Metafiles are only implemented in Windows. Some applications allow you to paste as an enhanced metafile (usually through "Edit -> Paste special..."); choose this option for best results.
Returns the current zoom struct.
zoom_ | The current zoom struct. The view attached to this wxStfGraph. |