Commit 5c8894f9 authored by Wayne Stambaugh's avatar Wayne Stambaugh

Coding policy fixes and other minor improvements.

* Change class WinEDA_MsgPanel name to EDA_MSG_PANEL per coding policy.
* Change some old set message panel code in PCBNew with updated message
  panel methods in EDA_DRAW_FRAME.
* Remove unused global function Affiche_1_Parametre.
* Minor Doxygen warning fixes.
parent cc36a80e
...@@ -38,7 +38,7 @@ EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* father, ...@@ -38,7 +38,7 @@ EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* father,
m_HToolBar = NULL; m_HToolBar = NULL;
m_FrameIsActive = TRUE; m_FrameIsActive = TRUE;
m_MsgFrameHeight = WinEDA_MsgPanel::GetRequiredHeight(); m_MsgFrameHeight = EDA_MSG_PANEL::GetRequiredHeight();
minsize.x = 470; minsize.x = 470;
minsize.y = 350 + m_MsgFrameHeight; minsize.y = 350 + m_MsgFrameHeight;
......
...@@ -666,14 +666,6 @@ void WinEDA_TextFrame::OnClose( wxCloseEvent& event ) ...@@ -666,14 +666,6 @@ void WinEDA_TextFrame::OnClose( wxCloseEvent& event )
} }
void Affiche_1_Parametre( EDA_DRAW_FRAME* frame, int pos_X,
const wxString& texte_H, const wxString& texte_L,
int color )
{
frame->MsgPanel->Affiche_1_Parametre( pos_X, texte_H, texte_L, color );
}
int GetTimeStamp() int GetTimeStamp()
{ {
static int OldTimeStamp, NewTimeStamp; static int OldTimeStamp, NewTimeStamp;
......
...@@ -121,8 +121,8 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti ...@@ -121,8 +121,8 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype, const wxString& ti
m_FrameSize.y -= m_MsgFrameHeight; m_FrameSize.y -= m_MsgFrameHeight;
DrawPanel = new EDA_DRAW_PANEL( this, -1, wxPoint( 0, 0 ), m_FrameSize ); DrawPanel = new EDA_DRAW_PANEL( this, -1, wxPoint( 0, 0 ), m_FrameSize );
MsgPanel = new WinEDA_MsgPanel( this, -1, wxPoint( 0, m_FrameSize.y ), MsgPanel = new EDA_MSG_PANEL( this, -1, wxPoint( 0, m_FrameSize.y ),
wxSize( m_FrameSize.x, m_MsgFrameHeight ) ); wxSize( m_FrameSize.x, m_MsgFrameHeight ) );
MsgPanel->SetBackgroundColour( wxColour( ColorRefs[LIGHTGRAY].m_Red, MsgPanel->SetBackgroundColour( wxColour( ColorRefs[LIGHTGRAY].m_Red,
ColorRefs[LIGHTGRAY].m_Green, ColorRefs[LIGHTGRAY].m_Green,
......
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
#include "colors.h" #include "colors.h"
BEGIN_EVENT_TABLE( WinEDA_MsgPanel, wxPanel ) BEGIN_EVENT_TABLE( EDA_MSG_PANEL, wxPanel )
EVT_PAINT( WinEDA_MsgPanel::OnPaint ) EVT_PAINT( EDA_MSG_PANEL::OnPaint )
END_EVENT_TABLE() END_EVENT_TABLE()
WinEDA_MsgPanel::WinEDA_MsgPanel( EDA_DRAW_FRAME* parent, int id, EDA_MSG_PANEL::EDA_MSG_PANEL( EDA_DRAW_FRAME* parent, int id,
const wxPoint& pos, const wxSize& size ) : const wxPoint& pos, const wxSize& size ) :
wxPanel( parent, id, pos, size ) wxPanel( parent, id, pos, size )
{ {
m_Parent = parent; m_Parent = parent;
...@@ -30,12 +30,12 @@ WinEDA_MsgPanel::WinEDA_MsgPanel( EDA_DRAW_FRAME* parent, int id, ...@@ -30,12 +30,12 @@ WinEDA_MsgPanel::WinEDA_MsgPanel( EDA_DRAW_FRAME* parent, int id,
} }
WinEDA_MsgPanel::~WinEDA_MsgPanel() EDA_MSG_PANEL::~EDA_MSG_PANEL()
{ {
} }
wxSize WinEDA_MsgPanel::computeFontSize() wxSize EDA_MSG_PANEL::computeFontSize()
{ {
// Get size of the wxSYS_DEFAULT_GUI_FONT // Get size of the wxSYS_DEFAULT_GUI_FONT
wxSize fontSizeInPixels; wxSize fontSizeInPixels;
...@@ -49,14 +49,14 @@ wxSize WinEDA_MsgPanel::computeFontSize() ...@@ -49,14 +49,14 @@ wxSize WinEDA_MsgPanel::computeFontSize()
} }
int WinEDA_MsgPanel::GetRequiredHeight() int EDA_MSG_PANEL::GetRequiredHeight()
{ {
// make space for two rows of text plus a number of pixels between them. // make space for two rows of text plus a number of pixels between them.
return 2 * computeFontSize().y + 0; return 2 * computeFontSize().y + 0;
} }
wxSize WinEDA_MsgPanel::computeTextSize( const wxString& text ) wxSize EDA_MSG_PANEL::computeTextSize( const wxString& text )
{ {
// Get size of the wxSYS_DEFAULT_GUI_FONT // Get size of the wxSYS_DEFAULT_GUI_FONT
wxSize textSizeInPixels; wxSize textSizeInPixels;
...@@ -70,7 +70,7 @@ wxSize WinEDA_MsgPanel::computeTextSize( const wxString& text ) ...@@ -70,7 +70,7 @@ wxSize WinEDA_MsgPanel::computeTextSize( const wxString& text )
} }
void WinEDA_MsgPanel::OnPaint( wxPaintEvent& event ) void EDA_MSG_PANEL::OnPaint( wxPaintEvent& event )
{ {
wxPaintDC dc( this ); wxPaintDC dc( this );
...@@ -87,9 +87,9 @@ void WinEDA_MsgPanel::OnPaint( wxPaintEvent& event ) ...@@ -87,9 +87,9 @@ void WinEDA_MsgPanel::OnPaint( wxPaintEvent& event )
event.Skip(); event.Skip();
} }
void WinEDA_MsgPanel::AppendMessage( const wxString& textUpper, void EDA_MSG_PANEL::AppendMessage( const wxString& textUpper,
const wxString& textLower, const wxString& textLower,
int color, int pad ) int color, int pad )
{ {
wxString text; wxString text;
wxSize drawSize = GetClientSize(); wxSize drawSize = GetClientSize();
...@@ -122,25 +122,14 @@ void WinEDA_MsgPanel::AppendMessage( const wxString& textUpper, ...@@ -122,25 +122,14 @@ void WinEDA_MsgPanel::AppendMessage( const wxString& textUpper,
} }
/* void EDA_MSG_PANEL::SetMessage( int aXPosition, const wxString& aUpperText,
* Display a parameter in message panel. const wxString& aLowerText, int aColor )
* pos_X = horizontal position
* If pos_X < 0: horizontal position is the last
* Required value >= 0
* Texte_H = text to be displayed in top line.
* Texte_L = text to be displayed in bottom line.
* Color = color display
*/
void WinEDA_MsgPanel::Affiche_1_Parametre( int pos_X, const wxString& texte_H,
const wxString& texte_L, int color )
{ {
wxPoint pos; wxPoint pos;
wxSize drawSize = GetClientSize(); wxSize drawSize = GetClientSize();
if( pos_X >= 0 ) if( aXPosition >= 0 )
{ m_last_x = pos.x = aXPosition * (m_fontSize.x + 2);
m_last_x = pos.x = pos_X * (m_fontSize.x + 2);
}
else else
pos.x = m_last_x; pos.x = m_last_x;
...@@ -151,14 +140,15 @@ void WinEDA_MsgPanel::Affiche_1_Parametre( int pos_X, const wxString& texte_H, ...@@ -151,14 +140,15 @@ void WinEDA_MsgPanel::Affiche_1_Parametre( int pos_X, const wxString& texte_H,
item.m_UpperY = (drawSize.y / 2) - m_fontSize.y; item.m_UpperY = (drawSize.y / 2) - m_fontSize.y;
item.m_LowerY = drawSize.y - m_fontSize.y; item.m_LowerY = drawSize.y - m_fontSize.y;
item.m_UpperText = texte_H; item.m_UpperText = aUpperText;
item.m_LowerText = texte_L; item.m_LowerText = aLowerText;
item.m_Color = color; item.m_Color = aColor;
int ndx; int ndx;
// update the vector, which is sorted by m_X // update the vector, which is sorted by m_X
int limit = m_Items.size(); int limit = m_Items.size();
for( ndx=0; ndx<limit; ++ndx ) for( ndx=0; ndx<limit; ++ndx )
{ {
// replace any item with same X // replace any item with same X
...@@ -184,7 +174,7 @@ void WinEDA_MsgPanel::Affiche_1_Parametre( int pos_X, const wxString& texte_H, ...@@ -184,7 +174,7 @@ void WinEDA_MsgPanel::Affiche_1_Parametre( int pos_X, const wxString& texte_H,
} }
void WinEDA_MsgPanel::showItem( wxDC& dc, const MsgItem& aItem ) void EDA_MSG_PANEL::showItem( wxDC& dc, const MsgItem& aItem )
{ {
int color = aItem.m_Color; int color = aItem.m_Color;
...@@ -208,14 +198,14 @@ void WinEDA_MsgPanel::showItem( wxDC& dc, const MsgItem& aItem ) ...@@ -208,14 +198,14 @@ void WinEDA_MsgPanel::showItem( wxDC& dc, const MsgItem& aItem )
} }
void WinEDA_MsgPanel::EraseMsgBox() void EDA_MSG_PANEL::EraseMsgBox()
{ {
m_Items.clear(); m_Items.clear();
m_last_x = 0; m_last_x = 0;
Refresh(); Refresh();
} }
void WinEDA_MsgPanel::erase( wxDC* DC ) void EDA_MSG_PANEL::erase( wxDC* DC )
{ {
wxPen pen; wxPen pen;
wxBrush brush; wxBrush brush;
......
...@@ -254,8 +254,7 @@ wxString& operator <<( wxString& aString, const wxPoint& aPoint ); ...@@ -254,8 +254,7 @@ wxString& operator <<( wxString& aString, const wxPoint& aPoint );
* @param aFlags The same args as allowed for wxExecute() * @param aFlags The same args as allowed for wxExecute()
* @return bool - true if success, else false * @return bool - true if success, else false
*/ */
bool ProcessExecute( const wxString& aCommandLine, bool ProcessExecute( const wxString& aCommandLine, int aFlags = wxEXEC_ASYNC );
int aFlags = wxEXEC_ASYNC );
/*******************/ /*******************/
...@@ -268,24 +267,6 @@ void InitKiCadAbout( wxAboutDialogInfo& info ); ...@@ -268,24 +267,6 @@ void InitKiCadAbout( wxAboutDialogInfo& info );
/* common.cpp */ /* common.cpp */
/**************/ /**************/
/**
* function Affiche_1_Parametre
* Routine to display a parameter.
* = POS_X horizontal framing
* If POS_X <0: horizontal position is the last
* Required value> = 0
* Texte_H = text to be displayed in top line.
* If "by posting on this line
* Texte_L = text to be displayed in bottom line.
* If "by posting on this line
* Color = color display
*/
void Affiche_1_Parametre( EDA_DRAW_FRAME* frame,
int pos_X,
const wxString& texte_H,
const wxString& texte_L,
int color );
int GetTimeStamp(); int GetTimeStamp();
int DisplayColorFrame( wxWindow* parent, int OldColor ); int DisplayColorFrame( wxWindow* parent, int OldColor );
......
...@@ -278,6 +278,7 @@ public: ...@@ -278,6 +278,7 @@ public:
* @param aUse_netnames = bool. if true, use net names from labels in schematic * @param aUse_netnames = bool. if true, use net names from labels in schematic
* if false, use net numbers (net codes) * if false, use net numbers (net codes)
* bool aUse_netnames is used only for Spice netlist * bool aUse_netnames is used only for Spice netlist
* @param aUsePrefix Prefix reference designator with an 'X' for spice output.
* @return true if success. * @return true if success.
*/ */
bool CreateNetlist( int aFormat, bool CreateNetlist( int aFormat,
...@@ -745,9 +746,9 @@ public: ...@@ -745,9 +746,9 @@ public:
/** /**
* Function SaveUndoItemInUndoList * Function SaveUndoItemInUndoList
* swaps the cloned item in #m_undoItem with \a aItem and saves it to the undo list * swaps the cloned item in member variable m_undoItem with \a aItem and saves it to
* then swap the data back. This swaps the internal structure of the item with the * the undo list then swap the data back. This swaps the internal structure of the
* cloned item. It does not swap the actual item pointers themselves. * item with the cloned item. It does not swap the actual item pointers themselves.
* *
* @param aItem The item to swap with the current undo item. * @param aItem The item to swap with the current undo item.
*/ */
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
class EDA_ITEM; class EDA_ITEM;
class EDA_RECT; class EDA_RECT;
class EDA_DRAW_PANEL; class EDA_DRAW_PANEL;
class WinEDA_MsgPanel; class EDA_MSG_PANEL;
class BASE_SCREEN; class BASE_SCREEN;
class WinEDA_Toolbar; class WinEDA_Toolbar;
class WinEDAChoiceBox; class WinEDAChoiceBox;
...@@ -227,7 +227,7 @@ class EDA_DRAW_FRAME : public EDA_BASE_FRAME ...@@ -227,7 +227,7 @@ class EDA_DRAW_FRAME : public EDA_BASE_FRAME
public: public:
EDA_DRAW_PANEL* DrawPanel; // Draw area EDA_DRAW_PANEL* DrawPanel; // Draw area
WinEDA_MsgPanel* MsgPanel; // Panel used to display some EDA_MSG_PANEL* MsgPanel; // Panel used to display some
// info (bottom of the screen) // info (bottom of the screen)
WinEDA_Toolbar* m_VToolBar; // Vertical (right side) Toolbar WinEDA_Toolbar* m_VToolBar; // Vertical (right side) Toolbar
WinEDA_Toolbar* m_AuxVToolBar; // Auxiliary Vertical (right side) WinEDA_Toolbar* m_AuxVToolBar; // Auxiliary Vertical (right side)
...@@ -602,13 +602,13 @@ public: ...@@ -602,13 +602,13 @@ public:
/********************************************************* /*********************************************************
* class WinEDA_MsgPanel : this is a panel to display various infos * class EDA_MSG_PANEL : this is a panel to display various infos
* and messages on items in eeschema an pcbnew * and messages on items in eeschema an pcbnew
*********************************************************/ *********************************************************/
/** /**
* Struct MsgItem * Struct MsgItem
* is used privately by WinEDA_MsgPanel as the item type of its vector. * is used privately by EDA_MSG_PANEL 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
...@@ -640,7 +640,7 @@ struct MsgItem ...@@ -640,7 +640,7 @@ struct MsgItem
}; };
class WinEDA_MsgPanel : public wxPanel class EDA_MSG_PANEL : public wxPanel
{ {
protected: protected:
std::vector<MsgItem> m_Items; std::vector<MsgItem> m_Items;
...@@ -668,21 +668,32 @@ public: ...@@ -668,21 +668,32 @@ public:
int m_BgColor; int m_BgColor;
public: public:
WinEDA_MsgPanel( EDA_DRAW_FRAME* parent, int id, const wxPoint& pos, const wxSize& size ); EDA_MSG_PANEL( EDA_DRAW_FRAME* parent, int id, const wxPoint& pos, const wxSize& size );
~WinEDA_MsgPanel(); ~EDA_MSG_PANEL();
/** /**
* Function GetRequiredHeight * Function GetRequiredHeight
* returns the required height (in pixels) of a WinEDA_MsgPanel. This takes * returns the required height (in pixels) of a EDA_MSG_PANEL. This takes
* into consideration the system gui font, wxSYS_DEFAULT_GUI_FONT. * into consideration the system gui font, wxSYS_DEFAULT_GUI_FONT.
*/ */
static int GetRequiredHeight(); static int GetRequiredHeight();
void OnPaint( wxPaintEvent& event ); void OnPaint( wxPaintEvent& event );
void EraseMsgBox(); void EraseMsgBox();
void Affiche_1_Parametre( int pos_X, const wxString& texte_H,
const wxString& texte_L, int color ); /**
* Function SetMessage
* sets a message at \a aXPosition to \a aUpperText and \a aLowerText in the message panel.
*
* @param aXPosition The horizontal position to display the message or less than zero
* to set the message using the last message position.
* @param aUpperText The text to be displayed in top line.
* @param aLowerText The text to be displayed in bottom line.
* @param aColor Color of the text to display.
*/
void SetMessage( int aXPosition, const wxString& aUpperText,
const wxString& aLowerText, int aColor );
/** /**
* Append a message to the message panel. * Append a message to the message panel.
......
...@@ -403,24 +403,23 @@ int PCB_EDIT_FRAME::GenPlaceBoard() ...@@ -403,24 +403,23 @@ int PCB_EDIT_FRAME::GenPlaceBoard()
MsgPanel->EraseMsgBox(); MsgPanel->EraseMsgBox();
msg.Printf( wxT( "%d" ), Ncols ); msg.Printf( wxT( "%d" ), Ncols );
Affiche_1_Parametre( this, 1, _( "Cols" ), msg, GREEN ); MsgPanel->SetMessage( 1, _( "Cols" ), msg, GREEN );
msg.Printf( wxT( "%d" ), Nrows ); msg.Printf( wxT( "%d" ), Nrows );
Affiche_1_Parametre( this, 7, _( "Lines" ), msg, GREEN ); MsgPanel->SetMessage( 7, _( "Lines" ), msg, GREEN );
msg.Printf( wxT( "%d" ), NbCells ); msg.Printf( wxT( "%d" ), NbCells );
Affiche_1_Parametre( this, 14, _( "Cells." ), msg, YELLOW ); MsgPanel->SetMessage( 14, _( "Cells." ), msg, YELLOW );
/* Choose the number of board sides. */ /* Choose the number of board sides. */
Nb_Sides = TWO_SIDES; Nb_Sides = TWO_SIDES;
Affiche_1_Parametre( this, 22, wxT( "S" ), MsgPanel->SetMessage( 22, wxT( "S" ), ( Nb_Sides == TWO_SIDES ) ? wxT( "2" ) : wxT( "1" ),
( Nb_Sides == TWO_SIDES ) ? wxT( "2" ) : wxT( "1" ), WHITE );
WHITE );
Board.InitBoard(); Board.InitBoard();
/* Display memory usage. */ /* Display memory usage. */
msg.Printf( wxT( "%d" ), Board.m_MemSize / 1024 ); msg.Printf( wxT( "%d" ), Board.m_MemSize / 1024 );
Affiche_1_Parametre( this, 24, wxT( "Mem(Kb)" ), msg, CYAN ); MsgPanel->SetMessage( 24, wxT( "Mem(Kb)" ), msg, CYAN );
Route_Layer_BOTTOM = LAYER_N_FRONT; Route_Layer_BOTTOM = LAYER_N_FRONT;
if( Nb_Sides == TWO_SIDES ) if( Nb_Sides == TWO_SIDES )
...@@ -470,7 +469,7 @@ int PCB_EDIT_FRAME::GenPlaceBoard() ...@@ -470,7 +469,7 @@ int PCB_EDIT_FRAME::GenPlaceBoard()
while( ii ) while( ii )
{ {
msg.Printf( wxT( "%d" ), jj++ ); msg.Printf( wxT( "%d" ), jj++ );
Affiche_1_Parametre( this, 50, _( "Loop" ), msg, CYAN ); MsgPanel->SetMessage( 50, _( "Loop" ), msg, CYAN );
ii = Propagation( this ); ii = Propagation( this );
} }
...@@ -1121,8 +1120,8 @@ int Propagation( PCB_EDIT_FRAME* frame ) ...@@ -1121,8 +1120,8 @@ int Propagation( PCB_EDIT_FRAME* frame )
#define NO_CELL_ZONE (HOLE | CELL_is_EDGE | CELL_is_ZONE) #define NO_CELL_ZONE (HOLE | CELL_is_EDGE | CELL_is_ZONE)
wxString msg; wxString msg;
Affiche_1_Parametre( frame, 57, wxT( "Detect" ), msg, CYAN ); frame->MsgPanel->SetMessage( 57, wxT( "Detect" ), msg, CYAN );
Affiche_1_Parametre( frame, -1, wxEmptyString, wxT( "1" ), CYAN ); frame->MsgPanel->SetMessage( -1, wxEmptyString, wxT( "1" ), CYAN );
// Alloc memory to handle 1 line or 1 colunmn on the routing matrix // Alloc memory to handle 1 line or 1 colunmn on the routing matrix
nn = MAX( Nrows, Ncols ) * sizeof(*pt_cell_V); nn = MAX( Nrows, Ncols ) * sizeof(*pt_cell_V);
...@@ -1151,7 +1150,7 @@ int Propagation( PCB_EDIT_FRAME* frame ) ...@@ -1151,7 +1150,7 @@ int Propagation( PCB_EDIT_FRAME* frame )
} }
/* search 2 : from right to left and top to bottom */ /* search 2 : from right to left and top to bottom */
Affiche_1_Parametre( frame, -1, wxEmptyString, wxT( "2" ), CYAN ); frame->MsgPanel->SetMessage( -1, wxEmptyString, wxT( "2" ), CYAN );
memset( pt_cell_V, 0, nn ); memset( pt_cell_V, 0, nn );
for( row = 0; row < Nrows; row++ ) for( row = 0; row < Nrows; row++ )
{ {
...@@ -1174,7 +1173,7 @@ int Propagation( PCB_EDIT_FRAME* frame ) ...@@ -1174,7 +1173,7 @@ int Propagation( PCB_EDIT_FRAME* frame )
} }
/* search 3 : from bottom to top and right to left balayage */ /* search 3 : from bottom to top and right to left balayage */
Affiche_1_Parametre( frame, -1, wxEmptyString, wxT( "3" ), CYAN ); frame->MsgPanel->SetMessage( -1, wxEmptyString, wxT( "3" ), CYAN );
memset( pt_cell_V, 0, nn ); memset( pt_cell_V, 0, nn );
for( col = Ncols - 1; col >= 0; col-- ) for( col = Ncols - 1; col >= 0; col-- )
{ {
...@@ -1197,8 +1196,9 @@ int Propagation( PCB_EDIT_FRAME* frame ) ...@@ -1197,8 +1196,9 @@ int Propagation( PCB_EDIT_FRAME* frame )
} }
/* search 4 : from bottom to top and left to right */ /* search 4 : from bottom to top and left to right */
Affiche_1_Parametre( frame, -1, wxEmptyString, wxT( "4" ), CYAN ); frame->MsgPanel->SetMessage( -1, wxEmptyString, wxT( "4" ), CYAN );
memset( pt_cell_V, 0, nn ); memset( pt_cell_V, 0, nn );
for( col = 0; col < Ncols; col++ ) for( col = 0; col < Ncols; col++ )
{ {
old_cell_H = 0; old_cell_H = 0;
......
...@@ -744,10 +744,10 @@ static void Gen_Raccord_Track( PCB_EDIT_FRAME* frame, wxDC* DC ) ...@@ -744,10 +744,10 @@ static void Gen_Raccord_Track( PCB_EDIT_FRAME* frame, wxDC* DC )
oldpercent = percent; oldpercent = percent;
msg.Printf( wxT( "%d" ), frame->GetBoard()->m_Track.GetCount() ); msg.Printf( wxT( "%d" ), frame->GetBoard()->m_Track.GetCount() );
Affiche_1_Parametre( frame, POS_AFF_MAX, wxT( "Max" ), msg, GREEN ); frame->MsgPanel->SetMessage( POS_AFF_MAX, wxT( "Max" ), msg, GREEN );
msg.Printf( wxT( "%d" ), ii ); msg.Printf( wxT( "%d" ), ii );
Affiche_1_Parametre( frame, POS_AFF_NUMSEGM, wxT( "Segm" ), msg, CYAN ); frame->MsgPanel->SetMessage( POS_AFF_NUMSEGM, wxT( "Segm" ), msg, CYAN );
} }
if( frame->DrawPanel->m_AbortRequest ) if( frame->DrawPanel->m_AbortRequest )
...@@ -787,7 +787,7 @@ static void Gen_Raccord_Track( PCB_EDIT_FRAME* frame, wxDC* DC ) ...@@ -787,7 +787,7 @@ static void Gen_Raccord_Track( PCB_EDIT_FRAME* frame, wxDC* DC )
nn++; nn++;
msg.Printf( wxT( "%d" ), nn ); msg.Printf( wxT( "%d" ), nn );
Affiche_1_Parametre( frame, POS_AFF_VAR, wxT( "New <" ), msg, YELLOW ); frame->MsgPanel->SetMessage( POS_AFF_VAR, wxT( "New <" ), msg, YELLOW );
// create a new segment and insert it next to "other", then shorten other. // create a new segment and insert it next to "other", then shorten other.
newTrack = other->Copy(); newTrack = other->Copy();
...@@ -834,7 +834,7 @@ static void Gen_Raccord_Track( PCB_EDIT_FRAME* frame, wxDC* DC ) ...@@ -834,7 +834,7 @@ static void Gen_Raccord_Track( PCB_EDIT_FRAME* frame, wxDC* DC )
nn++; nn++;
msg.Printf( wxT( "%d" ), nn ); msg.Printf( wxT( "%d" ), nn );
Affiche_1_Parametre( frame, POS_AFF_VAR, wxT( "New >" ), msg, YELLOW ); frame->MsgPanel->SetMessage( POS_AFF_VAR, wxT( "New >" ), msg, YELLOW );
// create a new segment and insert it next to "other", then shorten other. // create a new segment and insert it next to "other", then shorten other.
newTrack = other->Copy(); newTrack = other->Copy();
......
...@@ -177,16 +177,14 @@ void PCB_EDIT_FRAME::GenModulesPosition( wxCommandEvent& event ) ...@@ -177,16 +177,14 @@ void PCB_EDIT_FRAME::GenModulesPosition( wxCommandEvent& event )
switchedLocale = true; switchedLocale = true;
// Display results // Display results
MsgPanel->EraseMsgBox(); ClearMsgPanel();
Affiche_1_Parametre( this, 0, _( "Component side place file:" ), AppendMsgPanel( _( "Component side place file:" ), fnFront.GetFullPath(), BLUE );
fnFront.GetFullPath(), BLUE );
if( doBoardBack ) if( doBoardBack )
Affiche_1_Parametre( this, 32, _( "Copper side place file:" ), AppendMsgPanel( _( "Copper side place file:" ), fnBack.GetFullPath(), BLUE );
fnBack.GetFullPath(), BLUE );
msg.Empty(); msg << moduleCount; msg.Empty(); msg << moduleCount;
Affiche_1_Parametre( this, 65, _( "Module count" ), msg, RED ); AppendMsgPanel( _( "Module count" ), msg, RED );
// Sort the list of modules alphabetically // Sort the list of modules alphabetically
Liste = (LIST_MOD*) MyZMalloc( moduleCount * sizeof(LIST_MOD) ); Liste = (LIST_MOD*) MyZMalloc( moduleCount * sizeof(LIST_MOD) );
......
...@@ -161,7 +161,7 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) ); ...@@ -161,7 +161,7 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
frame->OnModify(); // Ready to save the new empty board frame->OnModify(); // Ready to save the new empty board
wxString msg; wxString msg;
msg.Printf( _( "File <%s> not existing\nThis is normal for a new project" ), msg.Printf( _( "File <%s> does not exist.\nThis is normal for a new project" ),
GetChars( frame->GetScreen()->GetFileName() ) ); GetChars( frame->GetScreen()->GetFileName() ) );
wxMessageBox( msg ); wxMessageBox( msg );
} }
......
...@@ -120,7 +120,7 @@ void PCB_BASE_FRAME::Compile_Ratsnest( wxDC* aDC, bool aDisplayStatus ) ...@@ -120,7 +120,7 @@ void PCB_BASE_FRAME::Compile_Ratsnest( wxDC* aDC, bool aDisplayStatus )
GetBoard()->m_Status_Pcb = 0; /* we want a full ratsnest computation, GetBoard()->m_Status_Pcb = 0; /* we want a full ratsnest computation,
* from the scratch */ * from the scratch */
MsgPanel->EraseMsgBox(); ClearMsgPanel();
// Rebuild the full pads and net info list // Rebuild the full pads and net info list
RecalculateAllTracksNetcode(); RecalculateAllTracksNetcode();
...@@ -128,13 +128,9 @@ void PCB_BASE_FRAME::Compile_Ratsnest( wxDC* aDC, bool aDisplayStatus ) ...@@ -128,13 +128,9 @@ void PCB_BASE_FRAME::Compile_Ratsnest( wxDC* aDC, bool aDisplayStatus )
if( aDisplayStatus ) if( aDisplayStatus )
{ {
msg.Printf( wxT( " %d" ), m_Pcb->GetPadsCount() ); msg.Printf( wxT( " %d" ), m_Pcb->GetPadsCount() );
Affiche_1_Parametre( this, 1, wxT( "pads" ), msg, RED ); AppendMsgPanel( wxT( "Pads" ), msg, RED );
}
if( aDisplayStatus )
{
msg.Printf( wxT( " %d" ), m_Pcb->m_NetInfo->GetCount() ); msg.Printf( wxT( " %d" ), m_Pcb->m_NetInfo->GetCount() );
Affiche_1_Parametre( this, 8, wxT( "Nets" ), msg, CYAN ); AppendMsgPanel( wxT( "Nets" ), msg, CYAN );
} }
/* Compute the full ratsnest /* Compute the full ratsnest
......
...@@ -231,20 +231,15 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides ) ...@@ -231,20 +231,15 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides )
int row_source, col_source, row_target, col_target; int row_source, col_source, row_target, col_target;
int success, nbsucces = 0, nbunsucces = 0; int success, nbsucces = 0, nbunsucces = 0;
NETINFO_ITEM* net; NETINFO_ITEM* net;
bool stop = FALSE; bool stop = false;
wxString msg; wxString msg;
DrawPanel->m_AbortRequest = FALSE; DrawPanel->m_AbortRequest = false;
DrawPanel->m_AbortEnable = true; DrawPanel->m_AbortEnable = true;
s_Clearance = GetBoard()->m_NetClasses.GetDefault()->GetClearance(); s_Clearance = GetBoard()->m_NetClasses.GetDefault()->GetClearance();
Ncurrent = 0; Ncurrent = 0;
MsgPanel->EraseMsgBox();
msg.Printf( wxT( "%d " ), GetBoard()->m_NbNoconnect );
Affiche_1_Parametre( this, 72, wxT( "NoConn" ), msg, CYAN );
/* go until no more work to do */ /* go until no more work to do */
GetWork( &row_source, &col_source, &current_net_code, GetWork( &row_source, &col_source, &current_net_code,
&row_target, &col_target, &pt_cur_ch ); // First net to route. &row_target, &col_target, &pt_cur_ch ); // First net to route.
...@@ -256,6 +251,7 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides ) ...@@ -256,6 +251,7 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides )
{ {
/* Test to stop routing ( escape key pressed ) */ /* Test to stop routing ( escape key pressed ) */
wxYield(); wxYield();
if( DrawPanel->m_AbortRequest ) if( DrawPanel->m_AbortRequest )
{ {
if( IsOK( this, _( "Abort routing?" ) ) ) if( IsOK( this, _( "Abort routing?" ) ) )
...@@ -268,25 +264,24 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides ) ...@@ -268,25 +264,24 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides )
DrawPanel->m_AbortRequest = 0; DrawPanel->m_AbortRequest = 0;
} }
EraseMsgBox();
Ncurrent++; Ncurrent++;
net = GetBoard()->FindNet( current_net_code ); net = GetBoard()->FindNet( current_net_code );
if( net ) if( net )
{ {
msg.Printf( wxT( "[%8.8s]" ), GetChars( net->GetNetname() ) ); msg.Printf( wxT( "[%8.8s]" ), GetChars( net->GetNetname() ) );
Affiche_1_Parametre( this, 1, wxT( "Net route" ), msg, BROWN ); AppendMsgPanel( wxT( "Net route" ), msg, BROWN );
msg.Printf( wxT( "%d / %d" ), Ncurrent, Ntotal ); msg.Printf( wxT( "%d / %d" ), Ncurrent, Ntotal );
Affiche_1_Parametre( this, 12, wxT( "Activity" ), msg, BROWN ); AppendMsgPanel( wxT( "Activity" ), msg, BROWN );
} }
pt_cur_ch = pt_cur_ch; pt_cur_ch = pt_cur_ch;
segm_oX = GetBoard()->m_BoundaryBox.m_Pos.x + segm_oX = GetBoard()->m_BoundaryBox.m_Pos.x + (Board.m_GridRouting * col_source);
(Board.m_GridRouting * col_source); segm_oY = GetBoard()->m_BoundaryBox.m_Pos.y + (Board.m_GridRouting * row_source);
segm_oY = GetBoard()->m_BoundaryBox.m_Pos.y + segm_fX = GetBoard()->m_BoundaryBox.m_Pos.x + (Board.m_GridRouting * col_target);
(Board.m_GridRouting * row_source); segm_fY = GetBoard()->m_BoundaryBox.m_Pos.y + (Board.m_GridRouting * row_target);
segm_fX = GetBoard()->m_BoundaryBox.m_Pos.x +
(Board.m_GridRouting * col_target);
segm_fY = GetBoard()->m_BoundaryBox.m_Pos.y +
(Board.m_GridRouting * row_target);
/* Draw segment. */ /* Draw segment. */
GRLine( &DrawPanel->m_ClipBox, GRLine( &DrawPanel->m_ClipBox,
...@@ -329,12 +324,12 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides ) ...@@ -329,12 +324,12 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides )
break; break;
} }
msg.Printf( wxT( "%d " ), nbsucces ); msg.Printf( wxT( "%d" ), nbsucces );
Affiche_1_Parametre( this, 22, wxT( "Ok" ), msg, GREEN ); AppendMsgPanel( wxT( "Ok" ), msg, GREEN );
msg.Printf( wxT( "%d " ), nbunsucces ); msg.Printf( wxT( "%d" ), nbunsucces );
Affiche_1_Parametre( this, 30, wxT( "Fail" ), msg, RED ); AppendMsgPanel( wxT( "Fail" ), msg, RED );
msg.Printf( wxT( "%d " ), GetBoard()->m_NbNoconnect ); msg.Printf( wxT( " %d" ), GetBoard()->m_NbNoconnect );
Affiche_1_Parametre( this, 38, wxT( "NoConn" ), msg, CYAN ); AppendMsgPanel( wxT( "Not Connectd" ), msg, CYAN );
/* Delete routing from display. */ /* Delete routing from display. */
pt_cur_ch->m_PadStart->Draw( DrawPanel, DC, GR_AND ); pt_cur_ch->m_PadStart->Draw( DrawPanel, DC, GR_AND );
...@@ -344,7 +339,7 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides ) ...@@ -344,7 +339,7 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides )
break; break;
} }
DrawPanel->m_AbortEnable = FALSE; DrawPanel->m_AbortEnable = false;
return SUCCESS; return SUCCESS;
} }
......
...@@ -85,10 +85,6 @@ void PCB_EDIT_FRAME::Delete_Zone_Fill( SEGZONE* aZone, long aTimestamp ) ...@@ -85,10 +85,6 @@ void PCB_EDIT_FRAME::Delete_Zone_Fill( SEGZONE* aZone, long aTimestamp )
} }
/***************************************************************************************/
int PCB_EDIT_FRAME::Fill_Zone( ZONE_CONTAINER* zone_container, bool verbose )
/***************************************************************************************/
/** /**
* Function Fill_Zone * Function Fill_Zone
* Calculate the zone filling for the outline zone_container * Calculate the zone filling for the outline zone_container
...@@ -99,10 +95,11 @@ int PCB_EDIT_FRAME::Fill_Zone( ZONE_CONTAINER* zone_container, bool verbose ) ...@@ -99,10 +95,11 @@ int PCB_EDIT_FRAME::Fill_Zone( ZONE_CONTAINER* zone_container, bool verbose )
* @param verbose = true to show error messages * @param verbose = true to show error messages
* @return error level (0 = no error) * @return error level (0 = no error)
*/ */
int PCB_EDIT_FRAME::Fill_Zone( ZONE_CONTAINER* zone_container, bool verbose )
{ {
wxString msg; wxString msg;
MsgPanel->EraseMsgBox(); ClearMsgPanel();
if( GetBoard()->ComputeBoundingBox() == false ) if( GetBoard()->ComputeBoundingBox() == false )
{ {
...@@ -117,7 +114,8 @@ int PCB_EDIT_FRAME::Fill_Zone( ZONE_CONTAINER* zone_container, bool verbose ) ...@@ -117,7 +114,8 @@ int PCB_EDIT_FRAME::Fill_Zone( ZONE_CONTAINER* zone_container, bool verbose )
if( msg.IsEmpty() ) if( msg.IsEmpty() )
msg = wxT( "No net" ); msg = wxT( "No net" );
Affiche_1_Parametre( this, 22, _( "NetName" ), msg, RED );
AppendMsgPanel( _( "NetName" ), msg, RED );
wxBusyCursor dummy; // Shows an hourglass cursor (removed by its destructor) wxBusyCursor dummy; // Shows an hourglass cursor (removed by its destructor)
......
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