All: better look when displaying items info on messages panel

This commit is contained in:
charras 2009-10-11 15:13:39 +00:00
parent ccbce931d2
commit b1a8a0749a
12 changed files with 67 additions and 72 deletions

View File

@ -327,7 +327,7 @@ void LIB_TEXT::DisplayInfo( WinEDA_DrawFrame* frame )
msg = ReturnStringFromValue( g_UnitMetric, m_Width,
EESCHEMA_INTERNAL_UNIT, true );
frame->MsgPanel->Affiche_1_Parametre( 20, _( "Line width" ), msg, BLUE );
frame->MsgPanel->AppendMessage( _( "Line width" ), msg, BLUE );
}

View File

@ -698,9 +698,10 @@ bool DrawSheetStruct::ChangeFileName( WinEDA_SchematicFrame* aFrame,
/***********************************************************/
void DrawSheetStruct::DisplayInfo( WinEDA_DrawFrame* frame )
{
frame->MsgPanel->EraseMsgBox();
Affiche_1_Parametre( frame, 1, _( "Name" ), m_SheetName, CYAN );
Affiche_1_Parametre( frame, 30, _( "FileName" ), m_FileName, BROWN );
WinEDA_MsgPanel *msgpanel = frame->MsgPanel;
msgpanel->EraseMsgBox();
msgpanel->AppendMessage( _( "Name" ), m_SheetName, CYAN );
msgpanel->AppendMessage( _( "FileName" ), m_FileName, BROWN );
}

View File

@ -274,7 +274,7 @@ void WinEDA_LibeditFrame::SaveActiveLibrary( wxCommandEvent& event )
{
msg = _( "Error while saving library file \"" ) + fn.GetFullPath() +
_( "\"." );
MsgPanel->Affiche_1_Parametre( 1, wxT( "*** ERROR: ***" ), msg, RED );
MsgPanel->AppendMessage( wxT( "*** ERROR: ***" ), msg, RED );
DisplayError( this, msg );
}
else
@ -283,7 +283,7 @@ void WinEDA_LibeditFrame::SaveActiveLibrary( wxCommandEvent& event )
fn.SetExt( DOC_EXT );
wxString msg1 = _( "Document file \"" ) + fn.GetFullPath() +
wxT( "\" Ok" );
MsgPanel->Affiche_1_Parametre( 1, msg, msg1, BLUE );
MsgPanel->AppendMessage( msg, msg1, BLUE );
}
}

View File

@ -572,19 +572,13 @@ bool BOARD::ComputeBoundaryBox()
// virtual, see pcbstruct.h
void BOARD::DisplayInfo( WinEDA_DrawFrame* frame )
{
/* Affiche l'etat du PCB : nb de pads, nets , connexions.. */
#define POS_AFF_NBPADS 1
#define POS_AFF_NBVIAS 8
#define POS_AFF_NBNODES 16
#define POS_AFF_NBNETS 24
#define POS_AFF_NBLINKS 32
#define POS_AFF_NBCONNECT 40
#define POS_AFF_NBNOCONNECT 48
/* Display board statistics: pads, nets, connections.. count
*/
wxString txt;
frame->MsgPanel->EraseMsgBox();
WinEDA_MsgPanel *msgpanel = frame->MsgPanel;
msgpanel->EraseMsgBox();
int viasCount = 0;
for( BOARD_ITEM* item = m_Track; item; item = item->Next() )
@ -594,16 +588,16 @@ void BOARD::DisplayInfo( WinEDA_DrawFrame* frame )
}
txt.Printf( wxT( "%d" ), GetPadsCount() );
Affiche_1_Parametre( frame, POS_AFF_NBPADS, _( "Pads" ), txt, DARKGREEN );
msgpanel->AppendMessage( _( "Pads" ), txt, DARKGREEN );
txt.Printf( wxT( "%d" ), viasCount );
Affiche_1_Parametre( frame, POS_AFF_NBVIAS, _( "Vias" ), txt, DARKGREEN );
msgpanel->AppendMessage( _( "Vias" ), txt, DARKGREEN );
txt.Printf( wxT( "%d" ), GetNodesCount() );
Affiche_1_Parametre( frame, POS_AFF_NBNODES, _( "Nodes" ), txt, DARKCYAN );
msgpanel->AppendMessage( _( "Nodes" ), txt, DARKCYAN );
txt.Printf( wxT( "%d" ), m_NetInfo->GetCount() );
Affiche_1_Parametre( frame, POS_AFF_NBNETS, _( "Nets" ), txt, RED );
msgpanel->AppendMessage( _( "Nets" ), txt, RED );
/* These parameters are known only if the full ratsnest is available,
* so, display them only if this is the case
@ -611,13 +605,13 @@ void BOARD::DisplayInfo( WinEDA_DrawFrame* frame )
if( (m_Status_Pcb & NET_CODES_OK) )
{
txt.Printf( wxT( "%d" ), GetRatsnestsCount() );
Affiche_1_Parametre( frame, POS_AFF_NBLINKS, _( "Links" ), txt, DARKGREEN );
msgpanel->AppendMessage( _( "Links" ), txt, DARKGREEN );
txt.Printf( wxT( "%d" ), GetRatsnestsCount() - GetNoconnectCount() );
Affiche_1_Parametre( frame, POS_AFF_NBCONNECT, _( "Connect" ), txt, DARKGREEN );
msgpanel->AppendMessage( _( "Connect" ), txt, DARKGREEN );
txt.Printf( wxT( "%d" ), GetNoconnectCount() );
Affiche_1_Parametre( frame, POS_AFF_NBNOCONNECT, _( "NoConn" ), txt, BLUE );
msgpanel->AppendMessage( _( "NoConn" ), txt, BLUE );
}
}

View File

@ -362,33 +362,34 @@ void DRAWSEGMENT::DisplayInfo( WinEDA_DrawFrame* frame )
BOARD* board = (BOARD*) m_Parent;
wxASSERT( board );
frame->MsgPanel->EraseMsgBox();
WinEDA_MsgPanel *msgpanel = frame->MsgPanel;
msgpanel->EraseMsgBox();
itype = m_Type & 0x0F;
msg = wxT( "DRAWING" );
Affiche_1_Parametre( frame, 1, _( "Type" ), msg, DARKCYAN );
msgpanel->AppendMessage( _( "Type" ), msg, DARKCYAN );
wxString shape = _( "Shape" );
switch( m_Shape ) {
case S_CIRCLE:
Affiche_1_Parametre( frame, 10, shape, _( "Circle" ), RED );
msgpanel->AppendMessage( shape, _( "Circle" ), RED );
break;
case S_ARC:
Affiche_1_Parametre( frame, 10, shape, _( "Arc" ), RED );
msgpanel->AppendMessage( shape, _( "Arc" ), RED );
msg.Printf( wxT( "%d.%d" ), m_Angle/10, m_Angle % 10 );
Affiche_1_Parametre( frame, 18, _("Angle"), msg, RED );
msg.Printf( wxT( "%1." ), (float)m_Angle/10 );
msgpanel->AppendMessage( _("Angle"), msg, RED );
break;
case S_CURVE:
Affiche_1_Parametre( frame, 10, shape, _( "Curve" ), RED );
msgpanel->AppendMessage( shape, _( "Curve" ), RED );
break;
default:
Affiche_1_Parametre( frame, 10, shape, _( "Segment" ), RED );
msgpanel->AppendMessage( shape, _( "Segment" ), RED );
}
wxString start;
start << GetStart();
@ -396,14 +397,13 @@ void DRAWSEGMENT::DisplayInfo( WinEDA_DrawFrame* frame )
wxString end;
end << GetEnd();
Affiche_1_Parametre( frame, 22, start, end, BLACK );
msgpanel->AppendMessage( start, end, DARKGREEN );
Affiche_1_Parametre( frame, 36, _( "Layer" ),
board->GetLayerName( m_Layer ), BROWN );
msgpanel->AppendMessage( _( "Layer" ),
board->GetLayerName( m_Layer ), DARKBROWN );
valeur_param( (unsigned) m_Width, msg );
Affiche_1_Parametre( frame, 50, _( "Width" ), msg, DARKCYAN );
msgpanel->AppendMessage( _( "Width" ), msg, DARKCYAN );
}

View File

@ -221,7 +221,7 @@ void EDGE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
// see class_edge_mod.h
void EDGE_MODULE::DisplayInfo( WinEDA_DrawFrame* frame )
{
wxString bufcar;
wxString msg;
MODULE* module = (MODULE*) m_Parent;
if( !module )
@ -231,22 +231,23 @@ void EDGE_MODULE::DisplayInfo( WinEDA_DrawFrame* frame )
if( !board )
return;
frame->MsgPanel->EraseMsgBox();
WinEDA_MsgPanel *msgpanel = frame->MsgPanel;
msgpanel->EraseMsgBox();
Affiche_1_Parametre( frame, 1, _( "Seg" ), wxEmptyString, DARKCYAN );
msgpanel->AppendMessage( _( "Graphic Item" ), wxEmptyString, DARKCYAN );
Affiche_1_Parametre( frame, 5, _( "Module" ), module->m_Reference->m_Text, DARKCYAN );
Affiche_1_Parametre( frame, 14, _( "Value" ), module->m_Value->m_Text, BLUE );
bufcar.Printf( wxT( "%8.8lX" ), module->m_TimeStamp );
msgpanel->AppendMessage( _( "Module" ), module->m_Reference->m_Text, DARKCYAN );
msgpanel->AppendMessage( _( "Value" ), module->m_Value->m_Text, BLUE );
Affiche_1_Parametre( frame, 24, _( "TimeStamp" ), bufcar, BROWN );
msg.Printf( wxT( "%8.8lX" ), module->m_TimeStamp );
msgpanel->AppendMessage( _( "TimeStamp" ), msg, BROWN );
Affiche_1_Parametre( frame, 34, _( "Mod Layer" ), board->GetLayerName( module->GetLayer() ), RED );
msgpanel->AppendMessage( _( "Mod Layer" ), board->GetLayerName( module->GetLayer() ), RED );
Affiche_1_Parametre( frame, 44, _( "Seg Layer" ), board->GetLayerName( module->GetLayer() ), RED );
msgpanel->AppendMessage( _( "Seg Layer" ), board->GetLayerName( GetLayer() ), RED );
valeur_param( m_Width, bufcar );
Affiche_1_Parametre( frame, 54, _( "Width" ), bufcar, BLUE );
valeur_param( m_Width, msg );
msgpanel->AppendMessage( _( "Width" ), msg, BLUE );
}

View File

@ -137,12 +137,13 @@ void NETINFO_ITEM::DisplayInfo( WinEDA_DrawFrame* frame )
D_PAD* pad;
double lengthnet = 0;
frame->MsgPanel->EraseMsgBox();
WinEDA_MsgPanel *msgpanel = frame->MsgPanel;
msgpanel->EraseMsgBox();
Affiche_1_Parametre( frame, 1, _( "Net Name" ), GetNetname(), RED );
msgpanel->AppendMessage( _( "Net Name" ), GetNetname(), RED );
txt.Printf( wxT( "%d" ), GetNet() );
Affiche_1_Parametre( frame, 30, _( "Net Code" ), txt, RED );
msgpanel->AppendMessage( _( "Net Code" ), txt, RED );
count = 0;
module = ( (WinEDA_BasePcbFrame*) frame )->GetBoard()->m_Modules;
@ -156,7 +157,7 @@ void NETINFO_ITEM::DisplayInfo( WinEDA_DrawFrame* frame )
}
txt.Printf( wxT( "%d" ), count );
Affiche_1_Parametre( frame, 40, _( "Pads" ), txt, DARKGREEN );
msgpanel->AppendMessage( _( "Pads" ), txt, DARKGREEN );
count = 0;
Struct = ( (WinEDA_BasePcbFrame*) frame )->GetBoard()->m_Track;
@ -171,10 +172,10 @@ void NETINFO_ITEM::DisplayInfo( WinEDA_DrawFrame* frame )
}
txt.Printf( wxT( "%d" ), count );
Affiche_1_Parametre( frame, 50, _( "Vias" ), txt, BLUE );
msgpanel->AppendMessage( _( "Vias" ), txt, BLUE );
valeur_param( (int) lengthnet, txt );
Affiche_1_Parametre( frame, 60, _( "Net Length" ), txt, RED );
msgpanel->AppendMessage( _( "Net Length" ), txt, RED );
}

View File

@ -467,25 +467,25 @@ void TEXTE_MODULE::DisplayInfo( WinEDA_DrawFrame* frame )
_( "Ref." ), _( "Value" ), _( "Text" )
};
frame->MsgPanel->EraseMsgBox();
WinEDA_MsgPanel *msgpanel = frame->MsgPanel;
msgpanel->EraseMsgBox();
Line = module->m_Reference->m_Text;
Affiche_1_Parametre( frame, 1, _( "Module" ), Line, DARKCYAN );
msgpanel->AppendMessage( _( "Module" ), Line, DARKCYAN );
Line = m_Text;
Affiche_1_Parametre( frame, 10, _( "Text" ), Line, BROWN );
msgpanel->AppendMessage( _( "Text" ), Line, BROWN );
ii = m_Type;
if( ii > 2 )
ii = 2;
Affiche_1_Parametre( frame, 20, _( "Type" ), text_type_msg[ii], DARKGREEN );
msgpanel->AppendMessage( _( "Type" ), text_type_msg[ii], DARKGREEN );
if( m_NoShow )
msg = _( "No" );
else
msg = _( "Yes" );
Affiche_1_Parametre( frame, 25, _( "Display" ), msg, DARKGREEN );
msgpanel->AppendMessage( _( "Display" ), msg, DARKGREEN );
// Display text layer (use layer name if possible)
BOARD* board = NULL;
@ -494,25 +494,24 @@ void TEXTE_MODULE::DisplayInfo( WinEDA_DrawFrame* frame )
msg = board->GetLayerName( m_Layer );
else
msg.Printf( wxT( "%d" ), m_Layer );
Affiche_1_Parametre( frame, 31, _( "Layer" ), msg, DARKGREEN );
msgpanel->AppendMessage( _( "Layer" ), msg, DARKGREEN );
msg = _( " No" );
if( m_Mirror )
msg = _( " Yes" );
Affiche_1_Parametre( frame, 37, _( "Mirror" ), msg, DARKGREEN );
msgpanel->AppendMessage( _( "Mirror" ), msg, 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, 51, _( "Width" ), msg, DARKGREEN );
msgpanel->AppendMessage( _( "Width" ), msg, DARKGREEN );
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, 69, _( "V Size" ), msg, RED );
msgpanel->AppendMessage( _( "V Size" ), msg, RED );
}

View File

@ -30,7 +30,7 @@ void WinEDA_BasePcbFrame::Genere_DXF( const wxString& FullFileName, int Layer,
}
SetLocaleTo_C_standard();
Affiche_1_Parametre( this, 0, _( "File" ), FullFileName, CYAN );
MsgPanel->AppendMessage( _( "File" ), FullFileName, CYAN );
DXF_PLOTTER* plotter = new DXF_PLOTTER();
plotter->set_paper_size( currentsheet );

View File

@ -35,8 +35,7 @@ void WinEDA_BasePcbFrame::Genere_GERBER( const wxString& FullFileName, int Layer
{
wxPoint offset;
EraseMsgBox();
MsgPanel->EraseMsgBox();
/* Calculate scaling from pcbnew units (in 0.1 mil or 0.0001 inch) to gerber units */
double scale = g_pcb_plot_options.Scale;
@ -65,7 +64,7 @@ void WinEDA_BasePcbFrame::Genere_GERBER( const wxString& FullFileName, int Layer
plotter->set_creator( wxT( "PCBNEW-RS274X" ) );
plotter->set_filename( FullFileName );
Affiche_1_Parametre( this, 0, _( "File" ), FullFileName, CYAN );
MsgPanel->AppendMessage( _( "File" ), FullFileName, CYAN );
plotter->start_plot( output_file );

View File

@ -50,7 +50,7 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
}
SetLocaleTo_C_standard();
Affiche_1_Parametre( this, 0, _( "File" ), FullFileName, CYAN );
MsgPanel->AppendMessage( _( "File" ), FullFileName, CYAN );
if( g_pcb_plot_options.PlotScaleOpt != 1 )
Center = TRUE; // Echelle != 1 donc trace centree du PCB

View File

@ -42,7 +42,7 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
}
SetLocaleTo_C_standard();
Affiche_1_Parametre( this, 0, _( "File" ), FullFileName, CYAN );
MsgPanel->AppendMessage( _( "File" ), FullFileName, CYAN );
if( g_pcb_plot_options.PlotScaleOpt != 1 )
Center = TRUE; // Echelle != 1 donc trace centree du PCB