hotkey enhancement

This commit is contained in:
CHARRAS 2007-09-20 05:41:40 +00:00
parent 542b944196
commit 2cfe92de85
8 changed files with 335 additions and 301 deletions

View File

@ -4,7 +4,7 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-sept-19 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2007-sept-20 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ all
* hotkeys handling finished

View File

@ -639,4 +639,48 @@ void AddHotheyConfigMenu( wxMenu* menu )
_( "Hotkey config location" ),
_( "Hotkey config file location selection (home directory or kicad tree)" ),
right_xpm );
submenu_hkcfg->Check(ID_PREFERENCES_HOTKEY_PATH_IS_HOME,
g_ConfigFileLocationChoice == 0);
submenu_hkcfg->Check(ID_PREFERENCES_HOTKEY_PATH_IS_KICAD,
g_ConfigFileLocationChoice == 1);
}
/************************************************************************/
void HandleHotheyConfigMenuSelection( WinEDA_DrawFrame * frame, int id )
/************************************************************************/
/* called on hotkey file location selecton menu
* @param frame = current WinEDA_DrawFrame
* @param id = selected menu id
* @return g_ConfigFileLocationChoice (global) = new selection
*/
{
wxMenuBar * menu = frame->GetMenuBar();
switch (id )
{
case ID_PREFERENCES_HOTKEY_PATH_IS_HOME:
if ( g_ConfigFileLocationChoice != 0 )
{
g_ConfigFileLocationChoice = 0;
menu->Check(ID_PREFERENCES_HOTKEY_PATH_IS_HOME, true);
menu->Check(ID_PREFERENCES_HOTKEY_PATH_IS_KICAD, false);
frame->m_Parent->m_EDA_CommonConfig->Write(HOTKEY_CFG_PATH_OPT, g_ConfigFileLocationChoice);
}
break;
case ID_PREFERENCES_HOTKEY_PATH_IS_KICAD:
if ( g_ConfigFileLocationChoice != 1 )
{
g_ConfigFileLocationChoice = 1;
menu->Check(ID_PREFERENCES_HOTKEY_PATH_IS_HOME, false);
menu->Check(ID_PREFERENCES_HOTKEY_PATH_IS_KICAD, true);
frame->m_Parent->m_EDA_CommonConfig->Write(HOTKEY_CFG_PATH_OPT, g_ConfigFileLocationChoice);
}
break;
default:
break;
}
}

View File

@ -99,19 +99,8 @@ wxString FullFileName;
}
case ID_PREFERENCES_HOTKEY_PATH_IS_HOME:
if ( g_ConfigFileLocationChoice != 0 )
{
g_ConfigFileLocationChoice = 0;
m_Parent->m_EDA_CommonConfig->Write(HOTKEY_CFG_PATH_OPT, g_ConfigFileLocationChoice);
}
break;
case ID_PREFERENCES_HOTKEY_PATH_IS_KICAD:
if ( g_ConfigFileLocationChoice != 1 )
{
g_ConfigFileLocationChoice = 1;
m_Parent->m_EDA_CommonConfig->Write(HOTKEY_CFG_PATH_OPT, g_ConfigFileLocationChoice);
}
HandleHotheyConfigMenuSelection( this, id );
break;
default:

View File

@ -68,19 +68,8 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event )
break;
case ID_PREFERENCES_HOTKEY_PATH_IS_HOME:
if( g_ConfigFileLocationChoice != 0 )
{
g_ConfigFileLocationChoice = 0;
m_Parent->m_EDA_CommonConfig->Write( HOTKEY_CFG_PATH_OPT, g_ConfigFileLocationChoice );
}
break;
case ID_PREFERENCES_HOTKEY_PATH_IS_KICAD:
if( g_ConfigFileLocationChoice != 1 )
{
g_ConfigFileLocationChoice = 1;
m_Parent->m_EDA_CommonConfig->Write( HOTKEY_CFG_PATH_OPT, g_ConfigFileLocationChoice );
}
HandleHotheyConfigMenuSelection( this, id );
break;
default:

View File

@ -91,7 +91,8 @@ COMMON_GLOBL int g_ConfigFileLocationChoice; /* 0 = files are in Home directo
/* Functions:
*/
wxString ReturnHotkeyConfigFilePath( int choice );
void AddHotheyConfigMenu( wxMenu* menu );
void AddHotheyConfigMenu( wxMenu* menu );
void HandleHotheyConfigMenuSelection( WinEDA_DrawFrame * frame, int id );
wxString ReturnKeyNameFromKeyCode( int keycode );
wxString ReturnKeyNameFromCommandId( Ki_HotkeyInfo** List, int CommandId );
wxString AddHotkeyName( const wxString& text, Ki_HotkeyInfo** List, int CommandId );

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -107,13 +107,8 @@ wxString FullFileName;
}
case ID_PREFERENCES_HOTKEY_PATH_IS_HOME:
g_ConfigFileLocationChoice = 0;
m_Parent->m_EDA_CommonConfig->Write(HOTKEY_CFG_PATH_OPT, g_ConfigFileLocationChoice);
break;
case ID_PREFERENCES_HOTKEY_PATH_IS_KICAD:
g_ConfigFileLocationChoice = 1;
m_Parent->m_EDA_CommonConfig->Write(HOTKEY_CFG_PATH_OPT, g_ConfigFileLocationChoice);
HandleHotheyConfigMenuSelection( this, id );
break;
default: