From 30c7e31839ff363bc8ad056efd3136dc02a3e494 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 19 May 2012 21:04:03 +0200 Subject: [PATCH] Very minor fixes. --- common/drawframe.cpp | 6 +++--- gerbview/controle.cpp | 2 +- gerbview/gerbview_frame.h | 22 ++++++++-------------- gerbview/hotkeys.cpp | 21 ++++++++++++--------- 4 files changed, 24 insertions(+), 27 deletions(-) diff --git a/common/drawframe.cpp b/common/drawframe.cpp index 8463b4d9db..a06d3e6bcd 100644 --- a/common/drawframe.cpp +++ b/common/drawframe.cpp @@ -139,7 +139,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti GetTextSize( wxT( "dx 0234.567890 dx 0234.567890 d 0234.567890" ), stsbar ).x + 10, // units display, Inches is bigger than mm - GetTextSize( wxT( "Inches" ), stsbar ).x + 10, + GetTextSize( _( "Inches" ), stsbar ).x + 10, FUNCTION_DISPLAY_SIZE, }; @@ -428,11 +428,11 @@ void EDA_DRAW_FRAME::DisplayUnitsMsg() break; case MILLIMETRES: - msg += _( "mm" ); + msg = _( "mm" ); break; default: - msg += _( "Units" ); + msg = _( "Units" ); break; } diff --git a/gerbview/controle.cpp b/gerbview/controle.cpp index f42c0e1f67..8c058fa3f8 100644 --- a/gerbview/controle.cpp +++ b/gerbview/controle.cpp @@ -104,7 +104,7 @@ void GERBVIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH if( aHotKey ) { - OnHotKey( aDC, aHotKey, NULL ); + OnHotKey( aDC, aHotKey, aPosition ); } UpdateStatusBar(); diff --git a/gerbview/gerbview_frame.h b/gerbview/gerbview_frame.h index be5a0f3989..0cb7d9bf06 100644 --- a/gerbview/gerbview_frame.h +++ b/gerbview/gerbview_frame.h @@ -476,10 +476,15 @@ public: void OnQuit( wxCommandEvent& event ); /** - * Function OnHotKey - * called when on hotkey trigger + * Function OnHotKey. + * ** Commands are case insensitive ** + * Some commands are relatives to the item under the mouse cursor + * @param aDC = current device context + * @param aHotkeyCode = hotkey code (ascii or wxWidget code for special keys) + * @param aPosition The cursor position in logical (drawing) units. + * @param aItem = NULL or pointer on a EDA_ITEM under the mouse cursor */ - void OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct ); + void OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosition, EDA_ITEM* aItem = NULL ); GERBER_DRAW_ITEM* GerberGeneralLocateAndDisplay(); GERBER_DRAW_ITEM* Locate( const wxPoint& aPosition, int typeloc ); @@ -548,17 +553,6 @@ public: */ void ToPrinter( wxCommandEvent& event ); -/* void Genere_HPGL( const wxString& FullFileName, int Layers ); - * void Genere_GERBER( const wxString& FullFileName, int Layers ); - * void Genere_PS( const wxString& FullFileName, int Layers ); - * void Plot_Layer_HPGL( FILE* File, int masque_layer, int garde, bool trace_via, - * EDA_DRAW_MODE_T trace_mode ); - * void Plot_Layer_GERBER( FILE* File, int masque_layer, int garde, bool trace_via, - * EDA_DRAW_MODE_T trace_mode ); - * int Gen_D_CODE_File( const wxString& Name_File ); - * void Plot_Layer_PS( FILE* File, int masque_layer, int garde, bool trace_via, - * EDA_DRAW_MODE_T trace_mode ); - */ void Files_io( wxCommandEvent& event ); /** diff --git a/gerbview/hotkeys.cpp b/gerbview/hotkeys.cpp index 9e3a8b96c4..c07a42854e 100644 --- a/gerbview/hotkeys.cpp +++ b/gerbview/hotkeys.cpp @@ -71,23 +71,26 @@ struct EDA_HOTKEY_CONFIG s_Gerbview_Hokeys_Descr[] = }; -/* Hot keys. Some commands are relatives to the item under the mouse cursor - * Commands are case insensitive - * @param DC = current device context - * @param hotkey = hotkey code (ascii or wxWidget code for special keys) - * @param DrawStruct = NULL or pointer on a EDA_ITEM under the mouse cursor +/* + * Function OnHotKey. + * ** Commands are case insensitive ** + * Some commands are relatives to the item under the mouse cursor + * aDC = current device context + * aHotkeyCode = hotkey code (ascii or wxWidget code for special keys) + * aPosition The cursor position in logical (drawing) units. + * aItem = NULL or pointer on a EDA_ITEM under the mouse cursor */ -void GERBVIEW_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct ) +void GERBVIEW_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosition, EDA_ITEM* aItem ) { wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED ); cmd.SetEventObject( this ); /* Convert lower to upper case (the usual toupper function has problem with non ascii * codes like function keys */ - if( (hotkey >= 'a') && (hotkey <= 'z') ) - hotkey += 'A' - 'a'; + if( (aHotkeyCode >= 'a') && (aHotkeyCode <= 'z') ) + aHotkeyCode += 'A' - 'a'; - EDA_HOTKEY * HK_Descr = GetDescriptorFromHotkey( hotkey, s_Gerbview_Hotkey_List ); + EDA_HOTKEY * HK_Descr = GetDescriptorFromHotkey( aHotkeyCode, s_Gerbview_Hotkey_List ); if( HK_Descr == NULL ) return;