Commit 4c9cf1df authored by stambaughw's avatar stambaughw

Fix zoom accelerator keys in schematic library viewer for wxMSW.

parent 3f6f3c7b
......@@ -41,16 +41,12 @@ END_EVENT_TABLE()
* This emulates the zoom menu entries found in the other Kicad applications.
* The library viewer does not have any menus so add an accelerator table to
* the main frame.
*
* FIXME: For some reason this doesn't work correctly in windows. Works fine
* in GTK2 in Linux. Not tested on Mac. Adding EVT_MENU_RANGE() to
* event table doesn't solve the problem either.
*/
static wxAcceleratorEntry accels[] = {
wxAcceleratorEntry( wxACCEL_NORMAL, WXK_F1, ID_ZOOM_IN ),
wxAcceleratorEntry( wxACCEL_NORMAL, WXK_F2, ID_ZOOM_OUT ),
wxAcceleratorEntry( wxACCEL_NORMAL, WXK_F1, ID_POPUP_ZOOM_IN ),
wxAcceleratorEntry( wxACCEL_NORMAL, WXK_F2, ID_POPUP_ZOOM_OUT ),
wxAcceleratorEntry( wxACCEL_NORMAL, WXK_F3, ID_ZOOM_REDRAW ),
wxAcceleratorEntry( wxACCEL_NORMAL, WXK_F4, ID_ZOOM_PAGE )
wxAcceleratorEntry( wxACCEL_NORMAL, WXK_F4, ID_POPUP_ZOOM_CENTER )
};
#define ACCEL_TABLE_CNT ( sizeof( accels ) / sizeof( wxAcceleratorEntry ) )
......@@ -89,7 +85,7 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
m_LibListSize.x = 150; // Width of library list
m_LibListSize.y = -1;
m_LibList = new wxListBox( this, ID_LIBVIEW_LIB_LIST, wxPoint( 0, 0 ),
m_LibListSize, 0, NULL, wxLB_HSCROLL );
m_LibListSize, 0, NULL, wxLB_HSCROLL );
m_LibList->SetFont( *g_DialogFont );
m_LibList->SetBackgroundColour( wxColour( 255, 255, 255 ) ); // Library background listbox color (white)
m_LibList->SetForegroundColour( wxColour( 0, 0, 0 ) ); // Library foreground listbox color (black)
......@@ -99,7 +95,8 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
m_CmpListSize.x = 150; // Width of component list
m_CmpListSize.y = -1;
m_CmpList = new wxListBox( this, ID_LIBVIEW_CMP_LIST, wxPoint( m_LibListSize.x, 0 ),
m_CmpList = new wxListBox( this, ID_LIBVIEW_CMP_LIST,
wxPoint( m_LibListSize.x, 0 ),
m_CmpListSize, 0, NULL, wxLB_HSCROLL );
m_CmpList->SetFont( *g_DialogFont );
m_CmpList->SetBackgroundColour( wxColour( 255, 255, 255 ) ); // Component background listbox color (white)
......@@ -112,7 +109,8 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
if( m_LibList )
ReCreateListLib();
DisplayLibInfos();
SetAcceleratorTable( table );
if( DrawPanel )
DrawPanel->SetAcceleratorTable( table );
BestZoom();
Show( TRUE );
}
......
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