Stimfit  0.13.15
Public Member Functions | Public Attributes

Handles drawing of traces and keyboard or mouse input. More...

#include <graph.h>

Collaboration diagram for wxStfGraph:
Collaboration graph
[legend]

List of all members.

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

wxStfViewview
 Returns the current zoom struct.

Detailed Description

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.

Definition at line 48 of file graph.h.


Constructor & Destructor Documentation

wxStfGraph::wxStfGraph ( wxView v,
wxStfChildFrame frame,
const wxPoint pos,
const wxSize size,
long  style 
)

Constructor.

Parameters:
vis a pointer to the attached wxView.
frameis a pointer to the attached child frame.
posand
sizeindicate the initial position and size of this frame.
styleis the window style.

Member Function Documentation

Combines Ch2zoom() and Ch2base().

This is a separate function so that the graph is not refreshed between adjusting the y-scale and the baseline.

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.

Parameters:
refreshSet to true if the graph should be refreshed after fitting it to the window.
int wxStfGraph::get_eventPos ( ) const [inline]

Returns the y-position of a right click when in event-detection mode.

Returns:
the index of the trace that the right-click position corresponds to.

Definition at line 236 of file graph.h.

bool wxStfGraph::get_noGimmicks ( ) const [inline]

Indicates whether everything (cursors, results table, etc.) is printed out.

Returns:
true if everything is printed out.

Definition at line 231 of file graph.h.

double wxStfGraph::get_plot_xmax ( ) const

Returns x value of the right screen border.

Returns:
x value of the right screen border
double wxStfGraph::get_plot_xmin ( ) const

Returns x value of the left screen border.

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.

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.

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.

Returns:
y value of the top screen border
double wxStfGraph::get_plot_ymin ( ) const

Returns y value of the bottom screen border.

Returns:
y value of the bottom screen border

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.

Parameters:
dcis the device context used for drawing (can be a printer, a screen or a file).

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.

Parameters:
eventThe keyboard event. Contains information about the key that was pressed.

Show and analyse last trace.

Called when the "last trace"-button is clicked.

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.

Parameters:
eventThe mouse event. Contains information such as whether the left or right button was clicked.

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.

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.

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.

Enlarges the x-scale by a factor of 2.

This is currently never called and might be removed in the future.

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.

Shrinks the x-scale by a factor of 2.

This is currently never called and might be removed in the future.

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.

Enlarges the y-scale by a factor of 2.

This is currently never called and might be removed in the future.

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.

Shrinks the y-scale by a factor of 2.

This is currently never called and might be removed in the future.

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]

Prints every n-th point.

Parameters:
valueDetermines that every n-th point should be printed.

Definition at line 226 of file graph.h.

void wxStfGraph::set_isPrinted ( bool  value)

Set to true if the graph is drawn on a printer.

Parameters:
valueboolean determining whether the graph is printed.
void wxStfGraph::set_noGimmicks ( bool  value) [inline]

Set to true if the results table and the cursors should be printed.

Parameters:
valueboolean determining whether everything should be printed.

Definition at line 221 of file graph.h.

void wxStfGraph::set_printRect ( wxRect  value) [inline]

Sets the size of the printout to the epcified rectangle.

Parameters:
valueThe new printing rectangle.

Definition at line 216 of file graph.h.

void wxStfGraph::set_printScale ( double  value) [inline]

Sets the printing scale to the specified value.

Parameters:
valueThe new printing scale.

Definition at line 211 of file graph.h.

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.


Member Data Documentation

Returns the current zoom struct.

Returns:
the current zoom struct. Sets the current zoom struct.
Parameters:
zoom_The current zoom struct. The view attached to this wxStfGraph.

Definition at line 249 of file graph.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines