PCBNew auxiliary tool bar changes and other minor improvements.

* Remove clearance and net class name read only text boxes from PCBNew
  auxiliary tool bar.
* Display full net class information in message panel when an object that
  supports net classes is selected.
* Move coordinate string conversion function to EDA_DRAW_FRAME object and
  made it more versatile.
* Refresh message panel text when units change.
This commit is contained in:
Wayne Stambaugh
2011-03-11 10:53:28 -05:00
parent 2f47b3f464
commit 018292a8c6
15 changed files with 86 additions and 129 deletions
+45
View File
@@ -138,6 +138,17 @@ EDA_DRAW_FRAME::~EDA_DRAW_FRAME()
}
void EDA_DRAW_FRAME::unitsChangeRefresh()
{
UpdateStatusBar();
EDA_ITEM* item = GetScreen()->GetCurItem();
if( item )
item->DisplayInfo( this );
}
void EDA_DRAW_FRAME::EraseMsgBox()
{
if( MsgPanel )
@@ -793,3 +804,37 @@ void EDA_DRAW_FRAME::ClearMsgPanel( void )
MsgPanel->EraseMsgBox();
}
wxString EDA_DRAW_FRAME::CoordinateToString( int aValue, bool aConvertToMils )
{
wxString text;
const wxChar* format;
double value = To_User_Unit( g_UserUnit, aValue, m_InternalUnits );
if( g_UserUnit == INCHES )
{
if( aConvertToMils )
{
format = ( m_InternalUnits == EESCHEMA_INTERNAL_UNIT ) ? wxT( "%.0f" ) : wxT( "%.1f" );
value *= 1000;
}
else
{
format = ( m_InternalUnits == EESCHEMA_INTERNAL_UNIT ) ? wxT( "%.3f" ) : wxT( "%.4f" );
}
}
else
{
format = ( m_InternalUnits == EESCHEMA_INTERNAL_UNIT ) ? wxT( "%.2f" ) : wxT( "%.3f" );
}
text.Printf( format, value );
if( g_UserUnit == INCHES )
text += ( aConvertToMils ) ? _( " mils" ) : _( " in" );
else
text += _( " mm" );
return text;
}