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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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;
+0 −8
Original line number Original line Diff line number Diff line
@@ -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;
+2 −2
Original line number Original line Diff line number Diff line
@@ -121,7 +121,7 @@ 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,
+25 −35
Original line number Original line Diff line number Diff line
@@ -12,12 +12,12 @@
#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 )
{
{
@@ -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()
}
}




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 )
}
}




void WinEDA_MsgPanel::OnPaint( wxPaintEvent& event )
void EDA_MSG_PANEL::OnPaint( wxPaintEvent& event )
{
{
    wxPaintDC dc( this );
    wxPaintDC dc( this );


@@ -87,7 +87,7 @@ 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 )
{
{
@@ -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,
    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,
}
}




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 )
}
}




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;
+1 −20
Original line number Original line Diff line number Diff line
@@ -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 );
/* 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 );
Loading