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
* controle.cpp, added Function AllAreModulesAndReturnSmallestIfSo() which is
called from PcbGeneralLocateAndDisplay()
* onrightclick.cpp changed to calls to BOARD_ITEM::MenuText()
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;
wxString msg;
int flags = aModule->m_Flags;
msg = _( "Footprint" );
msg << wxT( " " ) << aModule->GetReference();
wxString msg = aModule->MenuText();
sub_menu_footprint = new wxMenu;
@ -672,27 +670,12 @@ void CreatePopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* menu )
*/
{
wxMenu* sub_menu_Fp_text;
wxString msg;
int flags = FpText->m_Flags;
switch( FpText->m_Type )
{
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;
wxString msg = FpText->MenuText();
sub_menu_Fp_text = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_Fp_text, -1, msg, footprint_text_xpm );
if( !flags )
@ -716,11 +699,9 @@ void CreatePopUpMenuForPads( D_PAD* Pad, wxMenu* menu )
/* Create pop menu for pads */
{
wxMenu* sub_menu_Pad;
wxString msg;
int flags = Pad->m_Flags;
msg = _( "Pad" );
msg << wxT( " " ) << Pad->ReturnStringPadName();
wxString msg = Pad->MenuText();
sub_menu_Pad = new wxMenu;
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 */
{
wxMenu* sub_menu_Text;
wxString msg;
int flags = Text->m_Flags;
msg = _( "Pcb Text" ); msg << wxT( " " );
if( Text->m_Text.Len() < 8 )
msg << Text->m_Text;
else
msg += Text->m_Text.Left( 5 ) + wxT( ".." );
wxString msg = Text->MenuText();
sub_menu_Text = new wxMenu;
ADD_MENUITEM_WITH_SUBMENU( menu, sub_menu_Text, -1, msg, add_text_xpm );
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.
*** 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