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>

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 53 of file mathplot.cpp.

Referenced by mpInfoLegend::Plot().

#define mpLEGEND_MARGIN   5

Definition at line 52 of file mathplot.cpp.

Referenced by mpInfoLegend::Plot().

#define mpLN10   2.3025850929940456840179914546844

Definition at line 856 of file mathplot.cpp.

#define mpMIN_X_AXIS_LABEL_SEPARATION   64

Definition at line 56 of file mathplot.cpp.

#define mpMIN_Y_AXIS_LABEL_SEPARATION   32

Definition at line 57 of file mathplot.cpp.

#define mpSCROLL_NUM_PIXELS_PER_LINE   10

Definition at line 60 of file mathplot.cpp.

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

Function Documentation

EVT_MIDDLE_DOWN ( mpWindow::OnMouseMiddleDown  )

Definition at line 1724 of file mathplot.cpp.

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