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

◆ mpLEGEND_LINEWIDTH

#define mpLEGEND_LINEWIDTH   10

Definition at line 54 of file mathplot.cpp.

◆ mpLEGEND_MARGIN

#define mpLEGEND_MARGIN   5

Definition at line 53 of file mathplot.cpp.

◆ mpLN10

#define mpLN10   2.3025850929940456840179914546844

Definition at line 848 of file mathplot.cpp.

◆ mpMIN_X_AXIS_LABEL_SEPARATION

#define mpMIN_X_AXIS_LABEL_SEPARATION   64

Definition at line 57 of file mathplot.cpp.

◆ mpMIN_Y_AXIS_LABEL_SEPARATION

#define mpMIN_Y_AXIS_LABEL_SEPARATION   32

Definition at line 58 of file mathplot.cpp.

◆ mpSCROLL_NUM_PIXELS_PER_LINE

#define mpSCROLL_NUM_PIXELS_PER_LINE   10

Definition at line 61 of file mathplot.cpp.

Function Documentation

◆ EVT_MIDDLE_DOWN()

EVT_MIDDLE_DOWN ( mpWindow::OnMouseMiddleDown  )

Definition at line 1716 of file mathplot.cpp.

1735  : wxWindow( parent, id, pos, size, flag, wxT( "mathplot" ) )
1736 {
1737  m_zooming = false;
1738  m_scaleX = m_scaleY = 1.0;
1739  m_posX = m_posY = 0;
1740  m_desiredXmin = m_desiredYmin = 0;
1741  m_desiredXmax = m_desiredYmax = 1;
1742  m_scrX = m_scrY = 64; // Fixed from m_scrX = m_scrX = 64;
1743  m_minX = m_minY = 0;
1744  m_maxX = m_maxY = 0;
1745  m_last_lx = m_last_ly = 0;
1746  m_buff_bmp = NULL;
1747  m_enableDoubleBuffer = false;
1748  m_enableMouseNavigation = true;
1749  m_enableLimitedView = false;
1750  m_movingInfoLayer = NULL;
1751  // Set margins to 0
1752  m_marginTop = 0; m_marginRight = 0; m_marginBottom = 0; m_marginLeft = 0;
1753 
1754 
1755  m_lockaspect = false;
1756 
1757  m_popmenu.Append( mpID_CENTER, _( "Center" ), _( "Center plot view to this position" ) );
1758  m_popmenu.Append( mpID_FIT, _( "Fit on Screen" ), _( "Set plot view to show all items" ) );
1759  m_popmenu.Append( mpID_ZOOM_IN, _( "Zoom In" ), _( "Zoom in plot view." ) );
1760  m_popmenu.Append( mpID_ZOOM_OUT, _( "Zoom Out" ), _( "Zoom out plot view." ) );
1761  // m_popmenu.AppendCheckItem( mpID_LOCKASPECT, _("Lock aspect"), _("Lock horizontal and vertical zoom aspect."));
1762  // m_popmenu.Append( mpID_HELP_MOUSE, _("Show mouse commands..."), _("Show help about the mouse commands."));
1763 
1764  m_layers.clear();
1765  SetBackgroundColour( *wxWHITE );
1766  m_bgColour = *wxWHITE;
1767  m_fgColour = *wxBLACK;
1768 
1769  m_enableScrollBars = false;
1770  SetSizeHints( 128, 128 );
1771 
1772  // J.L.Blanco: Eliminates the "flick" with the double buffer.
1773  SetBackgroundStyle( wxBG_STYLE_CUSTOM );
1774 
1775  UpdateAll();
1776 }
#define _(s)

References _, mpID_CENTER, mpID_FIT, mpID_ZOOM_IN, and mpID_ZOOM_OUT.