Commit 73e38ce9 authored by Wayne Stambaugh's avatar Wayne Stambaugh
Browse files

EESchema code refactoring and coding policy naming fixes.

* Move schematic wire and bus break code into schematic screen object.
* Move schematic test for dangling ends into schematic screen object.
* Remove left over debugging output in schematic screen object.
* Remove unused file eeschema/cleanup.cpp.
* Fix bug in schematic line object hit test algorithm.
* Fix a string concatenation compile error added in r2752.
* Rename class WinEDA_BasicFrame to EDA_BASE_FRAME.
* Rename class WinEDA_DrawFrame to EDA_DRAW_FRAME.
* Rename class WinEDA_DrawPanel to EDA_DRAW_PANEL.
parent 1d2ca601
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -337,7 +337,7 @@ bool EDA_TextStruct::TextHitTest( const EDA_Rect& aRect, bool aContains, int aAc
}


void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffset,
void EDA_TextStruct::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
                           EDA_Colors aColor, int aDrawMode,
                           GRTraceMode aFillMode, EDA_Colors aAnchor_color )
{
@@ -381,7 +381,7 @@ void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& a
}


void EDA_TextStruct::DrawOneLineOfText( WinEDA_DrawPanel* aPanel, wxDC* aDC,
void EDA_TextStruct::DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
                                        const wxPoint& aOffset, EDA_Colors aColor,
                                        int aDrawMode, GRTraceMode aFillMode,
                                        EDA_Colors aAnchor_color,
+22 −22
Original line number Diff line number Diff line
/**
 * WinEDA_BasicFrame Class Functions
 * EDA_BASE_FRAME Class Functions
 * @file basicframe.cpp
 */

@@ -23,9 +23,9 @@
#include "bitmaps.h"

/*
 * Class constructor for WinEDA_BasicFrame general options
 * Class constructor for EDA_BASE_FRAME general options
 */
WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father,
EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* father,
                                int idtype,
                                const wxString& title,
                                const wxPoint& pos,
@@ -58,11 +58,11 @@ WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father,

    Connect( ID_HELP_COPY_VERSION_STRING,
             wxEVT_COMMAND_MENU_SELECTED,
             wxCommandEventHandler( WinEDA_BasicFrame::CopyVersionInfoToClipboard ) );
             wxCommandEventHandler( EDA_BASE_FRAME::CopyVersionInfoToClipboard ) );
}


WinEDA_BasicFrame::~WinEDA_BasicFrame()
EDA_BASE_FRAME::~EDA_BASE_FRAME()
{
    if( wxGetApp().m_HtmlCtrl )
        delete wxGetApp().m_HtmlCtrl;
@@ -78,7 +78,7 @@ WinEDA_BasicFrame::~WinEDA_BasicFrame()
/*
 * Virtual function
 */
void WinEDA_BasicFrame::ReCreateMenuBar()
void EDA_BASE_FRAME::ReCreateMenuBar()
{

}
@@ -88,7 +88,7 @@ void WinEDA_BasicFrame::ReCreateMenuBar()
 * called on a language menu selection
 * when using a derived function, do not forget to call this one
 */
void WinEDA_BasicFrame::SetLanguage( wxCommandEvent& event )
void EDA_BASE_FRAME::SetLanguage( wxCommandEvent& event )
{
    int id = event.GetId();

@@ -106,7 +106,7 @@ void WinEDA_BasicFrame::SetLanguage( wxCommandEvent& event )
 * parameters.  Don't forget to call the base method or your frames won't
 * remember their positions and sizes.
 */
void WinEDA_BasicFrame::LoadSettings()
void EDA_BASE_FRAME::LoadSettings()
{
    wxString  text;
    int       Ypos_min;
@@ -146,7 +146,7 @@ void WinEDA_BasicFrame::LoadSettings()
 * parameters.  Don't forget to call the base method or your frames won't
 * remember their positions and sizes.
 */
void WinEDA_BasicFrame::SaveSettings()
void EDA_BASE_FRAME::SaveSettings()
{
    wxString text;
    wxConfig* config;
@@ -170,7 +170,7 @@ void WinEDA_BasicFrame::SaveSettings()
}


void WinEDA_BasicFrame::PrintMsg( const wxString& text )
void EDA_BASE_FRAME::PrintMsg( const wxString& text )
{
    SetStatusText( text );
}
@@ -179,7 +179,7 @@ void WinEDA_BasicFrame::PrintMsg( const wxString& text )
/*
 * Display a bargraph (0 to 50 point length) for a PerCent value from 0 to 100
 */
void WinEDA_BasicFrame::DisplayActivity( int PerCent, const wxString& Text )
void EDA_BASE_FRAME::DisplayActivity( int PerCent, const wxString& Text )
{
    wxString Line;

@@ -198,7 +198,7 @@ void WinEDA_BasicFrame::DisplayActivity( int PerCent, const wxString& Text )
/*
 * Update the list of past projects.
 */
void WinEDA_BasicFrame::SetLastProject( const wxString& FullFileName )
void EDA_BASE_FRAME::SetLastProject( const wxString& FullFileName )
{
    wxGetApp().m_fileHistory.AddFileToHistory( FullFileName );
    ReCreateMenuBar();
@@ -208,7 +208,7 @@ void WinEDA_BasicFrame::SetLastProject( const wxString& FullFileName )
/*
 * Fetch the file name from the file history list.
 */
wxString WinEDA_BasicFrame::GetFileFromHistory( int cmdId, const wxString& type )
wxString EDA_BASE_FRAME::GetFileFromHistory( int cmdId, const wxString& type )
{
    wxString fn, msg;
    size_t   i;
@@ -239,7 +239,7 @@ wxString WinEDA_BasicFrame::GetFileFromHistory( int cmdId, const wxString& type
/*
 *
 */
void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
{
    wxString msg;

@@ -282,14 +282,14 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
/*
 *
 */
void WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& event )
void EDA_BASE_FRAME::GetKicadAbout( wxCommandEvent& event )
{
    bool ShowAboutDialog(wxWindow * parent);
    ShowAboutDialog(this);
}


void WinEDA_BasicFrame::AddHelpVersionInfoMenuEntry( wxMenu* aMenu )
void EDA_BASE_FRAME::AddHelpVersionInfoMenuEntry( wxMenu* aMenu )
{
    wxASSERT( aMenu != NULL );

@@ -364,7 +364,7 @@ static inline const char* KICAD_BUILD_OPTIONS_SIGNATURE()

#endif

void WinEDA_BasicFrame::CopyVersionInfoToClipboard( wxCommandEvent&  event )
void EDA_BASE_FRAME::CopyVersionInfoToClipboard( wxCommandEvent&  event )
{
    if( !wxTheClipboard->Open() )
    {
+8 −10
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ BLOCK_SELECTOR::~BLOCK_SELECTOR()
/*
 *  Print block command message (Block move, Block copy ...) in status bar
 */
void BLOCK_SELECTOR::SetMessageBlock( WinEDA_DrawFrame* frame )
void BLOCK_SELECTOR::SetMessageBlock( EDA_DRAW_FRAME* frame )
{
    wxString msg;

@@ -96,7 +96,7 @@ void BLOCK_SELECTOR::SetMessageBlock( WinEDA_DrawFrame* frame )
}


void BLOCK_SELECTOR::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
void BLOCK_SELECTOR::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
                           const wxPoint& aOffset,
                           int aDrawMode,
                           int aColor )
@@ -119,8 +119,7 @@ void BLOCK_SELECTOR::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
 * Function InitData
 *  Init the initial values of a BLOCK_SELECTOR, before starting a block command
 */
void BLOCK_SELECTOR::InitData( WinEDA_DrawPanel* aPanel,
                               const wxPoint&    startpos )
void BLOCK_SELECTOR::InitData( EDA_DRAW_PANEL* aPanel, const wxPoint& startpos )
{
    m_State = STATE_BLOCK_INIT;
    SetOrigin( startpos );
@@ -166,8 +165,7 @@ void BLOCK_SELECTOR::PushItem( ITEM_PICKER& aItem )
/*  First command block function:
 *  Init the Block infos: command type, initial position, and other variables..
 */
bool WinEDA_DrawFrame::HandleBlockBegin( wxDC* DC, int key,
                                         const wxPoint& startpos )
bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpos )
{
    BLOCK_SELECTOR* Block = &GetBaseScreen()->m_BlockLocate;

@@ -215,7 +213,7 @@ bool WinEDA_DrawFrame::HandleBlockBegin( wxDC* DC, int key,
        {
            Block->m_ItemsSelection.ClearItemsList();
            DisplayError( this,
                          wxT( "WinEDA_DrawFrame::HandleBlockBegin() Err: ManageCurseur NULL" ) );
                          wxT( "EDA_DRAW_FRAME::HandleBlockBegin() Err: ManageCurseur NULL" ) );
            return TRUE;
        }
        Block->m_State = STATE_BLOCK_MOVE;
@@ -225,7 +223,7 @@ bool WinEDA_DrawFrame::HandleBlockBegin( wxDC* DC, int key,
    default:
    {
        wxString msg;
        msg << wxT( "WinEDA_DrawFrame::HandleBlockBegin() error: Unknown command " ) <<
        msg << wxT( "EDA_DRAW_FRAME::HandleBlockBegin() error: Unknown command " ) <<
        Block->m_Command;
        DisplayError( this, msg );
    }
@@ -243,7 +241,7 @@ bool WinEDA_DrawFrame::HandleBlockBegin( wxDC* DC, int key,
 *  by Initm_BlockLocateDatas().
 *  The other point of the rectangle is the mouse cursor
 */
void DrawAndSizingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
void DrawAndSizingBlockOutlines( EDA_DRAW_PANEL* panel, wxDC* DC, bool erase )
{
    BLOCK_SELECTOR* PtBlock;

@@ -271,7 +269,7 @@ void DrawAndSizingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/*
 *  Cancel Current block operation.
 */
void AbortBlockCurrentCommand( WinEDA_DrawPanel* Panel, wxDC* DC )
void AbortBlockCurrentCommand( EDA_DRAW_PANEL* Panel, wxDC* DC )
{
    BASE_SCREEN* screen = Panel->GetScreen();

+2 −2
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ EDA_Rect MARKER_BASE::GetBoundingBoxMarker() const
    return EDA_Rect( m_Pos, realsize );
}

void MARKER_BASE::DrawMarker( WinEDA_DrawPanel* aPanel, wxDC* aDC, int aDrawMode,
void MARKER_BASE::DrawMarker( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode,
                              const wxPoint& aOffset )
{
    wxPoint corners[CORNERS_COUNT];
@@ -169,7 +169,7 @@ void MARKER_BASE::DrawMarker( WinEDA_DrawPanel* aPanel, wxDC* aDC, int aDrawMode
}


void MARKER_BASE::DisplayMarkerInfo( WinEDA_DrawFrame* aFrame )
void MARKER_BASE::DisplayMarkerInfo( EDA_DRAW_FRAME* aFrame )
{
    wxString msg = m_drc.ShowHtml();
    DIALOG_DISPLAY_HTML_TEXT_BASE infodisplay( (wxWindow*)aFrame, wxID_ANY, _( "Marker Info" ),
+1 −1
Original line number Diff line number Diff line
@@ -664,7 +664,7 @@ void WinEDA_TextFrame::OnClose( wxCloseEvent& event )
}


void Affiche_1_Parametre( WinEDA_DrawFrame* frame, int pos_X,
void Affiche_1_Parametre( EDA_DRAW_FRAME* frame, int pos_X,
                          const wxString& texte_H, const wxString& texte_L,
                          int color )
{
Loading