KiCad PCB EDA Suite
mathplot.cpp File Reference
#include <wx/window.h>
#include "wx/object.h"
#include "wx/font.h"
#include "wx/colour.h"
#include "wx/settings.h"
#include "wx/sizer.h"
#include "wx/log.h"
#include "wx/intl.h"
#include "wx/dcclient.h"
#include "wx/cursor.h"
#include <widgets/mathplot.h>
#include <wx/bmpbuttn.h>
#include <wx/module.h>
#include <wx/msgdlg.h>
#include <wx/image.h>
#include <wx/tipwin.h>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <set>

Go to the source code of this file.

Macros

#define mpLEGEND_MARGIN   5
 
#define mpLEGEND_LINEWIDTH   10
 
#define mpMIN_X_AXIS_LABEL_SEPARATION   64
 
#define mpMIN_Y_AXIS_LABEL_SEPARATION   32
 
#define mpSCROLL_NUM_PIXELS_PER_LINE   10
 
#define mpLN10   2.3025850929940456840179914546844
 

Functions

 EVT_MIDDLE_DOWN (mpWindow::OnMouseMiddleDown) EVT_MOUSEWHEEL(mpWindow
 

Macro Definition Documentation

#define mpLEGEND_LINEWIDTH   10

Definition at line 54 of file mathplot.cpp.

Referenced by mpInfoLegend::Plot().

#define mpLEGEND_MARGIN   5

Definition at line 53 of file mathplot.cpp.

Referenced by mpInfoLegend::Plot().

#define mpLN10   2.3025850929940456840179914546844

Definition at line 883 of file mathplot.cpp.

#define mpMIN_X_AXIS_LABEL_SEPARATION   64

Definition at line 57 of file mathplot.cpp.

#define mpMIN_Y_AXIS_LABEL_SEPARATION   32

Definition at line 58 of file mathplot.cpp.

#define mpSCROLL_NUM_PIXELS_PER_LINE   10

Definition at line 61 of file mathplot.cpp.

Referenced by mpWindow::OnScrollLineDown(), and mpWindow::OnScrollLineUp().

Function Documentation

EVT_MIDDLE_DOWN ( mpWindow::OnMouseMiddleDown  )

Definition at line 1751 of file mathplot.cpp.

References mpID_CENTER, mpID_FIT, mpID_ZOOM_IN, and mpID_ZOOM_OUT.

1770  : wxWindow( parent, id, pos, size, flag, wxT( "mathplot" ) )
1771 {
1772  m_zooming = false;
1773  m_scaleX = m_scaleY = 1.0;
1774  m_posX = m_posY = 0;
1775  m_desiredXmin = m_desiredYmin = 0;
1776  m_desiredXmax = m_desiredYmax = 1;
1777  m_scrX = m_scrY = 64; // Fixed from m_scrX = m_scrX = 64;
1778  m_minX = m_minY = 0;
1779  m_maxX = m_maxY = 0;
1780  m_last_lx = m_last_ly = 0;
1781  m_buff_bmp = NULL;
1782  m_enableDoubleBuffer = false;
1783  m_enableMouseNavigation = true;
1784  m_enableLimitedView = false;
1785  m_movingInfoLayer = NULL;
1786  // Set margins to 0
1787  m_marginTop = 0; m_marginRight = 0; m_marginBottom = 0; m_marginLeft = 0;
1788 
1789 
1790  m_lockaspect = false;
1791 
1792  m_popmenu.Append( mpID_CENTER, _( "Center" ), _( "Center plot view to this position" ) );
1793  m_popmenu.Append( mpID_FIT, _( "Fit on Screen" ), _( "Set plot view to show all items" ) );
1794  m_popmenu.Append( mpID_ZOOM_IN, _( "Zoom In" ), _( "Zoom in plot view." ) );
1795  m_popmenu.Append( mpID_ZOOM_OUT, _( "Zoom Out" ), _( "Zoom out plot view." ) );
1796  // m_popmenu.AppendCheckItem( mpID_LOCKASPECT, _("Lock aspect"), _("Lock horizontal and vertical zoom aspect."));
1797  // m_popmenu.Append( mpID_HELP_MOUSE, _("Show mouse commands..."), _("Show help about the mouse commands."));
1798 
1799  m_layers.clear();
1800  SetBackgroundColour( *wxWHITE );
1801  m_bgColour = *wxWHITE;
1802  m_fgColour = *wxBLACK;
1803 
1804  m_enableScrollBars = false;
1805  SetSizeHints( 128, 128 );
1806 
1807  // J.L.Blanco: Eliminates the "flick" with the double buffer.
1808  SetBackgroundStyle( wxBG_STYLE_CUSTOM );
1809 
1810  UpdateAll();
1811 }