KiCad PCB EDA Suite
SIM_PLOT_FRAME::SIGNAL_CONTEXT_MENU Class Reference
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

Definition at line 327 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 1438 of file sim_plot_frame.cpp.

1440  : m_signal( aSignal ), m_plotFrame( aPlotFrame )
1441 {
1443 
1444  AddMenuItem( this, HIDE_SIGNAL, _( "Hide Signal" ),
1445  _( "Erase the signal from plot screen" ),
1446  KiBitmap( delete_xpm ) );
1447 
1448  TRACE* trace = plot->GetTrace( m_signal );
1449 
1450  if( trace->HasCursor() )
1451  AddMenuItem( this, HIDE_CURSOR, _( "Hide Cursor" ), KiBitmap( pcb_target_xpm ) );
1452  else
1453  AddMenuItem( this, SHOW_CURSOR, _( "Show Cursor" ), KiBitmap( pcb_target_xpm ) );
1454 
1455  Connect( wxEVT_COMMAND_MENU_SELECTED, wxMenuEventHandler( SIGNAL_CONTEXT_MENU::onMenuEvent ), NULL, this );
1456 }
const BITMAP_OPAQUE pcb_target_xpm[1]
Definition: pcb_target.cpp:42
bool HasCursor() const
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Function AddMenuItem is an inline helper function to create and insert a menu item with an icon into ...
Definition: bitmap.cpp:251
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:79
#define NULL
#define _(s)
Definition: 3d_actions.cpp:31
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).
void onMenuEvent(wxMenuEvent &aEvent)
const BITMAP_OPAQUE delete_xpm[1]
Definition: delete.cpp:62

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

Member Function Documentation

◆ onMenuEvent()

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

Definition at line 1459 of file sim_plot_frame.cpp.

1460 {
1462 
1463  switch( aEvent.GetId() )
1464  {
1465  case HIDE_SIGNAL:
1467  break;
1468 
1469  case SHOW_CURSOR:
1470  plot->EnableCursor( m_signal, true );
1471  break;
1472 
1473  case HIDE_CURSOR:
1474  plot->EnableCursor( m_signal, false );
1475  break;
1476  }
1477 }
void EnableCursor(const wxString &aName, bool aEnable)
Toggles cursor for a particular trace.
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).
void removePlot(const wxString &aPlotName, bool aErase=true)
Removes 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 336 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 335 of file sim_plot_frame.h.

Referenced by SIGNAL_CONTEXT_MENU().


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