Commit 8b3d5a69 authored by dickelbeck's avatar dickelbeck
Browse files

Øyvind's patch

parent e8fef505
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -77,6 +77,7 @@ static struct hotkey_name_descr s_Hotkey_Name_List[] =
    { wxT( "Backspace" ), WXK_BACK         },
    { wxT( "Backspace" ), WXK_BACK         },
    { wxT( "Insert" ),    WXK_INSERT       },
    { wxT( "Insert" ),    WXK_INSERT       },


    { wxT( "Home" ),      WXK_HOME         },
    { wxT( "End" ),       WXK_END          },
    { wxT( "End" ),       WXK_END          },
    { wxT( "Page Up" ),   WXK_PAGEUP       },
    { wxT( "Page Up" ),   WXK_PAGEUP       },
    { wxT( "Page Down" ), WXK_PAGEDOWN     },
    { wxT( "Page Down" ), WXK_PAGEDOWN     },
+6 −1
Original line number Original line Diff line number Diff line
@@ -152,7 +152,12 @@ void WinEDA_DrawFrame::OnZoom( wxCommandEvent& event )
        break;
        break;


    case ID_ZOOM_PAGE:
    case ID_ZOOM_PAGE:
        Zoom_Automatique( false );
        // With Zoom_Automatique(), the "Zoom Auto" button (and hotkey)
        // does nothing if the view is already at the correct
        // zoom level, but needs to be shifted (centered).
        //Zoom_Automatique( false );
        GetBaseScreen()->SetZoom( BestZoom() );
        Recadre_Trace( false );
        break;
        break;


    case ID_POPUP_ZOOM_SELECT:
    case ID_POPUP_ZOOM_SELECT:
+12 −5
Original line number Original line Diff line number Diff line
@@ -132,24 +132,24 @@ void WinEDA_DisplayFrame::ReCreateHToolbar()


    m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString,
    m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString,
                         wxBitmap( zoom_in_xpm ),
                         wxBitmap( zoom_in_xpm ),
                         _( "zoom + (F1)" ) );
                         _( "Zoom in (F1)" ) );


    m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString,
    m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString,
                         wxBitmap( zoom_out_xpm ),
                         wxBitmap( zoom_out_xpm ),
                         _( "zoom - (F2)" ) );
                         _( "Zoom out (F2)" ) );


    m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString,
    m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString,
                         wxBitmap( zoom_redraw_xpm ),
                         wxBitmap( zoom_redraw_xpm ),
                         _( "redraw (F3)" ) );
                         _( "Redraw view (F3)" ) );


    m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString,
    m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString,
                         wxBitmap( zoom_auto_xpm ),
                         wxBitmap( zoom_auto_xpm ),
                         _( "1:1 zoom" ) );
                         _( "Zoom auto (Home)" ) );


    m_HToolBar->AddSeparator();
    m_HToolBar->AddSeparator();
    m_HToolBar->AddTool( ID_CVPCB_SHOW3D_FRAME, wxEmptyString,
    m_HToolBar->AddTool( ID_CVPCB_SHOW3D_FRAME, wxEmptyString,
                         wxBitmap( show_3d_xpm ),
                         wxBitmap( show_3d_xpm ),
                         _( "1:1 zoom" ) );
                         _( "3D Display" ) );


    // after adding the buttons to the toolbar, must call Realize() to reflect
    // after adding the buttons to the toolbar, must call Realize() to reflect
    // the changes
    // the changes
@@ -236,6 +236,13 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
        curpos = GetScreen()->m_Curseur;
        curpos = GetScreen()->m_Curseur;
        break;
        break;


    case WXK_HOME:
        cmd.SetId( ID_ZOOM_PAGE );
        GetEventHandler()->ProcessEvent( cmd );
        flagcurseur = 2;
        curpos = GetScreen()->m_Curseur;
        break;

    case ' ':
    case ' ':
        GetScreen()->m_O_Curseur = GetScreen()->m_Curseur;
        GetScreen()->m_O_Curseur = GetScreen()->m_Curseur;
        break;
        break;
+21 −1
Original line number Original line Diff line number Diff line
@@ -48,6 +48,8 @@
/* Hotkey list: */
/* Hotkey list: */


// Common commands
// Common commands
static Ki_HotkeyInfo HkZoomAuto( wxT( "Zoom Auto" ), HK_ZOOM_AUTO,
                                   WXK_HOME );
static Ki_HotkeyInfo HkZoomCenter( wxT( "Zoom Center" ), HK_ZOOM_CENTER,
static Ki_HotkeyInfo HkZoomCenter( wxT( "Zoom Center" ), HK_ZOOM_CENTER,
                                   WXK_F4 );
                                   WXK_F4 );
static Ki_HotkeyInfo HkZoomRedraw( wxT( "Zoom Redraw" ), HK_ZOOM_REDRAW,
static Ki_HotkeyInfo HkZoomRedraw( wxT( "Zoom Redraw" ), HK_ZOOM_REDRAW,
@@ -107,7 +109,7 @@ Ki_HotkeyInfo* s_Common_Hotkey_List[] =
{
{
    &HkHelp,
    &HkHelp,
    &HkZoomIn,         &HkZoomOut,          &HkZoomRedraw,
    &HkZoomIn,         &HkZoomOut,          &HkZoomRedraw,
    &HkZoomCenter,
    &HkZoomCenter,     &HkZoomAuto,
    &HkResetLocalCoord,
    &HkResetLocalCoord,
    &HkUndo,           &HkRedo,
    &HkUndo,           &HkRedo,
    NULL
    NULL
@@ -164,6 +166,14 @@ struct Ki_HotkeyInfoSectionDescriptor s_Libedit_Hokeys_Descr[] =
    { NULL, NULL, NULL }
    { NULL, NULL, NULL }
};
};


// list of sections and corresponding hotkey list for the component browser
// (used to list current hotkeys)
struct Ki_HotkeyInfoSectionDescriptor s_Viewlib_Hokeys_Descr[] =
{
    { &g_CommonSectionTag,  s_Common_Hotkey_List,  NULL },
    { NULL, NULL, NULL }
};

/*
/*
 * Hot keys. Some commands are relative to the item under the mouse cursor
 * Hot keys. Some commands are relative to the item under the mouse cursor
 * Commands are case insensitive
 * Commands are case insensitive
@@ -236,6 +246,11 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
        GetEventHandler()->ProcessEvent( cmd );
        GetEventHandler()->ProcessEvent( cmd );
        break;
        break;


    case HK_ZOOM_AUTO:
        cmd.SetId( ID_ZOOM_PAGE );
        GetEventHandler()->ProcessEvent( cmd );
        break;

    case HK_UNDO:
    case HK_UNDO:
    case HK_REDO:
    case HK_REDO:
        if( !ItemInEdit )
        if( !ItemInEdit )
@@ -517,6 +532,11 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey,
        GetEventHandler()->ProcessEvent( cmd );
        GetEventHandler()->ProcessEvent( cmd );
        break;
        break;


    case HK_ZOOM_AUTO:
        cmd.SetId( ID_ZOOM_PAGE );
        GetEventHandler()->ProcessEvent( cmd );
        break;

    case HK_UNDO:
    case HK_UNDO:
        if( !ItemInEdit )
        if( !ItemInEdit )
        {
        {
+3 −0
Original line number Original line Diff line number Diff line
@@ -14,6 +14,7 @@ enum hotkey_id_commnand {
    HK_ZOOM_OUT,
    HK_ZOOM_OUT,
    HK_ZOOM_REDRAW,
    HK_ZOOM_REDRAW,
    HK_ZOOM_CENTER,
    HK_ZOOM_CENTER,
    HK_ZOOM_AUTO,
    HK_NEXT_SEARCH,
    HK_NEXT_SEARCH,
    HK_DELETE,
    HK_DELETE,
    HK_REPEAT_LAST,
    HK_REPEAT_LAST,
@@ -41,5 +42,7 @@ extern struct Ki_HotkeyInfoSectionDescriptor s_Eeschema_Hokeys_Descr[];
extern struct Ki_HotkeyInfoSectionDescriptor s_Schematic_Hokeys_Descr[];
extern struct Ki_HotkeyInfoSectionDescriptor s_Schematic_Hokeys_Descr[];
// List of hotkey descriptors for the lib editor only
// List of hotkey descriptors for the lib editor only
extern struct Ki_HotkeyInfoSectionDescriptor s_Libedit_Hokeys_Descr[];
extern struct Ki_HotkeyInfoSectionDescriptor s_Libedit_Hokeys_Descr[];
// List of hotkey descriptors for the lib browser only
extern struct Ki_HotkeyInfoSectionDescriptor s_Viewlib_Hokeys_Descr[];


#endif		// KOTKEYS_H
#endif		// KOTKEYS_H
Loading