Commit 29e7638a authored by Martin Janitschke's avatar Martin Janitschke Committed by jean-pierre charras

make microwave toolbar accessible from menu (Bug #1285425 )

parent 031202a8
......@@ -279,6 +279,7 @@ public:
void OnUpdateSelectAutoTrackWidth( wxUpdateUIEvent& aEvent );
void OnUpdateAutoPlaceModulesMode( wxUpdateUIEvent& aEvent );
void OnUpdateAutoPlaceTracksMode( wxUpdateUIEvent& aEvent );
void OnUpdateMuWaveToolbar( wxUpdateUIEvent& aEvent );
/**
* Function RecordMacros.
......
......@@ -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:
......
......@@ -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)" )
......@@ -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);
......
......@@ -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()
......
......@@ -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;
......
......@@ -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,
......
......@@ -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();
}
......
......@@ -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 )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment