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

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 1210 of file sim_plot_frame.cpp.

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

1212  : m_signal( aSignal ), m_plotFrame( aPlotFrame )
1213 {
1215 
1216  AddMenuItem( this, HIDE_SIGNAL, _( "Hide signal" ),
1217  _( "Erase the signal from plot screen" ),
1218  KiBitmap( delete_xpm ) );
1219 
1220  TRACE* trace = plot->GetTrace( m_signal );
1221 
1222  if( trace->HasCursor() )
1223  AddMenuItem( this, HIDE_CURSOR, _( "Hide cursor" ),
1224  wxEmptyString, KiBitmap( mirepcb_xpm ) );
1225  else
1226  AddMenuItem( this, SHOW_CURSOR, _( "Show cursor" ),
1227  wxEmptyString, KiBitmap( mirepcb_xpm ) );
1228 
1229  Connect( wxEVT_COMMAND_MENU_SELECTED, wxMenuEventHandler( SIGNAL_CONTEXT_MENU::onMenuEvent ), NULL, this );
1230 }
long trace
Definition: solve.cpp:232
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:55
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
bool HasCursor() const
TRACE * GetTrace(const wxString &aName) const
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).
void onMenuEvent(wxMenuEvent &aEvent)

Member Function Documentation

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

Definition at line 1233 of file sim_plot_frame.cpp.

References SIM_PLOT_PANEL::EnableCursor().

Referenced by SIGNAL_CONTEXT_MENU().

1234 {
1236 
1237  switch( aEvent.GetId() )
1238  {
1239  case HIDE_SIGNAL:
1241  break;
1242 
1243  case SHOW_CURSOR:
1244  plot->EnableCursor( m_signal, true );
1245  break;
1246 
1247  case HIDE_CURSOR:
1248  plot->EnableCursor( m_signal, false );
1249  break;
1250  }
1251 }
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.

Member Data Documentation

SIM_PLOT_FRAME* SIM_PLOT_FRAME::SIGNAL_CONTEXT_MENU::m_plotFrame
private

Definition at line 320 of file sim_plot_frame.h.

Referenced by SIGNAL_CONTEXT_MENU().

const wxString& SIM_PLOT_FRAME::SIGNAL_CONTEXT_MENU::m_signal
private

Definition at line 319 of file sim_plot_frame.h.

Referenced by SIGNAL_CONTEXT_MENU().


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