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 362 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 1552 of file sim_plot_frame.cpp.

1553  :
1554  m_signal( aSignal ),
1555  m_plotFrame( aPlotFrame )
1556 {
1558 
1559  AddMenuItem( this, HIDE_SIGNAL, _( "Hide Signal" ),
1560  _( "Erase the signal from plot screen" ),
1561  KiBitmap( trash_xpm ) );
1562 
1563  TRACE* trace = plot->GetTrace( m_signal );
1564 
1565  if( trace->HasCursor() )
1566  AddMenuItem( this, HIDE_CURSOR, _( "Hide Cursor" ), KiBitmap( pcb_target_xpm ) );
1567  else
1568  AddMenuItem( this, SHOW_CURSOR, _( "Show Cursor" ), KiBitmap( pcb_target_xpm ) );
1569 
1570  Connect( wxEVT_COMMAND_MENU_SELECTED, wxMenuEventHandler( SIGNAL_CONTEXT_MENU::onMenuEvent ), NULL, this );
1571 }
const BITMAP_OPAQUE trash_xpm[1]
Definition: trash.cpp:31
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:221
TRACE * GetTrace(const wxString &aName) const
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:82
#define NULL
#define _(s)
Definition: 3d_actions.cpp:33
SIM_PLOT_PANEL * CurrentPlot() const
Return the currently opened plot panel (or NULL if there is none).
void onMenuEvent(wxMenuEvent &aEvent)
const BITMAP_OPAQUE pcb_target_xpm[1]

References _, AddMenuItem(), SIM_PLOT_FRAME::CurrentPlot(), SIM_PLOT_PANEL::GetTrace(), TRACE::HasCursor(), HIDE_CURSOR, HIDE_SIGNAL, KiBitmap(), m_plotFrame, m_signal, NULL, onMenuEvent(), pcb_target_xpm, SHOW_CURSOR, and trash_xpm.

Member Function Documentation

◆ onMenuEvent()

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

Definition at line 1574 of file sim_plot_frame.cpp.

1575 {
1577 
1578  switch( aEvent.GetId() )
1579  {
1580  case HIDE_SIGNAL:
1582  break;
1583 
1584  case SHOW_CURSOR:
1585  plot->EnableCursor( m_signal, true );
1586  break;
1587 
1588  case HIDE_CURSOR:
1589  plot->EnableCursor( m_signal, false );
1590  break;
1591  }
1592 }
void EnableCursor(const wxString &aName, bool aEnable)
Resets scale ranges to fit the current traces.
SIM_PLOT_PANEL * CurrentPlot() const
Return the currently opened plot panel (or NULL if there is none).
void removePlot(const wxString &aPlotName, bool aErase=true)
Remove a plot with a specific title.

References SIM_PLOT_PANEL::EnableCursor().

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 371 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 370 of file sim_plot_frame.h.

Referenced by SIGNAL_CONTEXT_MENU().


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