Commit aa93f54d authored by dickelbeck's avatar dickelbeck
Browse files

BOARD_ITEM::Draw()

parent c439e0da
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -10,6 +10,10 @@ email address.
+all
    Tweaked class MsgPanel so that the screen drawing only happens from
    its OnPaint() function.
+pcbnew
    Added virtual BOARD_ITEM::Draw() and forced all BOARD_ITEM derived classes
    to implement it so that all these functions are also virtual.
    Made the offset argument default to the new wxPoint BOARD_ITEM::ZeroOffset


2008-Mar-30 UPDATE  Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ void WinEDA_DisplayFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )

    if( Module )
    {
        Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_COPY );
        Module->Draw( DrawPanel, DC, GR_COPY );
        Module->Display_Infos( this );
    }

+17 −0
Original line number Diff line number Diff line
@@ -574,6 +574,11 @@ public:
    }


    /**
     * A value of wxPoint(0,0) which can be passed to the Draw() functions.
     */
    static wxPoint  ZeroOffset;

    BOARD_ITEM* Next() const { return (BOARD_ITEM*) Pnext; }
    BOARD_ITEM* Back() const { return (BOARD_ITEM*) Pback; }
    BOARD_ITEM* GetParent() const { return (BOARD_ITEM*) m_Parent; }
@@ -600,6 +605,18 @@ public:
    void  SetLayer( int aLayer )  { m_Layer = aLayer; }


    /**
     * Function Draw
     * overrides Draw() from EDA_BaseStruct in order to make it virtual
     * without the default color argument, which is more appropriate for
     * BOARD_ITEMs which have their own color information.
     */
    virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC,
                      int aDrawMode, const wxPoint& offset = ZeroOffset )
    {
    }


    /**
     * Function IsOnLayer
     * tests to see if this object is on the given layer.  Is virtual so
+4 −4
Original line number Diff line number Diff line
@@ -287,7 +287,7 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb )

        PutOnGrid( &m_CurrentScreen->m_Curseur );

        Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
        Module->Draw( DrawPanel, DC, GR_XOR );
        Place_Module( Module, DC );   /* positionne Module et recalcule cadre */

        current.x += Module->m_RealBoundaryBox.GetWidth() + pas_grille;
@@ -354,9 +354,9 @@ void WinEDA_PcbFrame::ReOrientModules( const wxString& ModuleMask,
        if( WildCompareString( ModuleMask, Module->m_Reference->m_Text, FALSE ) )
        {
            m_CurrentScreen->SetModify();
            Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
            Module->Draw( DrawPanel, DC, GR_XOR );
            Rotate_Module( NULL, Module, Orient, FALSE );
            Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
            Module->Draw( DrawPanel, DC, GR_OR );
        }
    }
}
+14 −14
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ void WinEDA_PcbFrame::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC
        if( Module->m_ModuleStatus & MODULE_to_PLACE )  // Erase from screen
        {
            NbModules++;
            Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
            Module->Draw( DrawPanel, DC, GR_XOR );
        }
        else
        {
Loading