Commit ccbce931 authored by charras's avatar charras

All: better look when displaying info on messages panel

parent 56059efd
......@@ -122,6 +122,9 @@ void WinEDA_MsgPanel::AppendMessage( const wxString& textUpper,
m_Items.push_back( item );
m_last_x += computeTextSize( text ).x;
// Add an extra space between texts for a better look:
m_last_x += m_fontSize.x;
Refresh();
}
......
......@@ -1026,31 +1026,28 @@ void SCH_COMPONENT::DisplayInfo( WinEDA_DrawFrame* frame )
LIB_COMPONENT* Entry = CMP_LIBRARY::FindLibraryComponent( m_ChipName );
wxString msg;
WinEDA_MsgPanel *msgpanel = frame->MsgPanel;
frame->MsgPanel->EraseMsgBox();
msgpanel->EraseMsgBox();
Affiche_1_Parametre( frame, 1, _( "Ref" ),
GetRef(((WinEDA_SchematicFrame*)frame)->GetSheet()),
DARKCYAN );
msg = GetRef(((WinEDA_SchematicFrame*)frame)->GetSheet());
msgpanel->AppendMessage( _( "Ref" ), msg, DARKCYAN );
if( Entry && Entry->m_Options == ENTRY_POWER )
msg = _( "Pwr Symb" );
else
msg = _( "Val" );
Affiche_1_Parametre( frame, 10, msg, GetField( VALUE )->m_Text, DARKCYAN );
msgpanel->AppendMessage( msg, GetField( VALUE )->m_Text, DARKCYAN );
Affiche_1_Parametre( frame, 28, _( "RefLib" ), m_ChipName.GetData(), BROWN );
msgpanel->AppendMessage( _( "RefLib" ), m_ChipName.GetData(), BROWN );
msg = Entry->GetLibraryName();
Affiche_1_Parametre( frame, 40, _( "Lib" ), msg, DARKRED );
msgpanel->AppendMessage( _( "Lib" ), msg, DARKRED );
if( Entry )
{
Affiche_1_Parametre( frame, 52, Entry->m_Doc, Entry->m_KeyWord,
DARKCYAN );
}
msgpanel->AppendMessage( Entry->m_Doc, Entry->m_KeyWord, DARKCYAN );
}
/** virtual function Mirror_Y
......
......@@ -57,21 +57,18 @@ MARKER_PCB::~MARKER_PCB()
void MARKER_PCB::DisplayInfo( WinEDA_DrawFrame* frame )
{
int text_pos;
frame->MsgPanel->EraseMsgBox();
WinEDA_MsgPanel *msgpanel = frame->MsgPanel;
msgpanel->EraseMsgBox();
const DRC_ITEM& rpt = m_drc;
text_pos = 1;
Affiche_1_Parametre( frame, text_pos, _( "Type" ), _("Marker"), DARKCYAN );
msgpanel->AppendMessage( _( "Type" ), _("Marker"), DARKCYAN );
wxString errorTxt;
errorTxt << _("ErrType") << wxT("(") << rpt.GetErrorCode() << wxT(")- ") << rpt.GetErrorText() << wxT(":");
text_pos = 5;
Affiche_1_Parametre( frame, text_pos, errorTxt, wxEmptyString, RED );
msgpanel->AppendMessage( errorTxt, wxEmptyString, RED );
wxString txtA;
txtA << DRC_ITEM::ShowCoord( rpt.GetPointA() ) << wxT(": ") << rpt.GetTextA();
......@@ -80,8 +77,7 @@ void MARKER_PCB::DisplayInfo( WinEDA_DrawFrame* frame )
if ( rpt.HasSecondItem() )
txtB << DRC_ITEM::ShowCoord( rpt.GetPointB() ) << wxT(": ") << rpt.GetTextB();
text_pos = 25;
Affiche_1_Parametre( frame, text_pos, txtA, txtB, DARKBROWN );
msgpanel->AppendMessage( txtA, txtB, DARKBROWN );
}
/**
......
......@@ -797,21 +797,19 @@ void MODULE::DisplayInfo( WinEDA_DrawFrame* frame )
{
int nbpad;
char bufcar[512], Line[512];
int pos;
bool flag = FALSE;
wxString msg;
BOARD* board = (BOARD*) m_Parent;
WinEDA_MsgPanel *msgpanel = frame->MsgPanel;
frame->MsgPanel->EraseMsgBox(); /* Effacement de la zone message */
msgpanel->EraseMsgBox();
if( frame->m_Ident != PCB_FRAME )
flag = TRUE;
pos = 1;
Affiche_1_Parametre( frame, pos, m_Reference->m_Text, m_Value->m_Text,
msgpanel->AppendMessage( m_Reference->m_Text, m_Value->m_Text,
DARKCYAN );
/* Affiche signature temporelle ou date de modif (en edition de modules) */
pos += 6;
if( flag ) // Affichage date de modification (utile en Module Editor)
if( flag ) // Display last date the component was edited( useful in Module Editor)
{
time_t edit_time = m_LastEdit_Time;
strcpy( Line, ctime( &edit_time ) );
......@@ -821,20 +819,16 @@ void MODULE::DisplayInfo( WinEDA_DrawFrame* frame )
strtok( NULL, " \n\r" );
strcat( bufcar, strtok( NULL, " \n\r" ) );
msg = CONV_FROM_UTF8( bufcar );
Affiche_1_Parametre( frame, pos, _( "Last Change" ), msg, BROWN );
pos += 4;
msgpanel->AppendMessage( _( "Last Change" ), msg, BROWN );
}
else
else // displa time stamp in schematic
{
msg.Printf( wxT( "%8.8lX" ), m_TimeStamp );
Affiche_1_Parametre( frame, pos, _( "Netlist path" ), m_Path, BROWN );
msgpanel->AppendMessage( _( "Netlist path" ), m_Path, BROWN );
}
pos += 12;
Affiche_1_Parametre( frame, pos, _( "Layer" ),
board->GetLayerName( m_Layer ), RED );
msgpanel->AppendMessage( _( "Layer" ), board->GetLayerName( m_Layer ), RED );
pos += 6;
EDA_BaseStruct* PtStruct = m_Pads;
nbpad = 0;
while( PtStruct )
......@@ -844,34 +838,29 @@ void MODULE::DisplayInfo( WinEDA_DrawFrame* frame )
}
msg.Printf( wxT( "%d" ), nbpad );
Affiche_1_Parametre( frame, pos, _( "Pads" ), msg, BLUE );
msgpanel->AppendMessage( _( "Pads" ), msg, BLUE );
pos += 4;
msg = wxT( ".." );
if( IsLocked() )
msg[0] = 'L';
if( m_ModuleStatus & MODULE_is_PLACED )
msg[1] = 'P';
Affiche_1_Parametre( frame, pos, _( "Stat" ), msg, MAGENTA );
msgpanel->AppendMessage( _( "Stat" ), msg, MAGENTA );
pos += 4;
msg.Printf( wxT( "%.1f" ), (float) m_Orient / 10 );
Affiche_1_Parametre( frame, pos, _( "Orient" ), msg, BROWN );
msgpanel->AppendMessage( _( "Orient" ), msg, BROWN );
pos += 5;
Affiche_1_Parametre( frame, pos, _( "Module" ), m_LibRef, BLUE );
msgpanel->AppendMessage( _( "Module" ), m_LibRef, BLUE );
pos += 9;
if( m_3D_Drawings != NULL )
msg = m_3D_Drawings->m_Shape3DName;
else
msg = _("No 3D shape");
Affiche_1_Parametre( frame, pos, _( "3D-Shape" ), msg, RED );
msgpanel->AppendMessage( _( "3D-Shape" ), msg, RED );
pos += 14;
wxString doc = _( "Doc: " ) + m_Doc;
wxString keyword = _( "KeyW: " ) + m_KeyWord;
Affiche_1_Parametre( frame, pos, doc, keyword, BLACK );
msgpanel->AppendMessage( doc, keyword, BLACK );
}
......
......@@ -436,7 +436,6 @@ void D_PAD::DisplayInfo( WinEDA_DrawFrame* frame )
int ii;
MODULE* module;
wxString Line;
int pos = 1;
/* Pad messages */
static const wxString Msg_Pad_Shape[6] =
......@@ -453,26 +452,24 @@ void D_PAD::DisplayInfo( WinEDA_DrawFrame* frame )
{ wxT( "norm" ), wxT( "smd " ), wxT( "conn" ), wxT( "????" ) };
frame->MsgPanel->EraseMsgBox();
WinEDA_MsgPanel *msgpanel = frame->MsgPanel;
msgpanel->EraseMsgBox();
/* Recherche du module correspondant */
module = (MODULE*) m_Parent;
if( module )
{
wxString msg = module->GetReference();
Affiche_1_Parametre( frame, pos, _( "Module" ), msg, DARKCYAN );
msgpanel->AppendMessage( _( "Module" ), msg, DARKCYAN );
ReturnStringPadName( Line );
pos += 8;
Affiche_1_Parametre( frame, pos, _( "RefP" ), Line, BROWN );
msgpanel->AppendMessage( _( "RefP" ), Line, BROWN );
}
pos += 4;
Affiche_1_Parametre( frame, pos, _( "Net" ), m_Netname, DARKCYAN );
msgpanel->AppendMessage( _( "Net" ), m_Netname, DARKCYAN );
/* For test and debug only: display m_physical_connexion and m_logical_connexion */
pos += 10;
#if 1 // Used only to debug connectivity calculations
Line.Printf( wxT( "%d-%d-%d " ), GetSubRatsnest(), GetSubNet(), m_ZoneSubnet );
Affiche_1_Parametre( frame, pos, wxT( "L-P-Z" ), Line, DARKGREEN );
msgpanel->AppendMessage( wxT( "L-P-Z" ), Line, DARKGREEN );
#endif
wxString LayerInfo;
......@@ -549,32 +546,24 @@ void D_PAD::DisplayInfo( WinEDA_DrawFrame* frame )
break;
}
}
pos += 3;
Affiche_1_Parametre( frame, pos, _( "Layer" ), LayerInfo, DARKGREEN );
msgpanel->AppendMessage( _( "Layer" ), LayerInfo, DARKGREEN );
pos += 6;
int attribut = m_Attribut & 15;
if( attribut > 3 )
attribut = 3;
Affiche_1_Parametre( frame,
pos,
Msg_Pad_Shape[m_PadShape],
Msg_Pad_Attribut[attribut],
DARKGREEN );
msgpanel->AppendMessage( Msg_Pad_Shape[m_PadShape],
Msg_Pad_Attribut[attribut], DARKGREEN );
valeur_param( m_Size.x, Line );
pos += 6;
Affiche_1_Parametre( frame, pos, _( "H Size" ), Line, RED );
msgpanel->AppendMessage( _( "H Size" ), Line, RED );
valeur_param( m_Size.y, Line );
pos += 7;
Affiche_1_Parametre( frame, pos, _( "V Size" ), Line, RED );
msgpanel->AppendMessage( _( "V Size" ), Line, RED );
pos += 7;
valeur_param( (unsigned) m_Drill.x, Line );
if( m_DrillShape == PAD_CIRCLE )
{
Affiche_1_Parametre( frame, pos, _( "Drill" ), Line, RED );
msgpanel->AppendMessage( _( "Drill" ), Line, RED );
}
else
{
......@@ -582,7 +571,7 @@ void D_PAD::DisplayInfo( WinEDA_DrawFrame* frame )
wxString msg;
valeur_param( (unsigned) m_Drill.y, msg );
Line += wxT( " / " ) + msg;
Affiche_1_Parametre( frame, pos, _( "Drill X / Y" ), Line, RED );
msgpanel->AppendMessage( _( "Drill X / Y" ), Line, RED );
}
......@@ -592,16 +581,13 @@ void D_PAD::DisplayInfo( WinEDA_DrawFrame* frame )
(float) ( m_Orient - module_orient ) / 10, (float) module_orient / 10 );
else
Line.Printf( wxT( "%3.1f" ), (float) m_Orient / 10 );
pos += 8;
Affiche_1_Parametre( frame, pos, _( "Orient" ), Line, BLUE );
msgpanel->AppendMessage( _( "Orient" ), Line, BLUE );
valeur_param( m_Pos.x, Line );
pos += 8;
Affiche_1_Parametre( frame, pos, _( "X Pos" ), Line, BLUE );
msgpanel->AppendMessage( _( "X Pos" ), Line, BLUE );
valeur_param( m_Pos.y, Line );
pos += 6;
Affiche_1_Parametre( frame, pos, _( "Y pos" ), Line, BLUE );
msgpanel->AppendMessage( _( "Y pos" ), Line, BLUE );
}
......
......@@ -231,34 +231,33 @@ void TEXTE_PCB::DisplayInfo( WinEDA_DrawFrame* frame )
board = (BOARD*) parent;
wxASSERT( board );
frame->MsgPanel->EraseMsgBox();
WinEDA_MsgPanel *msgpanel = frame->MsgPanel;
msgpanel->EraseMsgBox();
if( m_Parent && m_Parent->Type() == TYPE_COTATION )
Affiche_1_Parametre( frame, 1, _( "COTATION" ), m_Text, DARKGREEN );
msgpanel->AppendMessage( _( "COTATION" ), m_Text, DARKGREEN );
else
Affiche_1_Parametre( frame, 1, _( "PCB Text" ), m_Text, DARKGREEN );
msgpanel->AppendMessage( _( "PCB Text" ), m_Text, DARKGREEN );
Affiche_1_Parametre( frame, 28, _( "Layer" ),
board->GetLayerName( m_Layer ),
g_DesignSettings.m_LayerColor[m_Layer] & MASKCOLOR );
msgpanel->AppendMessage( _( "Layer" ),
board->GetLayerName( m_Layer ), BLUE );
Affiche_1_Parametre( frame, 36, _( "Mirror" ), wxEmptyString, GREEN );
if( !m_Mirror )
Affiche_1_Parametre( frame, -1, wxEmptyString, _( "No" ), DARKGREEN );
msgpanel->AppendMessage( _( "Mirror" ), _( "No" ), DARKGREEN );
else
Affiche_1_Parametre( frame, -1, wxEmptyString, _( "Yes" ), DARKGREEN );
msgpanel->AppendMessage( _( "Mirror" ), _( "Yes" ), DARKGREEN );
msg.Printf( wxT( "%.1f" ), (float) m_Orient / 10 );
Affiche_1_Parametre( frame, 43, _( "Orient" ), msg, DARKGREEN );
msgpanel->AppendMessage( _( "Orient" ), msg, DARKGREEN );
valeur_param( m_Width, msg );
Affiche_1_Parametre( frame, 50, _( "Width" ), msg, MAGENTA );
msgpanel->AppendMessage( _( "Width" ), msg, MAGENTA );
valeur_param( m_Size.x, msg );
Affiche_1_Parametre( frame, 60, _( "H Size" ), msg, RED );
msgpanel->AppendMessage( _( "H Size" ), msg, RED );
valeur_param( m_Size.y, msg );
Affiche_1_Parametre( frame, 70, _( "V Size" ), msg, RED );
msgpanel->AppendMessage( _( "V Size" ), msg, RED );
}
/**
......
......@@ -904,13 +904,13 @@ void ZONE_CONTAINER::DisplayInfo( WinEDA_DrawFrame* frame )
/************************************************************/
{
wxString msg;
int text_pos;
BOARD* board = (BOARD*) m_Parent;
WinEDA_MsgPanel *msgpanel = frame->MsgPanel;
wxASSERT( board );
frame->MsgPanel->EraseMsgBox();
msgpanel->EraseMsgBox();
msg = _( "Zone Outline" );
......@@ -918,10 +918,7 @@ void ZONE_CONTAINER::DisplayInfo( WinEDA_DrawFrame* frame )
if( ncont )
msg << wxT( " " ) << _( "(Cutout)" );
text_pos = 1;
Affiche_1_Parametre( frame, text_pos, _( "Type" ), msg, DARKCYAN );
text_pos += 15;
msgpanel->AppendMessage( _( "Type" ), msg, DARKCYAN );
if( IsOnCopperLayer() )
{
......@@ -941,41 +938,35 @@ void ZONE_CONTAINER::DisplayInfo( WinEDA_DrawFrame* frame )
msg << wxT( " <" ) << _( "Not Found" ) << wxT( ">" );
}
Affiche_1_Parametre( frame, text_pos, _( "NetName" ), msg, RED );
msgpanel->AppendMessage( _( "NetName" ), msg, RED );
}
else
Affiche_1_Parametre( frame, text_pos, _( "Non Copper Zone" ), wxEmptyString, RED );
msgpanel->AppendMessage( _( "Non Copper Zone" ), wxEmptyString, RED );
/* Display net code : (usefull in test or debug) */
text_pos += 18;
msg.Printf( wxT( "%d" ), GetNet() );
Affiche_1_Parametre( frame, text_pos, _( "NetCode" ), msg, RED );
msgpanel->AppendMessage( _( "NetCode" ), msg, RED );
text_pos += 6;
msg = board->GetLayerName( m_Layer );
Affiche_1_Parametre( frame, text_pos, _( "Layer" ), msg, BROWN );
msgpanel->AppendMessage( _( "Layer" ), msg, BROWN );
text_pos += 8;
msg.Printf( wxT( "%d" ), m_Poly->corner.size() );
Affiche_1_Parametre( frame, text_pos, _( "Corners" ), msg, BLUE );
msgpanel->AppendMessage( _( "Corners" ), msg, BLUE );
text_pos += 6;
if( m_FillMode )
msg.Printf( _( "Segments" ), m_FillMode );
else
msg = _( "Polygons" );
Affiche_1_Parametre( frame, text_pos, _( "Fill mode" ), msg, BROWN );
msgpanel->AppendMessage( _( "Fill mode" ), msg, BROWN );
// Useful for statistics :
text_pos += 9;
msg.Printf( wxT( "%d" ), m_Poly->m_HatchLines.size() );
Affiche_1_Parametre( frame, text_pos, _( "Hatch lines" ), msg, BLUE );
msgpanel->AppendMessage( _( "Hatch lines" ), msg, BLUE );
if( m_FilledPolysList.size() )
{
text_pos += 9;
msg.Printf( wxT( "%d" ), m_FilledPolysList.size() );
Affiche_1_Parametre( frame, text_pos, _( "Corners in DrawList" ), msg, BLUE );
msgpanel->AppendMessage( _( "Corners in DrawList" ), msg, BLUE );
}
}
......
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