Commit 59b4c5ba authored by CHARRAS's avatar CHARRAS

New hotkeys in eeschema (the hotkey ? display the current existing hotkeys)

parent bbcf6ae1
......@@ -4,6 +4,12 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-aug-09 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ eeschema
Some new hotkeys (see hotkeys.cpp).
Now, the key ? display the current existing hotkeys
2007-Aug-08 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
......
......@@ -23,25 +23,53 @@
void WinEDA_SchematicFrame::OnHotKey(wxDC * DC, int hotkey,
EDA_BaseStruct * DrawStruct)
/***********************************************************/
/* Gestion des commandes rapides (Raccourcis claviers) concernant l'element
sous le courseur souris
Les majuscules/minuscules sont indifferenciees
touche DELETE: Effacement (tout element)
touche R: Rotation (composant ou label)
touche X: Miroir X (composant)
touche Y: Miroir Y (composant)
touche N: Orient 0 (composant)
touche M: Start Move composant
/* Hot keys. Some commands are relatives to the item under the mouse cursor
Commands are case insensitive
Zoom commands are not managed here
*/
/* Hotkey list: */
{
static wxString s_Hotkey_List[] =
{
wxT("key F1: Zoom in"), // general zoom hotkey, not managed here
wxT("key F2: Zoom out"), // general zoom hotkey, not managed here
wxT("key F5: Zoom Redraw"), // general zoom hotkey, not managed here
wxT("key F4: Zoom Center"), // general zoom hotkey, not managed here
wxT("key F5: Next search"),
wxT("key DELETE: delete item"),
wxT("key R: Rotation (component or label)"),
wxT("key X: Mirror X (component)"),
wxT("key Y: Mirror Y (component)"),
wxT("key N: Orient 0 (component)"),
wxT("key M: Start Move component"),
wxT("key A: Add new component"),
wxT("key W: begin new Wire"),
wxT("") // End of list, do not change
};
bool PopupOn = m_CurrentScreen->m_CurrentItem &&
m_CurrentScreen->m_CurrentItem->m_Flags;
bool RefreshToolBar = FALSE; // We must refresh tool bar when the undo/redo tool state is modified
if ( hotkey == 0 ) return;
wxPoint MousePos = m_CurrentScreen->m_MousePosition;
switch (hotkey)
{
case '?': // Display Current hotkey list
{
wxString msg = _("Current hotkey list:\n\n");
for ( unsigned int ii = 0; ; ii++ )
{
if ( s_Hotkey_List[ii].IsEmpty() ) break;
msg += s_Hotkey_List[ii]; msg += wxT("\n");
}
DisplayInfo(this, msg);
break;
}
case WXK_DELETE:
case WXK_NUMPAD_DELETE:
if ( PopupOn ) break;
......@@ -56,6 +84,33 @@ bool RefreshToolBar = FALSE; // We must refresh tool bar when the undo/redo tool
else FindSchematicItem(wxEmptyString, 2);
break;
case 'a':
case 'A': // Add component
if ( DrawStruct && DrawStruct->m_Flags ) break;
// switch to m_ID_current_state = ID_COMPONENT_BUTT;
if ( m_ID_current_state != ID_COMPONENT_BUTT ) SetToolID( ID_COMPONENT_BUTT, wxCURSOR_PENCIL, _("Add Component"));
OnLeftClick(DC, MousePos);
break;
case 'w':
case 'W': // Add wire
if ( DrawStruct ) // An item is selected. If edited and not a wire, a new command is not possible
{
if ( DrawStruct->m_Flags ) // Item selected and edition in progress
{
if (DrawStruct->m_StructType == DRAW_SEGMENT_STRUCT_TYPE )
{
EDA_DrawLineStruct * segment = (EDA_DrawLineStruct *)DrawStruct;
if ( segment->m_Layer != LAYER_WIRE ) break;
}
else break;
}
}
// switch to m_ID_current_state = ID_WIRE_BUTT;
if ( m_ID_current_state != ID_WIRE_BUTT ) SetToolID( ID_WIRE_BUTT, wxCURSOR_PENCIL, _("Add Wire"));
OnLeftClick(DC, MousePos);
break;
case 'r': // Rotation
case 'R':
if ( DrawStruct == NULL )
......
......@@ -5,7 +5,7 @@
COMMON_GLOBL wxString g_BuildVersion
#ifdef EDA_BASE
(wxT("(2007-07-30)"))
(wxT("(2007-08-09)"))
#endif
;
......
No preview for this file type
This diff is collapsed.
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