From b1a8a0749a21f97be1a9138d6e5fb4a6d2b784c8 Mon Sep 17 00:00:00 2001 From: charras Date: Sun, 11 Oct 2009 15:13:39 +0000 Subject: [PATCH] All: better look when displaying items info on messages panel --- eeschema/class_BodyItem_Text.cpp | 2 +- eeschema/class_drawsheet.cpp | 7 ++++--- eeschema/libedit.cpp | 4 ++-- pcbnew/class_board.cpp | 28 +++++++++++----------------- pcbnew/class_drawsegment.cpp | 26 +++++++++++++------------- pcbnew/class_edge_mod.cpp | 23 ++++++++++++----------- pcbnew/class_netinfo_item.cpp | 13 +++++++------ pcbnew/class_text_mod.cpp | 25 ++++++++++++------------- pcbnew/plotdxf.cpp | 2 +- pcbnew/plotgerb.cpp | 5 ++--- pcbnew/plothpgl.cpp | 2 +- pcbnew/plotps.cpp | 2 +- 12 files changed, 67 insertions(+), 72 deletions(-) diff --git a/eeschema/class_BodyItem_Text.cpp b/eeschema/class_BodyItem_Text.cpp index 17895bfef0..cb81210213 100644 --- a/eeschema/class_BodyItem_Text.cpp +++ b/eeschema/class_BodyItem_Text.cpp @@ -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 ); } diff --git a/eeschema/class_drawsheet.cpp b/eeschema/class_drawsheet.cpp index 6e2ef4b64d..eb2a2209f7 100644 --- a/eeschema/class_drawsheet.cpp +++ b/eeschema/class_drawsheet.cpp @@ -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 ); } diff --git a/eeschema/libedit.cpp b/eeschema/libedit.cpp index c26982ea58..7037eaa9b8 100644 --- a/eeschema/libedit.cpp +++ b/eeschema/libedit.cpp @@ -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 ); } } diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index ccb568cd76..1b1743d3e4 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -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 ); } } diff --git a/pcbnew/class_drawsegment.cpp b/pcbnew/class_drawsegment.cpp index ccc6d610e0..e1daf01bd6 100644 --- a/pcbnew/class_drawsegment.cpp +++ b/pcbnew/class_drawsegment.cpp @@ -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 ); } diff --git a/pcbnew/class_edge_mod.cpp b/pcbnew/class_edge_mod.cpp index ed9fc84461..023cfff237 100644 --- a/pcbnew/class_edge_mod.cpp +++ b/pcbnew/class_edge_mod.cpp @@ -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 ); } diff --git a/pcbnew/class_netinfo_item.cpp b/pcbnew/class_netinfo_item.cpp index b7d9cba66a..0f0da330c6 100644 --- a/pcbnew/class_netinfo_item.cpp +++ b/pcbnew/class_netinfo_item.cpp @@ -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 ); } diff --git a/pcbnew/class_text_mod.cpp b/pcbnew/class_text_mod.cpp index 53a0a6ec9d..ac8aba18c2 100644 --- a/pcbnew/class_text_mod.cpp +++ b/pcbnew/class_text_mod.cpp @@ -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 ); } diff --git a/pcbnew/plotdxf.cpp b/pcbnew/plotdxf.cpp index ae4aa2a555..985ace0a7f 100644 --- a/pcbnew/plotdxf.cpp +++ b/pcbnew/plotdxf.cpp @@ -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 ); diff --git a/pcbnew/plotgerb.cpp b/pcbnew/plotgerb.cpp index 897475aa84..2e70bdf790 100644 --- a/pcbnew/plotgerb.cpp +++ b/pcbnew/plotgerb.cpp @@ -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 ); diff --git a/pcbnew/plothpgl.cpp b/pcbnew/plothpgl.cpp index a2ceb84daf..de9d447c77 100644 --- a/pcbnew/plothpgl.cpp +++ b/pcbnew/plothpgl.cpp @@ -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 diff --git a/pcbnew/plotps.cpp b/pcbnew/plotps.cpp index 10d26c7581..753d348fbf 100644 --- a/pcbnew/plotps.cpp +++ b/pcbnew/plotps.cpp @@ -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