← Back to team overview

kicad-developers team mailing list archive

Add close shortcut to Library Editor -- patch

 

Show "Quit" in file menu, + close Library Editor by Ctrl-Q like
eeschema.

Regards,
--
    Yury Khalyavin
=== modified file eeschema/libeditframe.cpp
--- eeschema/libeditframe.cpp	2010-03-20 19:57:59 +0000
+++ eeschema/libeditframe.cpp	2010-07-21 05:36:11 +0000
@@ -116,6 +116,8 @@
                 WinEDA_LibeditFrame::Process_Special_Functions )
 
 /* menubar commands */
+EVT_MENU( wxID_EXIT,
+          WinEDA_LibeditFrame::CloseWindow )
 EVT_MENU( ID_LIBEDIT_SAVE_CURRENT_LIB_AS,
           WinEDA_LibeditFrame::SaveActiveLibrary )
 EVT_MENU( ID_LIBEDIT_GEN_PNG_FILE,
@@ -307,6 +309,15 @@
 
 
 /**
+ * Call close event, which process by EVT_CLOSE
+ */
+void WinEDA_LibeditFrame::CloseWindow( wxCommandEvent& WXUNUSED(event) )
+{
+    Close();
+}
+
+
+/**
  * Save library editor frame specific configuration settings.
  *
  * Don't forget to call this base method from any derived classes or the

=== modified file eeschema/libeditframe.h
--- eeschema/libeditframe.h	2010-03-28 14:46:49 +0000
+++ eeschema/libeditframe.h	2010-07-21 05:36:11 +0000
@@ -84,6 +84,7 @@
     void DisplayLibInfos();
     void RedrawActiveWindow( wxDC* DC, bool EraseBg );
     void OnCloseWindow( wxCloseEvent& Event );
+    void CloseWindow( wxCommandEvent& WXUNUSED(event) );
     void ReCreateHToolbar();
     void ReCreateVToolbar();
     void OnLeftClick( wxDC* DC, const wxPoint& MousePos );

=== modified file eeschema/menubar_libedit.cpp
--- eeschema/menubar_libedit.cpp	2010-06-30 11:15:34 +0000
+++ eeschema/menubar_libedit.cpp	2010-07-21 05:36:11 +0000
@@ -68,6 +68,16 @@
     item->SetBitmap( plot_xpm );
     filesMenu->Append( item );
 
+    /* Quit on all platforms except WXMAC */
+#if !defined(__WXMAC__)
+
+    filesMenu->AppendSeparator();
+    item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ),
+                           _( "Quit Library Editor" ) );
+    filesMenu->Append( item );
+
+#endif /* !defined( __WXMAC__) */
+
     /**
      * Edit menu
      */


Follow ups