Commit 787cf585 authored by dickelbeck's avatar dickelbeck

MenuText() tweaks, beautification

parent f5fd16e2
...@@ -26,10 +26,16 @@ email address. ...@@ -26,10 +26,16 @@ email address.
2007-Oct-10 UPDATE Dick Hollenbeck <dick@softplc.com> 2007-Oct-10 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
+ pcbnew + pcbnew
* prevent OnRightClick() from calling PcbGeneralLocateAndDisplay() when creating * bug fix: prevent OnRightClick() from calling PcbGeneralLocateAndDisplay()
a new track. when creating a new track.
* bug fix: popup menu was not handling Mires, because the collector was not * bug fix: popup menu was not handling Mires, because the collector was not
being asked to find them. being asked to find them.
* added TRACK::ShowWidth() and call it from BOARD_ITEM::MenuText(). There was
not enough information in Selection Clarification at a busy junction to
make a reasonable choice.
* SEGVIA::MenuText() shows via width, rather than net_code.
* Beautified ratsnets.cpp, I would like to understand it better. It would help
if the comments were in English.
+ all + all
* Changed English UI text "Mire" to "Target" according to this post: * Changed English UI text "Mire" to "Target" according to this post:
http://tech.groups.yahoo.com/group/kicad-users/message/1380 http://tech.groups.yahoo.com/group/kicad-users/message/1380
......
...@@ -438,12 +438,10 @@ void valeur_param( int valeur, wxString& buf_texte ) ...@@ -438,12 +438,10 @@ void valeur_param( int valeur, wxString& buf_texte )
{ {
if( g_UnitMetric ) if( g_UnitMetric )
{ {
buf_texte.Printf( wxT( "%3.3f " ), (float) valeur * 0.00254 ); buf_texte.Printf( wxT( "%3.3f mm" ), valeur * 0.00254 );
buf_texte << wxT( "mm" );
} }
else else
{ {
buf_texte.Printf( wxT( "%2.4f " ), (float) valeur * 0.0001 ); buf_texte.Printf( wxT( "%2.4f \"" ), valeur * 0.0001 );
buf_texte << wxT( "\" " );
} }
} }
...@@ -1369,7 +1369,7 @@ private: ...@@ -1369,7 +1369,7 @@ private:
/** /**
* Struct MsgItem * Struct MsgItem
* is used privately by WinEDA_MsgPanel as the item type its vector. * is used privately by WinEDA_MsgPanel as the item type of its vector.
* These items are the pairs of text strings shown in the MsgPanel. * These items are the pairs of text strings shown in the MsgPanel.
*/ */
struct MsgItem struct MsgItem
......
...@@ -124,8 +124,8 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -124,8 +124,8 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
break; break;
case TYPETRACK: case TYPETRACK:
text << _( "Track" ) << wxT( " " ); text << _( "Track" ) << wxT( " " ) << ((TRACK*)item)->ShowWidth();
net = aPcb->FindNet( ( (TRACK*) item )->m_NetCode ); net = aPcb->FindNet( ((TRACK*)item)->m_NetCode );
if( net ) if( net )
{ {
text << wxT( " [" ) << net->m_Netname << wxT( "]" ); text << wxT( " [" ) << net->m_Netname << wxT( "]" );
...@@ -151,7 +151,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -151,7 +151,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
case TYPEVIA: case TYPEVIA:
{ {
SEGVIA* via = (SEGVIA*) item; SEGVIA* via = (SEGVIA*) item;
text << _( "Via" ) << wxT( " " ) << via->m_NetCode; text << _( "Via" ) << wxT( " " ) << via->ShowWidth();
int shape = via->Shape(); int shape = via->Shape();
if( shape == VIA_ENTERREE ) if( shape == VIA_ENTERREE )
......
...@@ -35,6 +35,26 @@ TRACK::TRACK( BOARD_ITEM* StructFather, KICAD_T idtype ) : ...@@ -35,6 +35,26 @@ TRACK::TRACK( BOARD_ITEM* StructFather, KICAD_T idtype ) :
} }
wxString TRACK::ShowWidth()
{
wxString msg;
#if 0
double value = To_User_Unit( g_UnitMetric, m_Width, PCB_INTERNAL_UNIT );
if( g_UnitMetric == INCHES ) // Affichage en mils
msg.Printf( wxT( "%.1f" ), value * 1000 );
else
msg.Printf( wxT( "%.3f" ), value );
#else
valeur_param( m_Width, msg );
#endif
return msg;
}
SEGZONE::SEGZONE( BOARD_ITEM* StructFather ) : SEGZONE::SEGZONE( BOARD_ITEM* StructFather ) :
TRACK( StructFather, TYPEZONE ) TRACK( StructFather, TYPEZONE )
......
...@@ -119,6 +119,12 @@ public: ...@@ -119,6 +119,12 @@ public:
void Display_Infos( WinEDA_DrawFrame* frame ); void Display_Infos( WinEDA_DrawFrame* frame );
/**
* Function ShowWidth
* returns the width of the track in displayable user units.
*/
wxString ShowWidth();
/** /**
* Function Visit * Function Visit
* is re-implemented here because TRACKs and SEGVIAs are in the same list * is re-implemented here because TRACKs and SEGVIAs are in the same list
......
...@@ -132,12 +132,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -132,12 +132,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
break; break;
case ID_PCB_SHOW_1_RATSNEST_BUTT: case ID_PCB_SHOW_1_RATSNEST_BUTT:
#if 0
DrawStruct = m_Pcb->FindPadOrModule( GetScreen()->RefPos(true),
GetScreen()->m_Active_Layer );
#else
DrawStruct = PcbGeneralLocateAndDisplay(); DrawStruct = PcbGeneralLocateAndDisplay();
#endif
Show_1_Ratsnest( DrawStruct, DC ); Show_1_Ratsnest( DrawStruct, DC );
if( DrawStruct ) if( DrawStruct )
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment