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() ...@@ -41,16 +41,12 @@ END_EVENT_TABLE()
* This emulates the zoom menu entries found in the other Kicad applications. * 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 library viewer does not have any menus so add an accelerator table to
* the main frame. * 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[] = { static wxAcceleratorEntry accels[] = {
wxAcceleratorEntry( wxACCEL_NORMAL, WXK_F1, ID_ZOOM_IN ), wxAcceleratorEntry( wxACCEL_NORMAL, WXK_F1, ID_POPUP_ZOOM_IN ),
wxAcceleratorEntry( wxACCEL_NORMAL, WXK_F2, ID_ZOOM_OUT ), wxAcceleratorEntry( wxACCEL_NORMAL, WXK_F2, ID_POPUP_ZOOM_OUT ),
wxAcceleratorEntry( wxACCEL_NORMAL, WXK_F3, ID_ZOOM_REDRAW ), 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 ) ) #define ACCEL_TABLE_CNT ( sizeof( accels ) / sizeof( wxAcceleratorEntry ) )
...@@ -99,7 +95,8 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, ...@@ -99,7 +95,8 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
m_CmpListSize.x = 150; // Width of component list m_CmpListSize.x = 150; // Width of component list
m_CmpListSize.y = -1; 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_CmpListSize, 0, NULL, wxLB_HSCROLL );
m_CmpList->SetFont( *g_DialogFont ); m_CmpList->SetFont( *g_DialogFont );
m_CmpList->SetBackgroundColour( wxColour( 255, 255, 255 ) ); // Component background listbox color (white) m_CmpList->SetBackgroundColour( wxColour( 255, 255, 255 ) ); // Component background listbox color (white)
...@@ -112,7 +109,8 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, ...@@ -112,7 +109,8 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
if( m_LibList ) if( m_LibList )
ReCreateListLib(); ReCreateListLib();
DisplayLibInfos(); DisplayLibInfos();
SetAcceleratorTable( table ); if( DrawPanel )
DrawPanel->SetAcceleratorTable( table );
BestZoom(); BestZoom();
Show( TRUE ); 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