kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #05018
Re: Add close shortcut to Library Editor -- patch
On 07/21/2010 01:11 AM, Yury Khalyavin wrote:
> === 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
> + */
This comment should go in the header file, not in the C++ file, for the benefit of
"one place of comment maintenance" and for access by doxygen. Doxygen
is configured to pick from the header file the function comments, as a higher priority
than from the C++ file.
/**
* Function CloseWindow
* will close the window.
*/
Doxygen puts the above text in a single sentence which reads well.
"Function CloseWindow will close the window."
> +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 */
Please say why not a MAC, and use C++ comments for single line ones.
> +#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
References