Commit 0d8cb9b5 authored by Wayne Stambaugh's avatar Wayne Stambaugh
Browse files

EESchema improvements and other minor fixes.

* Remove base screen methods from draw frame object and correct current
  screen methods in derived objects.
* Move restore old wires function code into schematic screen object.
* Make add junction method use current screen position instead of store
  position.
* Move poly line ghosting function into the delete current segment method
  as that was the only place is was being used.
* Add method to base schematic object of testing if object has a label
  that can be incremented.
* Simplified the schematic hierarchy traversing code.
* PCBNew Doxygen warning fixes.
parent 2cda6f4b
Loading
Loading
Loading
Loading
+9 −10
Original line number Original line Diff line number Diff line
@@ -166,17 +166,16 @@ void BLOCK_SELECTOR::PushItem( ITEM_PICKER& aItem )
 */
 */
bool EDA_DRAW_FRAME::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;
    BLOCK_SELECTOR* Block = &GetScreen()->m_BlockLocate;


    if( ( Block->m_Command != BLOCK_IDLE )
    if( ( Block->m_Command != BLOCK_IDLE ) || ( Block->m_State != STATE_NO_BLOCK ) )
       || ( Block->m_State != STATE_NO_BLOCK ) )
        return false;
        return FALSE;


    Block->m_Flags   = 0;
    Block->m_Flags   = 0;
    Block->m_Command = (CmdBlockType) ReturnBlockCommand( key );
    Block->m_Command = (CmdBlockType) ReturnBlockCommand( key );


    if( Block->m_Command == 0 )
    if( Block->m_Command == 0 )
        return FALSE;
        return false;


    switch( Block->m_Command )
    switch( Block->m_Command )
    {
    {
@@ -205,19 +204,19 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
        if( Block->m_ItemsSelection.GetCount() == 0 )      /* No data to paste */
        if( Block->m_ItemsSelection.GetCount() == 0 )      /* No data to paste */
        {
        {
            DisplayError( this, wxT( "No Block to paste" ), 20 );
            DisplayError( this, wxT( "No Block to paste" ), 20 );
            GetBaseScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
            GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
            DrawPanel->ManageCurseur = NULL;
            DrawPanel->ManageCurseur = NULL;
            return TRUE;
            return true;
        }
        }
        if( DrawPanel->ManageCurseur == NULL )
        if( DrawPanel->ManageCurseur == NULL )
        {
        {
            Block->m_ItemsSelection.ClearItemsList();
            Block->m_ItemsSelection.ClearItemsList();
            DisplayError( this,
            DisplayError( this,
                          wxT( "EDA_DRAW_FRAME::HandleBlockBegin() Err: ManageCurseur NULL" ) );
                          wxT( "EDA_DRAW_FRAME::HandleBlockBegin() Err: ManageCurseur NULL" ) );
            return TRUE;
            return true;
        }
        }
        Block->m_State = STATE_BLOCK_MOVE;
        Block->m_State = STATE_BLOCK_MOVE;
        DrawPanel->ManageCurseur( DrawPanel, DC, startpos, FALSE );
        DrawPanel->ManageCurseur( DrawPanel, DC, startpos, false );
        break;
        break;


    default:
    default:
@@ -231,7 +230,7 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* DC, int key, const wxPoint& startpo
    }
    }


    Block->SetMessageBlock( this );
    Block->SetMessageBlock( this );
    return TRUE;
    return true;
}
}




+1 −1
Original line number Original line Diff line number Diff line
@@ -30,7 +30,7 @@ void EDA_DRAW_FRAME::CopyToClipboard( wxCommandEvent& event )


    if(  event.GetId() == ID_GEN_COPY_BLOCK_TO_CLIPBOARD )
    if(  event.GetId() == ID_GEN_COPY_BLOCK_TO_CLIPBOARD )
    {
    {
        if( GetBaseScreen()->m_BlockLocate.m_Command != BLOCK_IDLE )
        if( GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE )
            DrawPanel->SetCursor( wxCursor( DrawPanel->m_PanelCursor =
            DrawPanel->SetCursor( wxCursor( DrawPanel->m_PanelCursor =
                        DrawPanel->m_PanelDefaultCursor ) );
                        DrawPanel->m_PanelDefaultCursor ) );


+4 −2
Original line number Original line Diff line number Diff line
@@ -50,7 +50,7 @@ DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* parent ):
    DIALOG_PAGES_SETTINGS_BASE( parent )
    DIALOG_PAGES_SETTINGS_BASE( parent )
{
{
    m_Parent = parent;
    m_Parent = parent;
    m_Screen = m_Parent->GetBaseScreen();
    m_Screen = m_Parent->GetScreen();
    m_Modified = 0;
    m_Modified = 0;
    m_SelectedSheet = NULL;
    m_SelectedSheet = NULL;
    m_CurrentSelection = 0;
    m_CurrentSelection = 0;
@@ -276,10 +276,12 @@ void DIALOG_PAGES_SETTINGS::SearchPageSizeSelection()
    int ii;
    int ii;


    m_CurrentSelection = NB_ITEMS - 1;
    m_CurrentSelection = NB_ITEMS - 1;

    for( ii = 0; ii < NB_ITEMS; ii++ )
    for( ii = 0; ii < NB_ITEMS; ii++ )
    {
    {
        sheet = SheetList[ii];
        sheet = SheetList[ii];
        if( m_Parent->GetBaseScreen()->m_CurrentSheetDesc == sheet )

        if( m_Parent->GetScreen()->m_CurrentSheetDesc == sheet )
            m_CurrentSelection = ii;
            m_CurrentSelection = ii;
    }
    }
}
}
+13 −14
Original line number Original line Diff line number Diff line
@@ -65,7 +65,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype,


    DrawPanel             = NULL;
    DrawPanel             = NULL;
    MsgPanel              = NULL;
    MsgPanel              = NULL;
    m_CurrentScreen       = NULL;
    m_currentScreen       = NULL;
    m_ID_current_state    = 0;
    m_ID_current_state    = 0;
    m_ID_last_state       = 0;
    m_ID_last_state       = 0;
    m_HTOOL_current_state = 0;
    m_HTOOL_current_state = 0;
@@ -121,8 +121,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype,


EDA_DRAW_FRAME::~EDA_DRAW_FRAME()
EDA_DRAW_FRAME::~EDA_DRAW_FRAME()
{
{
    if( m_CurrentScreen != NULL )
    SAFE_DELETE( m_currentScreen );
        delete m_CurrentScreen;


    m_auimgr.UnInit();
    m_auimgr.UnInit();
}
}
@@ -246,7 +245,7 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
        }
        }
    }
    }


    BASE_SCREEN* screen = GetBaseScreen();
    BASE_SCREEN* screen = GetScreen();


    if( screen->GetGridId() == id )
    if( screen->GetGridId() == id )
        return;
        return;
@@ -288,13 +287,13 @@ void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event )
    else
    else
    {
    {
        id--;
        id--;
        int selectedZoom = GetBaseScreen()->m_ZoomList[id];
        int selectedZoom = GetScreen()->m_ZoomList[id];


        if( GetBaseScreen()->GetZoom() == selectedZoom )
        if( GetScreen()->GetZoom() == selectedZoom )
            return;
            return;


        GetBaseScreen()->m_Curseur = DrawPanel->GetScreenCenterLogicalPosition();
        GetScreen()->m_Curseur = DrawPanel->GetScreenCenterLogicalPosition();
        GetBaseScreen()->SetZoom( selectedZoom );
        GetScreen()->SetZoom( selectedZoom );
        RedrawScreen( false );
        RedrawScreen( false );
    }
    }
}
}
@@ -303,7 +302,7 @@ void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event )
/* Return the current zoom level */
/* Return the current zoom level */
int EDA_DRAW_FRAME::GetZoom(void)
int EDA_DRAW_FRAME::GetZoom(void)
{
{
    return GetBaseScreen()->GetZoom();
    return GetScreen()->GetZoom();
}
}




@@ -455,8 +454,8 @@ wxPoint EDA_DRAW_FRAME::GetGridPosition( const wxPoint& aPosition )
{
{
    wxPoint pos = aPosition;
    wxPoint pos = aPosition;


    if( m_CurrentScreen != NULL && m_snapToGrid )
    if( m_currentScreen != NULL && m_snapToGrid )
        pos = m_CurrentScreen->GetNearestGridPosition( aPosition );
        pos = m_currentScreen->GetNearestGridPosition( aPosition );


    return pos;
    return pos;
}
}
@@ -470,7 +469,7 @@ int EDA_DRAW_FRAME::ReturnBlockCommand( int key )


void EDA_DRAW_FRAME::InitBlockPasteInfos()
void EDA_DRAW_FRAME::InitBlockPasteInfos()
{
{
    GetBaseScreen()->m_BlockLocate.ClearItemsList();
    GetScreen()->m_BlockLocate.ClearItemsList();
    DrawPanel->ManageCurseur = NULL;
    DrawPanel->ManageCurseur = NULL;
}
}


@@ -490,7 +489,7 @@ void EDA_DRAW_FRAME::AdjustScrollBars()
{
{
    int     unitsX, unitsY, posX, posY;
    int     unitsX, unitsY, posX, posY;
    wxSize  drawingSize, clientSize;
    wxSize  drawingSize, clientSize;
    BASE_SCREEN* screen = GetBaseScreen();
    BASE_SCREEN* screen = GetScreen();
    bool noRefresh = true;
    bool noRefresh = true;


    if( screen == NULL || DrawPanel == NULL )
    if( screen == NULL || DrawPanel == NULL )
@@ -627,7 +626,7 @@ void EDA_DRAW_FRAME::UpdateStatusBar()
{
{
    wxString        Line;
    wxString        Line;
    int             dx, dy;
    int             dx, dy;
    BASE_SCREEN*    screen = GetBaseScreen();
    BASE_SCREEN*    screen = GetScreen();


    if( !screen )
    if( !screen )
        return;
        return;
+1 −1
Original line number Original line Diff line number Diff line
@@ -110,7 +110,7 @@ BASE_SCREEN* EDA_DRAW_PANEL::GetScreen()
{
{
    EDA_DRAW_FRAME* parentFrame = m_Parent;
    EDA_DRAW_FRAME* parentFrame = m_Parent;


    return parentFrame->GetBaseScreen();
    return parentFrame->GetScreen();
}
}




Loading