Using MenuText() in onrightclick.cpp

This commit is contained in:
dickelbeck 2007-09-14 18:32:24 +00:00
parent a98b11afd8
commit cd81e546e4
3 changed files with 9 additions and 31 deletions

View File

@ -10,6 +10,7 @@ email address.
+ pcbnew + pcbnew
* controle.cpp, added Function AllAreModulesAndReturnSmallestIfSo() which is * controle.cpp, added Function AllAreModulesAndReturnSmallestIfSo() which is
called from PcbGeneralLocateAndDisplay() called from PcbGeneralLocateAndDisplay()
* onrightclick.cpp changed to calls to BOARD_ITEM::MenuText()
2007-Sep-13 UPDATE Dick Hollenbeck <dick@softplc.com> 2007-Sep-13 UPDATE Dick Hollenbeck <dick@softplc.com>

View File

@ -630,11 +630,9 @@ void CreatePopUpMenuForFootprints( MODULE* aModule, wxMenu* menu, bool full_menu
*/ */
{ {
wxMenu* sub_menu_footprint; wxMenu* sub_menu_footprint;
wxString msg;
int flags = aModule->m_Flags; int flags = aModule->m_Flags;
msg = _( "Footprint" ); wxString msg = aModule->MenuText();
msg << wxT( " " ) << aModule->GetReference();
sub_menu_footprint = new wxMenu; sub_menu_footprint = new wxMenu;
@ -672,27 +670,12 @@ void CreatePopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* menu )
*/ */
{ {
wxMenu* sub_menu_Fp_text; wxMenu* sub_menu_Fp_text;
wxString msg;
int flags = FpText->m_Flags; int flags = FpText->m_Flags;
switch( FpText->m_Type ) wxString msg = FpText->MenuText();
{
case TEXT_is_REFERENCE:
msg = _( "Footprint ref" );
break;
case TEXT_is_VALUE:
msg = _( "Footprint value" );
break;
default:
msg = _( "Footprint text" );
break;
}
msg << wxT( " " ) << FpText->m_Text;
sub_menu_Fp_text = new wxMenu; sub_menu_Fp_text = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_Fp_text, -1, msg, footprint_text_xpm ); ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_Fp_text, -1, msg, footprint_text_xpm );
if( !flags ) if( !flags )
@ -716,11 +699,9 @@ void CreatePopUpMenuForPads( D_PAD* Pad, wxMenu* menu )
/* Create pop menu for pads */ /* Create pop menu for pads */
{ {
wxMenu* sub_menu_Pad; wxMenu* sub_menu_Pad;
wxString msg;
int flags = Pad->m_Flags; int flags = Pad->m_Flags;
msg = _( "Pad" ); wxString msg = Pad->MenuText();
msg << wxT( " " ) << Pad->ReturnStringPadName();
sub_menu_Pad = new wxMenu; sub_menu_Pad = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_Pad, -1, msg, pad_xpm ); ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_Pad, -1, msg, pad_xpm );
@ -757,16 +738,12 @@ void CreatePopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu )
/* Create pop menu for pcb texts */ /* Create pop menu for pcb texts */
{ {
wxMenu* sub_menu_Text; wxMenu* sub_menu_Text;
wxString msg;
int flags = Text->m_Flags; int flags = Text->m_Flags;
msg = _( "Pcb Text" ); msg << wxT( " " ); wxString msg = Text->MenuText();
if( Text->m_Text.Len() < 8 )
msg << Text->m_Text;
else
msg += Text->m_Text.Left( 5 ) + wxT( ".." );
sub_menu_Text = new wxMenu; sub_menu_Text = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_Text, -1, msg, add_text_xpm ); ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_Text, -1, msg, add_text_xpm );
if( !flags ) if( !flags )

View File

@ -19,7 +19,7 @@ referenced. I think this would be an easier way to manage xpms.
*** @todo: grep for @todo and finish off those tasks, scattered throughout the source. *** @todo: grep for @todo and finish off those tasks, scattered throughout the source.
*** use BOARD_ITEM::MenuText() and MenuIcon() in the onrightclick.cpp *** use BOARD_ITEM::MenuIcon() in the onrightclick.cpp
*** make the ADD_MENUITEM macros in include/macros.h be static inline functions instead *** make the ADD_MENUITEM macros in include/macros.h be static inline functions instead