Gerbview: cosmetic enhancement: add icons in Clarify menu.
This commit is contained in:
parent
93e75af388
commit
7c52af2d50
|
@ -30,6 +30,7 @@
|
|||
#include <gr_basic.h>
|
||||
#include <common.h>
|
||||
#include <trigo.h>
|
||||
#include <bitmaps.h>
|
||||
#include <class_drawpanel.h>
|
||||
#include <msgpanel.h>
|
||||
#include <gerbview_frame.h>
|
||||
|
@ -762,6 +763,34 @@ void GERBER_DRAW_ITEM::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
}
|
||||
|
||||
|
||||
BITMAP_DEF GERBER_DRAW_ITEM::GetMenuImage() const
|
||||
{
|
||||
if( m_Flashed )
|
||||
return pad_xpm;
|
||||
|
||||
switch( m_Shape )
|
||||
{
|
||||
case GBR_SEGMENT:
|
||||
case GBR_ARC:
|
||||
case GBR_CIRCLE:
|
||||
return add_line_xpm;
|
||||
|
||||
case GBR_SPOT_OVAL:
|
||||
case GBR_SPOT_CIRCLE:
|
||||
case GBR_SPOT_RECT:
|
||||
case GBR_SPOT_POLY:
|
||||
case GBR_SPOT_MACRO:
|
||||
// should be handles by m_Flashed == true
|
||||
return pad_xpm;
|
||||
|
||||
case GBR_POLYGON:
|
||||
return add_graphical_polygon_xpm;
|
||||
}
|
||||
|
||||
return info_xpm;
|
||||
}
|
||||
|
||||
|
||||
bool GERBER_DRAW_ITEM::HitTest( const wxPoint& aRefPos ) const
|
||||
{
|
||||
// In case the item has a very tiny width defined, allow it to be selected
|
||||
|
|
|
@ -322,8 +322,11 @@ public:
|
|||
///> @copydoc EDA_ITEM::Visit()
|
||||
SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
|
||||
|
||||
///> @copydoc EDA_ITEM::GetSelectMenuText()
|
||||
virtual wxString GetSelectMenuText() const override;
|
||||
|
||||
///> @copydoc EDA_ITEM::GetMenuImage()
|
||||
BITMAP_DEF GetMenuImage() const override;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -657,10 +657,11 @@ EDA_ITEM* GERBVIEW_SELECTION_TOOL::disambiguationMenu( GERBER_COLLECTOR* aCollec
|
|||
wxString text;
|
||||
EDA_ITEM* item = ( *aCollector )[i];
|
||||
text = item->GetSelectMenuText();
|
||||
menu.Add( text, i + 1 );
|
||||
menu.Add( text, i + 1, item->GetMenuImage() );
|
||||
}
|
||||
|
||||
menu.SetTitle( _( "Clarify selection" ) );
|
||||
menu.SetIcon( info_xpm );
|
||||
menu.DisplayTitle( true );
|
||||
SetContextMenu( &menu, CMENU_NOW );
|
||||
|
||||
|
|
Loading…
Reference in New Issue