From 6292dcba7632b2fbdf5c0bae9b3058cc5cb4e429 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 17 Jul 2010 14:04:42 +0200 Subject: [PATCH] minor fix --- common/drawframe.cpp | 2 ++ eeschema/hotkeys.cpp | 14 ++++++++------ eeschema/onrightclick.cpp | 3 ++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/common/drawframe.cpp b/common/drawframe.cpp index f0e2f030b1..650022fcb7 100644 --- a/common/drawframe.cpp +++ b/common/drawframe.cpp @@ -423,6 +423,8 @@ void WinEDA_DrawFrame::SetToolID( int id, int new_cursor_id, m_VToolBar->ToggleTool( ID_NO_SELECT_BUTT, TRUE ); m_ID_current_state = id; + if( m_VToolBar ) + m_VToolBar->Refresh( ); } diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index 587452c6e1..7f03c941ea 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -386,14 +386,16 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, break; case HK_ADD_LABEL: - // switch to m_ID_current_state = ID_LABEL_BUTT; - if( m_ID_current_state != ID_LABEL_BUTT ) - SetToolID( ID_LABEL_BUTT, wxCURSOR_PENCIL, _( "Add Label" ) ); - OnLeftClick( DC, MousePos ); - break; + if( !ItemInEdit ) + { + // switch to m_ID_current_state = ID_LABEL_BUTT; + if( m_ID_current_state != ID_LABEL_BUTT ) + SetToolID( ID_LABEL_BUTT, wxCURSOR_PENCIL, _( "Add Label" ) ); + OnLeftClick( DC, MousePos ); + } + break; case HK_BEGIN_WIRE: - /* An item is selected. If edited and not a wire, a new command is not * possible */ if( !ItemInEdit && screen->m_BlockLocate.m_State == STATE_NO_BLOCK ) diff --git a/eeschema/onrightclick.cpp b/eeschema/onrightclick.cpp index d46299eb1a..e00260034b 100644 --- a/eeschema/onrightclick.cpp +++ b/eeschema/onrightclick.cpp @@ -532,7 +532,8 @@ void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, WinEDA_SchematicFrame* fr PopMenu->AppendSeparator(); ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, _( "Add Junction" ), add_junction_xpm ); - ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_LABEL, _( "Add Label" ), add_line_label_xpm ); + msg = AddHotkeyName( _( "Add Label" ), s_Schematic_Hokeys_Descr, HK_ADD_LABEL ); + ADD_MENUITEM( PopMenu, ID_POPUP_SCH_ADD_LABEL, msg, add_line_label_xpm ); // Add global label command only if the cursor is over one end of the wire. if( ( pos.x == Wire->m_Start.x && pos.y == Wire->m_Start.y)