make microwave toolbar accessible from menu (Bug #1285425 )

This commit is contained in:
Martin Janitschke 2014-02-27 19:48:18 +01:00 committed by jean-pierre charras
parent 031202a837
commit 29e7638a3c
9 changed files with 46 additions and 6 deletions

View File

@ -279,6 +279,7 @@ public:
void OnUpdateSelectAutoTrackWidth( wxUpdateUIEvent& aEvent );
void OnUpdateAutoPlaceModulesMode( wxUpdateUIEvent& aEvent );
void OnUpdateAutoPlaceTracksMode( wxUpdateUIEvent& aEvent );
void OnUpdateMuWaveToolbar( wxUpdateUIEvent& aEvent );
/**
* Function RecordMacros.

View File

@ -237,6 +237,10 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
m_show_microwave_tools = state;
m_auimgr.GetPane( wxT( "m_microWaveToolBar" ) ).Show( m_show_microwave_tools );
m_auimgr.Update();
GetMenuBar()->SetLabel( ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR,
m_show_microwave_tools ?
_( "Hide Microwave Toolbar" ): _( "Show Microwave Toolbar" ));
break;
case ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR:

View File

@ -22,3 +22,5 @@
#define HELP_ZOOM_REDRAW _( "Redraw the screen of the board" )
#define HELP_SHOW_HIDE_LAYERMANAGER _( "Show/hide the layers manager toolbar" )
#define HELP_SHOW_HIDE_MICROWAVE_TOOLS _( "Show/hide the toolbar for microwave tools\nThis is a experimental feature (under development)" )

View File

@ -482,6 +482,13 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
HELP_SHOW_HIDE_LAYERMANAGER,
KiBitmap( layers_manager_xpm ) );
AddMenuItem( configmenu, ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR,
m_show_microwave_tools ?
_( "Hide Microwave Toolbar" ): _( "Show Microwave Toolbar" ),
HELP_SHOW_HIDE_MICROWAVE_TOOLS,
KiBitmap( mw_toolbar_xpm ) );
// General
#ifdef __WXMAC__
configmenu->Append(wxID_PREFERENCES);

View File

@ -141,6 +141,7 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END,
PCB_EDIT_FRAME::Process_Config )
EVT_MENU( ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG, PCB_EDIT_FRAME::Process_Config )
EVT_MENU( ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR, PCB_EDIT_FRAME::Process_Config )
EVT_MENU( wxID_PREFERENCES, PCB_EDIT_FRAME::Process_Config )
EVT_MENU( ID_PCB_LAYERS_SETUP, PCB_EDIT_FRAME::Process_Config )
EVT_MENU( ID_PCB_MASK_CLEARANCE, PCB_EDIT_FRAME::Process_Config )
@ -292,6 +293,8 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
PCB_EDIT_FRAME::OnUpdateVerticalToolbar )
EVT_UPDATE_UI_RANGE( ID_TB_OPTIONS_SHOW_ZONES, ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY,
PCB_EDIT_FRAME::OnUpdateZoneDisplayStyle )
EVT_UPDATE_UI_RANGE( ID_PCB_MUWAVE_START_CMD, ID_PCB_MUWAVE_END_CMD,
PCB_EDIT_FRAME::OnUpdateMuWaveToolbar )
END_EVENT_TABLE()

View File

@ -77,6 +77,17 @@ void PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
_("Hide &Layers Manager" ) : _("Show &Layers Manager" ));
break;
case ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR:
m_show_microwave_tools = ! m_show_microwave_tools;
m_auimgr.GetPane( wxT( "m_microWaveToolBar" ) ).Show( m_show_microwave_tools );
m_auimgr.Update();
GetMenuBar()->SetLabel( ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR,
m_show_microwave_tools ?
_( "Hide Microwave Toolbar" ): _( "Show Microwave Toolbar" ));
break;
case ID_PCB_LAYERS_SETUP:
InstallDialogLayerSetup();
break;

View File

@ -280,6 +280,7 @@ enum pcbnew_ids
ID_PCB_LIB_TABLE_EDIT,
ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG,
ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR,
ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR,
ID_TB_OPTIONS_SHOW_ZONES,

View File

@ -398,7 +398,7 @@ void PCB_EDIT_FRAME::ReCreateOptToolbar()
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE,
wxEmptyString,
KiBitmap( mw_toolbar_xpm ),
_( "Show/hide the toolbar for microwaves tools\n This is a experimental feature (under development)" ),
HELP_SHOW_HIDE_MICROWAVE_TOOLS,
wxITEM_CHECK );
@ -500,25 +500,30 @@ void PCB_EDIT_FRAME::ReCreateMicrowaveVToolbar()
// Set up toolbar
m_microWaveToolBar->AddTool( ID_PCB_MUWAVE_TOOL_SELF_CMD, wxEmptyString,
KiBitmap( mw_add_line_xpm ),
_( "Create line of specified length for microwave applications" ) );
_( "Create line of specified length for microwave applications" ),
wxITEM_CHECK );
m_microWaveToolBar->AddTool( ID_PCB_MUWAVE_TOOL_GAP_CMD, wxEmptyString,
KiBitmap( mw_add_gap_xpm ),
_( "Create gap of specified length for microwave applications" ) );
_( "Create gap of specified length for microwave applications" ),
wxITEM_CHECK );
m_microWaveToolBar->AddSeparator();
m_microWaveToolBar->AddTool( ID_PCB_MUWAVE_TOOL_STUB_CMD, wxEmptyString,
KiBitmap( mw_add_stub_xpm ),
_( "Create stub of specified length for microwave applications" ) );
_( "Create stub of specified length for microwave applications" ),
wxITEM_CHECK );
m_microWaveToolBar->AddTool( ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD, wxEmptyString,
KiBitmap( mw_add_stub_arc_xpm ),
_( "Create stub (arc) of specified length for microwave applications" ) );
_( "Create stub (arc) of specified length for microwave applications" ),
wxITEM_CHECK );
m_microWaveToolBar->AddTool( ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD, wxEmptyString,
KiBitmap( mw_add_shape_xpm ),
_( "Create a polynomial shape for microwave applications" ) );
_( "Create a polynomial shape for microwave applications" ),
wxITEM_CHECK );
m_microWaveToolBar->Realize();
}

View File

@ -204,6 +204,12 @@ void PCB_EDIT_FRAME::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent )
aEvent.Check( GetToolId() == aEvent.GetId() );
}
void PCB_EDIT_FRAME::OnUpdateMuWaveToolbar( wxUpdateUIEvent& aEvent )
{
if( aEvent.GetEventObject() == m_microWaveToolBar )
aEvent.Check( GetToolId() == aEvent.GetId() );
}
void PCB_EDIT_FRAME::OnUpdateAutoPlaceTracksMode( wxUpdateUIEvent& aEvent )
{