pl_editor: add config options
This commit is contained in:
parent
1f3f11ca0d
commit
c328d6b118
|
@ -53,6 +53,8 @@ BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME )
|
|||
EVT_MENU( ID_MENU_PL_EDITOR_SELECT_PREFERED_EDITOR,
|
||||
EDA_BASE_FRAME::OnSelectPreferredEditor )
|
||||
EVT_MENU( wxID_PREFERENCES, PL_EDITOR_FRAME::Process_Config )
|
||||
EVT_MENU( ID_MENU_SWITCH_BGCOLOR, PL_EDITOR_FRAME::Process_Config )
|
||||
EVT_MENU( ID_MENU_GRID_ONOFF, PL_EDITOR_FRAME::Process_Config )
|
||||
|
||||
// Menu Help
|
||||
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
|
||||
|
|
|
@ -112,17 +112,16 @@ void PL_EDITOR_FRAME::ReCreateMenuBar( void )
|
|||
// Menu for preferences
|
||||
wxMenu* preferencesMenu = new wxMenu;
|
||||
|
||||
// Options (Preferences on WXMAC)
|
||||
#ifdef __WXMAC__
|
||||
preferencesMenu->Append(wxID_PREFERENCES);
|
||||
#else
|
||||
AddMenuItem( preferencesMenu,
|
||||
wxID_PREFERENCES,
|
||||
_( "&Options" ),
|
||||
wxEmptyString,
|
||||
KiBitmap( preference_xpm ) );
|
||||
#endif // __WXMAC__
|
||||
ID_MENU_SWITCH_BGCOLOR,
|
||||
g_DrawBgColor == WHITE ?
|
||||
_( "&BackGround Black" ) : _( "&BackGround White" ),
|
||||
wxEmptyString, KiBitmap( palette_xpm ) );
|
||||
|
||||
AddMenuItem( preferencesMenu,
|
||||
ID_MENU_GRID_ONOFF,
|
||||
IsGridVisible() ? _( "Hide &Grid" ) : _( "Show &Grid" ),
|
||||
wxEmptyString, KiBitmap( grid_xpm ) );
|
||||
|
||||
// Text editor selection
|
||||
AddMenuItem( preferencesMenu,
|
||||
|
|
|
@ -50,7 +50,25 @@ void PL_EDITOR_FRAME::Process_Config( wxCommandEvent& event )
|
|||
|
||||
switch( id )
|
||||
{
|
||||
case wxID_PREFERENCES:
|
||||
case ID_MENU_SWITCH_BGCOLOR:
|
||||
if( g_DrawBgColor == WHITE )
|
||||
g_DrawBgColor = BLACK;
|
||||
else
|
||||
g_DrawBgColor = WHITE;
|
||||
|
||||
GetMenuBar()->SetLabel( ID_MENU_SWITCH_BGCOLOR,
|
||||
g_DrawBgColor == WHITE ?
|
||||
_( "&BackGround Black" ) :
|
||||
_( "&BackGround White" ) );
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
case ID_MENU_GRID_ONOFF:
|
||||
SetGridVisibility( ! IsGridVisible() );
|
||||
GetMenuBar()->SetLabel( ID_MENU_GRID_ONOFF,
|
||||
IsGridVisible() ? _( "Hide &Grid" ) :
|
||||
_( "Show &Grid" ) );
|
||||
m_canvas->Refresh();
|
||||
break;
|
||||
|
||||
// Standard basic hotkey IDs
|
||||
|
|
|
@ -17,6 +17,8 @@ enum pl_editor_ids
|
|||
|
||||
ID_PL_EDITOR_SHOW_SOURCE,
|
||||
ID_MENU_PL_EDITOR_SELECT_PREFERED_EDITOR,
|
||||
ID_MENU_SWITCH_BGCOLOR,
|
||||
ID_MENU_GRID_ONOFF,
|
||||
ID_DESIGN_TREE_FRAME,
|
||||
|
||||
ID_SHOW_REAL_MODE,
|
||||
|
|
Loading…
Reference in New Issue