KiCad PCB EDA Suite
SIM_PLOT_FRAME::SIGNAL_CONTEXT_MENU Class Reference

Panel that was used as the most recent one for simulations. More...

Inheritance diagram for SIM_PLOT_FRAME::SIGNAL_CONTEXT_MENU:

Public Member Functions

 SIGNAL_CONTEXT_MENU (const wxString &aSignal, SIM_PLOT_FRAME *aPlotFrame)
 

Private Types

enum  SIGNAL_CONTEXT_MENU_EVENTS { HIDE_SIGNAL, SHOW_CURSOR, HIDE_CURSOR }
 

Private Member Functions

void onMenuEvent (wxMenuEvent &aEvent)
 

Private Attributes

const wxString & m_signal
 
SIM_PLOT_FRAMEm_plotFrame
 

Detailed Description

Panel that was used as the most recent one for simulations.

Definition at line 346 of file sim_plot_frame.h.

Member Enumeration Documentation

◆ SIGNAL_CONTEXT_MENU_EVENTS

Constructor & Destructor Documentation

◆ SIGNAL_CONTEXT_MENU()

SIM_PLOT_FRAME::SIGNAL_CONTEXT_MENU::SIGNAL_CONTEXT_MENU ( const wxString &  aSignal,
SIM_PLOT_FRAME aPlotFrame 
)

Definition at line 1803 of file sim_plot_frame.cpp.

1804  :
1805  m_signal( aSignal ),
1806  m_plotFrame( aPlotFrame )
1807 {
1809 
1810  AddMenuItem( this, HIDE_SIGNAL, _( "Hide Signal" ), _( "Erase the signal from plot screen" ),
1811  KiBitmap( BITMAPS::trash ) );
1812 
1813  TRACE* trace = plot->GetTrace( m_signal );
1814 
1815  if( trace->HasCursor() )
1816  AddMenuItem( this, HIDE_CURSOR, _( "Hide Cursor" ), KiBitmap( BITMAPS::pcb_target ) );
1817  else
1818  AddMenuItem( this, SHOW_CURSOR, _( "Show Cursor" ), KiBitmap( BITMAPS::pcb_target ) );
1819 
1820  Connect( wxEVT_COMMAND_MENU_SELECTED, wxMenuEventHandler( SIGNAL_CONTEXT_MENU::onMenuEvent ),
1821  nullptr, this );
1822 }
bool HasCursor() const
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Create and insert a menu item with an icon into aMenu.
Definition: bitmap.cpp:257
SIM_PLOT_PANEL * GetCurrentPlot() const
Return the currently opened plot panel (or NULL if there is none).
#define _(s)
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:105
void onMenuEvent(wxMenuEvent &aEvent)

References _, AddMenuItem(), SIM_PLOT_FRAME::GetCurrentPlot(), TRACE::HasCursor(), HIDE_CURSOR, HIDE_SIGNAL, KiBitmap(), m_plotFrame, m_signal, onMenuEvent(), pcb_target, plot, SHOW_CURSOR, and trash.

Member Function Documentation

◆ onMenuEvent()

void SIM_PLOT_FRAME::SIGNAL_CONTEXT_MENU::onMenuEvent ( wxMenuEvent &  aEvent)
private

Definition at line 1825 of file sim_plot_frame.cpp.

1826 {
1828 
1829  switch( aEvent.GetId() )
1830  {
1831  case HIDE_SIGNAL:
1833  break;
1834 
1835  case SHOW_CURSOR:
1836  plot->EnableCursor( m_signal, true );
1837  break;
1838 
1839  case HIDE_CURSOR:
1840  plot->EnableCursor( m_signal, false );
1841  break;
1842  }
1843 }
SIM_PLOT_PANEL * GetCurrentPlot() const
Return the currently opened plot panel (or NULL if there is none).
void removePlot(const wxString &aPlotName)
Remove a plot with a specific title.

References plot.

Referenced by SIGNAL_CONTEXT_MENU().

Member Data Documentation

◆ m_plotFrame

SIM_PLOT_FRAME* SIM_PLOT_FRAME::SIGNAL_CONTEXT_MENU::m_plotFrame
private

Definition at line 355 of file sim_plot_frame.h.

Referenced by SIGNAL_CONTEXT_MENU().

◆ m_signal

const wxString& SIM_PLOT_FRAME::SIGNAL_CONTEXT_MENU::m_signal
private

Definition at line 354 of file sim_plot_frame.h.

Referenced by SIGNAL_CONTEXT_MENU().


The documentation for this class was generated from the following files: