From 01d3c72dda7d9b829eb9f59c962355770556c39c Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 15 Aug 2016 20:22:54 +0200 Subject: [PATCH] Cosmetic enhancement: add a dismiss icon to clarification menu "title" (the "title" is also the close menu command) --- bitmaps_png/CMakeLists.txt | 1 + bitmaps_png/cpp_26/dismiss.cpp | 65 +++++++++++++++++++++++++ bitmaps_png/sources/dismiss.svg | 84 +++++++++++++++++++++++++++++++++ eeschema/controle.cpp | 6 +-- eeschema/libeditframe.cpp | 4 +- include/bitmaps.h | 1 + pcbnew/controle.cpp | 12 +---- pcbnew/modedit.cpp | 18 ++----- 8 files changed, 163 insertions(+), 28 deletions(-) create mode 100644 bitmaps_png/cpp_26/dismiss.cpp create mode 100644 bitmaps_png/sources/dismiss.svg diff --git a/bitmaps_png/CMakeLists.txt b/bitmaps_png/CMakeLists.txt index d27cc21898..7489d0732b 100644 --- a/bitmaps_png/CMakeLists.txt +++ b/bitmaps_png/CMakeLists.txt @@ -216,6 +216,7 @@ set( BMAPS_MID delete_track delete directory + dismiss display_options down drag_module diff --git a/bitmaps_png/cpp_26/dismiss.cpp b/bitmaps_png/cpp_26/dismiss.cpp new file mode 100644 index 0000000000..e8ed4635f8 --- /dev/null +++ b/bitmaps_png/cpp_26/dismiss.cpp @@ -0,0 +1,65 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x02, 0xfc, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0x63, 0x60, 0x20, 0x15, 0x6c, + 0x66, 0xe0, 0x62, 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0x8a, 0x02, 0xe2, 0x6c, + 0x20, 0xae, 0x00, 0x1a, 0x5c, 0x06, 0x34, 0x38, 0x13, 0xc8, 0x0e, 0x22, 0x3e, 0x98, 0xe8, 0x04, + 0x00, 0xed, 0xfc, 0x4d, 0x6b, 0x01, 0x23, 0x3d, 0xb9, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, + 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE dismiss_xpm[1] = {{ png, sizeof( png ), "dismiss_xpm" }}; + +//EOF diff --git a/bitmaps_png/sources/dismiss.svg b/bitmaps_png/sources/dismiss.svg new file mode 100644 index 0000000000..1dd0f58015 --- /dev/null +++ b/bitmaps_png/sources/dismiss.svg @@ -0,0 +1,84 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/eeschema/controle.cpp b/eeschema/controle.cpp index 792f213999..ba5ec747d6 100644 --- a/eeschema/controle.cpp +++ b/eeschema/controle.cpp @@ -161,9 +161,9 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, const KICAD_T aF wxT( "Select item clarification context menu size limit exceeded." ) ); wxMenu selectMenu; - wxMenuItem* title = new wxMenuItem( &selectMenu, wxID_NONE, _( "Clarify Selection" ) ); - selectMenu.Append( title ); + AddMenuItem( &selectMenu, wxID_NONE, _( "Clarify Selection" ), + KiBitmap( dismiss_xpm ) ); selectMenu.AppendSeparator(); for( int i = 0; i < m_collectedItems.GetCount() && i < MAX_SELECT_ITEM_IDS; i++ ) @@ -173,7 +173,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, const KICAD_T aF AddMenuItem( &selectMenu, ID_SELECT_ITEM_START + i, text, KiBitmap( xpm ) ); } - // Set to NULL in case user aborts the clarification context menu. + // Set to NULL in case the user aborts the clarification context menu. GetScreen()->SetCurItem( NULL ); m_canvas->SetAbortRequest( true ); // Changed to false if an item is selected PopupMenu( &selectMenu ); diff --git a/eeschema/libeditframe.cpp b/eeschema/libeditframe.cpp index e89fd95ac7..4e67d4e6ff 100644 --- a/eeschema/libeditframe.cpp +++ b/eeschema/libeditframe.cpp @@ -1275,9 +1275,9 @@ LIB_ITEM* LIB_EDIT_FRAME::locateItem( const wxPoint& aPosition, const KICAD_T aF wxT( "Select item clarification context menu size limit exceeded." ) ); wxMenu selectMenu; - wxMenuItem* title = new wxMenuItem( &selectMenu, wxID_NONE, _( "Clarify Selection" ) ); + AddMenuItem( &selectMenu, wxID_NONE, _( "Clarify Selection" ), + KiBitmap( dismiss_xpm ) ); - selectMenu.Append( title ); selectMenu.AppendSeparator(); for( int i = 0; i < m_collectedItems.GetCount() && i < MAX_SELECT_ITEM_IDS; i++ ) diff --git a/include/bitmaps.h b/include/bitmaps.h index 92422380f1..ee6de93d50 100644 --- a/include/bitmaps.h +++ b/include/bitmaps.h @@ -172,6 +172,7 @@ EXTERN_BITMAP( delete_track_xpm ) EXTERN_BITMAP( delete_xpm ) EXTERN_BITMAP( dialog_warning_xpm ) EXTERN_BITMAP( directory_xpm ) +EXTERN_BITMAP( dismiss_xpm ) EXTERN_BITMAP( display_options_xpm ) EXTERN_BITMAP( down_xpm ) EXTERN_BITMAP( ortho_xpm ) diff --git a/pcbnew/controle.cpp b/pcbnew/controle.cpp index c7b231b9fa..760b1d7311 100644 --- a/pcbnew/controle.cpp +++ b/pcbnew/controle.cpp @@ -228,16 +228,8 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode ) wxMenu itemMenu; // Give a title to the selection menu. This is also a cancel menu item - wxMenuItem * item_title = new wxMenuItem( &itemMenu, -1, _( "Selection Clarification" ) ); - -#ifdef __WINDOWS__ - wxFont bold_font( *wxNORMAL_FONT ); - bold_font.SetWeight( wxFONTWEIGHT_BOLD ); - bold_font.SetStyle( wxFONTSTYLE_ITALIC ); - item_title->SetFont( bold_font ); -#endif - - itemMenu.Append( item_title ); + AddMenuItem( &itemMenu, wxID_NONE, _( "Clarify Selection" ), + KiBitmap( dismiss_xpm ) ); itemMenu.AppendSeparator(); int limit = std::min( MAX_ITEMS_IN_PICKER, m_Collector->GetCount() ); diff --git a/pcbnew/modedit.cpp b/pcbnew/modedit.cpp index bd84590725..cf0d77ee25 100644 --- a/pcbnew/modedit.cpp +++ b/pcbnew/modedit.cpp @@ -128,16 +128,8 @@ BOARD_ITEM* FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay( int aHotKeyCode ) wxMenu itemMenu; // Give a title to the selection menu. It also allow to close the popup menu without any action - wxMenuItem* item_title = new wxMenuItem( &itemMenu, wxID_NONE, _( "Selection Clarification" ) ); - -#ifdef __WINDOWS__ - wxFont bold_font( *wxNORMAL_FONT ); - bold_font.SetWeight( wxFONTWEIGHT_BOLD ); - bold_font.SetStyle( wxFONTSTYLE_ITALIC ); - item_title->SetFont( bold_font ); -#endif - - itemMenu.Append( item_title ); + AddMenuItem( &itemMenu, wxID_NONE, _( "Clarify Selection" ), + KiBitmap( dismiss_xpm ) ); itemMenu.AppendSeparator(); int limit = std::min( MAX_ITEMS_IN_PICKER, m_Collector->GetCount() ); @@ -159,7 +151,7 @@ BOARD_ITEM* FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay( int aHotKeyCode ) // PCB_BASE_FRAME::ProcessItemSelection() // and it calls SetCurItem() which in turn calls DisplayInfo() on the // item. - m_canvas->SetAbortRequest( true ); // changed in false if an item + m_canvas->SetAbortRequest( true ); // changed in false if an item is selected PopupMenu( &itemMenu ); // m_AbortRequest = false if an item is selected m_canvas->MoveCursorToCrossHair(); @@ -464,7 +456,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) if( pcbframe->IsGalCanvasActive() ) { KIGFX::VIEW* view = pcbframe->GetGalCanvas()->GetView(); - source_module->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, view, + source_module->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, view, std::placeholders::_1 ) ); view->Remove( source_module ); } @@ -499,7 +491,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ratsnest->Recalculate(); KIGFX::VIEW* view = pcbframe->GetGalCanvas()->GetView(); - newmodule->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, + newmodule->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, std::placeholders::_1 ) ); view->Add( newmodule ); pcbframe->GetGalCanvas()->ForceRefresh();