Commit aa93f54d authored by dickelbeck's avatar dickelbeck

BOARD_ITEM::Draw()

parent c439e0da
......@@ -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>
......
......@@ -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 );
}
......
......@@ -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
......
......@@ -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 );
}
}
}
......
......@@ -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
{
......
......@@ -520,14 +520,12 @@ void WinEDA_BasePcbFrame::Block_Delete( wxDC* DC )
if( ! PtStruct->HitTest( GetScreen()->BlockLocate ) )
break;
/* le texte est ici bon a etre efface */
( (TEXTE_PCB*) PtStruct )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
PtStruct->Draw( DrawPanel, DC, GR_XOR );
/* Suppression du texte en Memoire*/
PtStruct->DeleteStructure();
break;
case TYPEMIRE:
#undef STRUCT
#define STRUCT ( (MIREPCB*) PtStruct )
if( (g_TabOneLayerMask[STRUCT->GetLayer()] & masque_layer) == 0 )
break;
if( ! PtStruct->HitTest( GetScreen()->BlockLocate ) )
......@@ -537,8 +535,6 @@ void WinEDA_BasePcbFrame::Block_Delete( wxDC* DC )
break;
case TYPECOTATION:
#undef STRUCT
#define STRUCT ( (COTATION*) PtStruct )
if( (g_TabOneLayerMask[STRUCT->GetLayer()] & masque_layer) == 0 )
break;
if( ! PtStruct->HitTest( GetScreen()->BlockLocate ) )
......@@ -1201,7 +1197,7 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
new_zone->m_TimeStamp = GetTimeStamp();
new_zone->Move( MoveVector );
m_Pcb->Add(new_zone);
new_zone->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
new_zone->Draw( DrawPanel, DC, GR_OR );
}
}
}
......@@ -1257,7 +1253,7 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
m_Pcb->m_Drawings = new_pcbtext;
/* Redessin du Texte */
new_pcbtext->m_Pos += MoveVector;
new_pcbtext->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
new_pcbtext->Draw( DrawPanel, DC, GR_OR );
break;
}
......@@ -1277,7 +1273,7 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
m_Pcb->m_Drawings->Pback = new_mire;
m_Pcb->m_Drawings = new_mire;
new_mire->m_Pos += MoveVector;
new_mire->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
new_mire->Draw( DrawPanel, DC, GR_OR );
break;
}
......@@ -1297,7 +1293,7 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
m_Pcb->m_Drawings->Pback = new_cotation;
m_Pcb->m_Drawings = new_cotation;
new_cotation->Move( MoveVector );
new_cotation->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
new_cotation->Draw( DrawPanel, DC, GR_OR );
break;
}
......
......@@ -293,7 +293,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
{
DrawBlockStruct* PtBlock;
BASE_SCREEN* screen = panel->m_Parent->GetScreen();
EDA_BaseStruct* item;
BOARD_ITEM* item;
wxPoint move_offset;
MODULE* Currentmodule = g_EDA_Appl->m_ModuleEditFrame->m_Pcb->m_Modules;
......@@ -320,11 +320,8 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
switch( item->Type() )
{
case TYPETEXTEMODULE:
( (TEXTE_MODULE*) item )->Draw( panel, DC, move_offset, g_XorMode );
break;
case TYPEEDGEMODULE:
( (EDGE_MODULE*) item )->Draw( panel, DC, move_offset, g_XorMode );
item->Draw( panel, DC, g_XorMode, move_offset );
break;
default:
......@@ -337,7 +334,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
{
if( pad->m_Selected == 0 )
continue;
pad->Draw( panel, DC, move_offset, g_XorMode );
pad->Draw( panel, DC, g_XorMode, move_offset );
}
}
}
......@@ -365,11 +362,8 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
switch( item->Type() )
{
case TYPETEXTEMODULE:
( (TEXTE_MODULE*) item )->Draw( panel, DC, move_offset, g_XorMode );
break;
case TYPEEDGEMODULE:
( (EDGE_MODULE*) item )->Draw( panel, DC, move_offset, g_XorMode );
item->Draw( panel, DC, g_XorMode, move_offset );
break;
default:
......@@ -382,7 +376,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
{
if( pad->m_Selected == 0 )
continue;
pad->Draw( panel, DC, move_offset, g_XorMode );
pad->Draw( panel, DC, g_XorMode, move_offset );
}
}
}
......
......@@ -7,6 +7,12 @@
#include "pcbnew.h"
/* This is an odd place for this, but cvpcb won't link if it is
in class_board_item.cpp like I first tried it.
*/
wxPoint BOARD_ITEM::ZeroOffset(0,0);
/*****************/
/* Class BOARD: */
/*****************/
......@@ -1037,7 +1043,7 @@ void BOARD::RedrawAreasOutlines(WinEDA_DrawPanel* panel, wxDC * aDC, int aDrawMo
{
ZONE_CONTAINER* edge_zone = GetArea(ii);
if( (aLayer < 0) || (aLayer == edge_zone->GetLayer()) )
edge_zone->Draw( panel, aDC, wxPoint( 0, 0 ), aDrawMode );
edge_zone->Draw( panel, aDC, aDrawMode );
}
}
......
......@@ -16,6 +16,7 @@
#include "Add_Mires.xpm"
/********************************************************/
wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
/********************************************************/
......
......@@ -396,7 +396,7 @@ out:
/************************************************************************/
void COTATION::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int mode_color )
int mode_color, const wxPoint& offset )
/************************************************************************/
/* impression de 1 cotation : serie de n segments + 1 texte
......@@ -408,7 +408,7 @@ void COTATION::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
ox = offset.x;
oy = offset.y;
m_Text->Draw( panel, DC, offset, mode_color );
m_Text->Draw( panel, DC, mode_color, offset );
gcolor = g_DesignSettings.m_LayerColor[m_Layer];
if( (gcolor & ITEM_NOT_SHOW) != 0 )
......
......@@ -53,7 +53,8 @@ public:
void Copy( COTATION* source );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int mode_color );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC,
int aColorMode, const wxPoint& offset = ZeroOffset );
/**
* Function Move
......
......@@ -127,7 +127,7 @@ void EDGE_MODULE::SetDrawCoord()
/********************************************************************************/
void EDGE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int draw_mode )
int draw_mode, const wxPoint& offset )
/********************************************************************************/
/* Affichage d'un segment contour de module :
......
......@@ -60,10 +60,10 @@ public:
void SetDrawCoord();
/* drawing functions */
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int draw_mode );
void Draw3D( Pcb3D_GLCanvas* glcanvas );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC,
int aDrawMode, const wxPoint& offset = ZeroOffset );
void Draw3D( Pcb3D_GLCanvas* glcanvas );
/**
* Function Display_Infos
......
......@@ -182,7 +182,7 @@ bool MARKER::HitTest( const wxPoint& refPos )
/**********************************************************************/
void MARKER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int DrawMode )
void MARKER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int DrawMode, const wxPoint& offset )
/**********************************************************************/
/*
......
......@@ -51,7 +51,7 @@ public:
~MARKER();
void UnLink();
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int DrawMode );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int DrawMode, const wxPoint& offset = ZeroOffset );
/**
......
......@@ -124,7 +124,7 @@ out:
/**********************************************************/
void MIREPCB::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int mode_color )
int mode_color, const wxPoint& offset )
/**********************************************************/
/* Affichage de 1 mire : 2 segments + 1 cercle
......
......@@ -40,7 +40,7 @@ public:
void Copy( MIREPCB* source );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int mode_color );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset = ZeroOffset );
/**
......
......@@ -262,7 +262,7 @@ void MODULE::UnLink()
/**********************************************************/
void MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int draw_mode )
int draw_mode, const wxPoint& offset )
/**********************************************************/
/** Function Draw
......@@ -273,46 +273,38 @@ void MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
* @param draw_mode = GR_OR, GR_XOR, GR_AND
*/
{
D_PAD* pt_pad;
EDA_BaseStruct* PtStruct;
TEXTE_MODULE* PtTexte;
if( (m_Flags & DO_NOT_DRAW) )
return;
/* Draw pads */
pt_pad = m_Pads;
D_PAD* pt_pad = m_Pads;
for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext )
{
if( pt_pad->m_Flags & IS_MOVED )
continue;
pt_pad->Draw( panel, DC, offset, draw_mode );
pt_pad->Draw( panel, DC, draw_mode, offset );
}
/* Draws foootprint anchor */
// Draws foootprint anchor
DrawAncre( panel, DC, offset, DIM_ANCRE_MODULE, draw_mode );
/* Draw graphic items */
if( !(m_Reference->m_Flags & IS_MOVED) )
m_Reference->Draw( panel, DC, offset, draw_mode );
m_Reference->Draw( panel, DC, draw_mode, offset );
if( !(m_Value->m_Flags & IS_MOVED) )
m_Value->Draw( panel, DC, offset, draw_mode );
m_Value->Draw( panel, DC, draw_mode, offset );
PtStruct = m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Pnext )
for( BOARD_ITEM* item = m_Drawings; item; item = item->Next() )
{
if( PtStruct->m_Flags & IS_MOVED )
if( item->m_Flags & IS_MOVED )
continue;
switch( PtStruct->Type() )
switch( item->Type() )
{
case TYPETEXTEMODULE:
PtTexte = (TEXTE_MODULE*) PtStruct;
PtTexte->Draw( panel, DC, offset, draw_mode );
break;
case TYPEEDGEMODULE:
( (EDGE_MODULE*) PtStruct )->Draw( panel, DC, offset, draw_mode );
item->Draw( panel, DC, draw_mode, offset );
break;
default:
......@@ -335,16 +327,12 @@ void MODULE::DrawEdgesOnly( WinEDA_DrawPanel* panel, wxDC* DC,
* @param draw_mode = GR_OR, GR_XOR, GR_AND
*/
{
EDA_BaseStruct* PtStruct;
/* Draw graphic items */
PtStruct = m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Pnext )
for( BOARD_ITEM* item = m_Drawings; item; item = item->Next() )
{
switch( PtStruct->Type() )
switch( item->Type() )
{
case TYPEEDGEMODULE:
( (EDGE_MODULE*) PtStruct )->Draw( panel, DC, offset, draw_mode );
item->Draw( panel, DC, draw_mode, offset );
break;
default:
......
......@@ -165,10 +165,10 @@ public:
* @param panel = draw panel, Used to know the clip box
* @param DC = Current Device Context
* @param offset = draw offset (usually wxPoint(0,0)
* @param draw_mode = GR_OR, GR_XOR..
* @param aDrawMode = GR_OR, GR_XOR..
*/
void Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int draw_mode );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset = ZeroOffset );
void Draw3D( Pcb3D_GLCanvas* glcanvas );
void DrawEdgesOnly( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int draw_mode );
......
......@@ -218,7 +218,7 @@ void D_PAD::UnLink()
/*******************************************************************************************/
void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode )
void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoint& offset )
/*******************************************************************************************/
/** Draw a pad:
......
......@@ -111,7 +111,9 @@ public:
/* drawing functions */
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC,
int aDrawMode, const wxPoint& offset = ZeroOffset );
void Draw3D( Pcb3D_GLCanvas* glcanvas );
// others
......
......@@ -146,7 +146,7 @@ out:
/**********************************************************************/
void TEXTE_PCB::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int DrawMode )
int DrawMode, const wxPoint& offset )
/**********************************************************************/
/*
......
......@@ -32,8 +32,7 @@ public:
/* duplicate structure */
void Copy( TEXTE_PCB* source );
void Draw( WinEDA_DrawPanel * panel, wxDC * DC,
const wxPoint & offset, int DrawMode );
void Draw( WinEDA_DrawPanel * panel, wxDC* DC, int aDrawMode, const wxPoint& offset = ZeroOffset );
// File Operations:
int ReadTextePcbDescr( FILE* File, int* LineNum );
......
......@@ -267,7 +267,7 @@ EDA_Rect TEXTE_MODULE::GetBoundingBox()
}
/******************************************************************************************/
void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, wxPoint offset, int draw_mode )
void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoint& offset )
/******************************************************************************************/
/** Function Draw
......
......@@ -84,7 +84,7 @@ public:
int ReadDescr( FILE* File, int* LineNum = NULL );
/* drawing functions */
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, wxPoint offset, int draw_mode );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset = ZeroOffset );
/**
......
......@@ -626,7 +626,7 @@ bool TRACK::Save( FILE* aFile ) const
/*********************************************************************/
void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode )
void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoint& notUsed )
/*********************************************************************/
/** Draws the segment.
......
......@@ -146,7 +146,7 @@ public:
/* Display on screen: */
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset = ZeroOffset );
/* divers */
int Shape() const { return m_Shape & 0xFF; }
......
......@@ -235,7 +235,7 @@ int ZONE_CONTAINER::ReadDescr( FILE* aFile, int* aLineNum )
/****************************************************************************************************/
void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode )
void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoint& offset )
/****************************************************************************************************/
/** Function Draw
......
......@@ -68,10 +68,9 @@ public:
* @param panel = current Draw Panel
* @param DC = current Device Context
* @param offset = Draw offset (usually wxPoint(0,0))
* @param draw_mode = draw mode: OR, XOR ..
* @param aDrawMode = GR_OR, GR_XOR, GR_COPY ..
*/
void Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int draw_mode );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset = ZeroOffset );
/**
......
......@@ -162,7 +162,7 @@ void WinEDA_CotationPropertiesFrame::OnOkClick( wxCommandEvent& event )
{
if( m_DC ) // Effacement ancien texte
{
CurrentCotation->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_XOR );
CurrentCotation->Draw( m_Parent->DrawPanel, m_DC, GR_XOR );
}
if( m_Name->GetValue() != wxEmptyString )
......@@ -183,7 +183,7 @@ void WinEDA_CotationPropertiesFrame::OnOkClick( wxCommandEvent& event )
if( m_DC ) // Affichage nouveau texte
{
/* Redessin du Texte */
CurrentCotation->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_OR );
CurrentCotation->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
}
m_Parent->m_CurrentScreen->SetModify();
......@@ -201,12 +201,12 @@ static void Exit_EditCotation( WinEDA_DrawPanel* Panel, wxDC* DC )
{
if( Cotation->m_Flags & IS_NEW )
{
Cotation->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR );
Cotation->Draw( Panel, DC, GR_XOR );
Cotation->DeleteStructure();
}
else
{
Cotation->Draw( Panel, DC, wxPoint( 0, 0 ), GR_OR );
Cotation->Draw( Panel, DC, GR_OR );
}
}
......@@ -262,7 +262,7 @@ COTATION* WinEDA_PcbFrame::Begin_Cotation( COTATION* Cotation, wxDC* DC )
Ajuste_Details_Cotation( Cotation );
Cotation->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Cotation->Draw( DrawPanel, DC, GR_XOR );
DrawPanel->ManageCurseur = Montre_Position_New_Cotation;
DrawPanel->ForceCloseManageCurseur = Exit_EditCotation;
......@@ -276,7 +276,7 @@ COTATION* WinEDA_PcbFrame::Begin_Cotation( COTATION* Cotation, wxDC* DC )
return Cotation;
}
Cotation->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
Cotation->Draw( DrawPanel, DC, GR_OR );
Cotation->m_Flags = 0;
/* Insertion de la structure dans le Chainage .Drawings du PCB */
......@@ -309,7 +309,7 @@ static void Montre_Position_New_Cotation( WinEDA_DrawPanel* panel, wxDC* DC, boo
/* efface ancienne position */
if( erase )
{
Cotation->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR );
Cotation->Draw( panel, DC, GR_XOR );
}
Cotation->SetLayer( screen->m_Active_Layer );
......@@ -345,7 +345,7 @@ static void Montre_Position_New_Cotation( WinEDA_DrawPanel* panel, wxDC* DC, boo
Ajuste_Details_Cotation( Cotation );
}
Cotation->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR );
Cotation->Draw( panel, DC, GR_XOR );
}
......@@ -372,7 +372,7 @@ void WinEDA_PcbFrame::Delete_Cotation( COTATION* Cotation, wxDC* DC )
return;
if( DC )
Cotation->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Cotation->Draw( DrawPanel, DC, GR_XOR );
Cotation->DeleteStructure();
m_CurrentScreen->SetModify();
}
......
......@@ -425,8 +425,8 @@ void WinEDA_TextModPropertiesFrame::TextModPropertiesAccept( wxCommandEvent& eve
m_Parent->SaveCopyInUndoList( m_Parent->m_Pcb->m_Modules );
if( m_DC ) // Effacement ancien texte
{
m_CurrentTextMod->Draw( m_Parent->DrawPanel, m_DC,
(m_CurrentTextMod->m_Flags & IS_MOVED) ? MoveVector : wxPoint( 0, 0 ), GR_XOR );
m_CurrentTextMod->Draw( m_Parent->DrawPanel, m_DC, GR_XOR,
(m_CurrentTextMod->m_Flags & IS_MOVED) ? MoveVector : wxPoint( 0, 0 ) );
}
m_CurrentTextMod->m_Text = m_Name->GetValue();
......@@ -465,8 +465,8 @@ void WinEDA_TextModPropertiesFrame::TextModPropertiesAccept( wxCommandEvent& eve
m_CurrentTextMod->SetDrawCoord();
if( m_DC ) // Display new text
{
m_CurrentTextMod->Draw( m_Parent->DrawPanel, m_DC,
(m_CurrentTextMod->m_Flags & IS_MOVED) ? MoveVector : wxPoint( 0, 0 ), GR_XOR );
m_CurrentTextMod->Draw( m_Parent->DrawPanel, m_DC, GR_XOR,
(m_CurrentTextMod->m_Flags & IS_MOVED) ? MoveVector : wxPoint( 0, 0 ) );
}
m_Parent->GetScreen()->SetModify();
( (MODULE*) m_CurrentTextMod->m_Parent )->m_LastEdit_Time = time( NULL );
......
......@@ -588,7 +588,7 @@ void WinEDA_ModulePropertiesFrame::OnOkClick( wxCommandEvent& event )
EndModal( 1 );
if( m_DC )
m_CurrentModule->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_OR );
m_CurrentModule->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
if( m_DC )
m_Parent->DrawPanel->CursorOn( m_DC );
}
......
......@@ -39,7 +39,7 @@ void WinEDA_ModuleEditFrame::Start_Move_EdgeMod( EDGE_MODULE* Edge, wxDC* DC )
{
if( Edge == NULL )
return;
Edge->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Edge->Draw( DrawPanel, DC, GR_XOR );
Edge->m_Flags |= IS_MOVED;
MoveVector.x = MoveVector.y = 0;
CursorInitialPosition = GetScreen()->m_Curseur;
......@@ -70,7 +70,7 @@ void WinEDA_ModuleEditFrame::Place_EdgeMod( EDGE_MODULE* Edge, wxDC* DC )
Edge->m_End0.x -= MoveVector.x;
Edge->m_End0.y -= MoveVector.y;
Edge->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
Edge->Draw( DrawPanel, DC, GR_OR );
Edge->m_Flags = 0;
DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL;
......@@ -96,13 +96,13 @@ static void Move_Segment( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
if( erase )
{
Edge->Draw( panel, DC, MoveVector, GR_XOR );
Edge->Draw( panel, DC, GR_XOR, MoveVector );
}
MoveVector.x = -(screen->m_Curseur.x - CursorInitialPosition.x);
MoveVector.y = -(screen->m_Curseur.y - CursorInitialPosition.y);
Edge->Draw( panel, DC, MoveVector, GR_XOR );
Edge->Draw( panel, DC, GR_XOR, MoveVector );
Module->Set_Rectangle_Encadrement();
}
......@@ -125,7 +125,7 @@ static void ShowEdgeModule( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
// if( erase )
{
Edge->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR );
Edge->Draw( panel, DC, GR_XOR );
}
Edge->m_End = screen->m_Curseur;
......@@ -136,7 +136,7 @@ static void ShowEdgeModule( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
RotatePoint( (int*) &Edge->m_End0.x,
(int*) &Edge->m_End0.y, -Module->m_Orient );
Edge->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR );
Edge->Draw( panel, DC, GR_XOR );
Module->Set_Rectangle_Encadrement();
}
......@@ -283,7 +283,7 @@ void WinEDA_ModuleEditFrame::Delete_Edge_Module( EDGE_MODULE* Edge, wxDC* DC )
}
MODULE* Module = (MODULE*) Edge->m_Parent;
Edge->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Edge->Draw( DrawPanel, DC, GR_XOR );
/* suppression d'un segment */
Edge ->DeleteStructure();
......@@ -306,15 +306,15 @@ static void Exit_EditEdge_Module( WinEDA_DrawPanel* Panel, wxDC* DC )
if( Edge->m_Flags & IS_NEW ) /* effacement du nouveau contour */
{
MODULE* Module = (MODULE*) Edge->m_Parent;
Edge->Draw( Panel, DC, MoveVector, GR_XOR );
Edge->Draw( Panel, DC, GR_XOR, MoveVector );
Edge ->DeleteStructure();
Module->Set_Rectangle_Encadrement();
}
else
{
Edge->Draw( Panel, DC, MoveVector, GR_XOR );
Edge->Draw( Panel, DC, GR_XOR, MoveVector );
Edge->m_Flags = 0;
Edge->Draw( Panel, DC, wxPoint( 0, 0 ), GR_OR );
Edge->Draw( Panel, DC, GR_OR );
}
}
Panel->ManageCurseur = NULL;
......@@ -390,7 +390,7 @@ EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge,
if( (Edge->m_Start0.x) != (Edge->m_End0.x)
|| (Edge->m_Start0.y) != (Edge->m_End0.y) )
{
Edge->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
Edge->Draw( DrawPanel, DC, GR_OR );
EDGE_MODULE* newedge = new EDGE_MODULE( Module );
newedge->Copy( Edge );
newedge->AddToChain( Edge );
......
......@@ -521,10 +521,10 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
* and zone_cont->m_CornerSelection+1
* and start move the new corner
*/
zone_cont->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), GR_XOR );
zone_cont->Draw( DrawPanel, &dc, GR_XOR );
zone_cont->m_Poly->InsertCorner( zone_cont->m_CornerSelection, pos.x, pos.y );
zone_cont->m_CornerSelection++;
zone_cont->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), GR_XOR );
zone_cont->Draw( DrawPanel, &dc, GR_XOR );
Start_Move_Zone_Corner( &dc, zone_cont, zone_cont->m_CornerSelection, true );
break;
}
......
......@@ -155,11 +155,6 @@ void WinEDA_PcbFrame::Drawing_SetNewWidth( DRAWSEGMENT* DrawSegm, wxDC* DC )
void WinEDA_PcbFrame::Delete_Drawings_All_Layer( DRAWSEGMENT* Segment, wxDC* DC )
/******************************************************************************/
{
DRAWSEGMENT* pt_segm;
TEXTE_PCB* pt_txt;
BOARD_ITEM* PtStruct;
BOARD_ITEM* PtNext;
COTATION* Cotation;
int layer = Segment->GetLayer();
if( layer <= LAST_COPPER_LAYER )
......@@ -178,39 +173,28 @@ void WinEDA_PcbFrame::Delete_Drawings_All_Layer( DRAWSEGMENT* Segment, wxDC* DC
if( !IsOK( this, msg ) )
return;
PtStruct = m_Pcb->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtNext )
BOARD_ITEM* PtNext;
for( BOARD_ITEM* item = m_Pcb->m_Drawings; item; item = PtNext )
{
GetScreen()->SetModify();
PtNext = PtStruct->Next();
PtNext = item->Next();
switch( PtStruct->Type() )
switch( item->Type() )
{
case TYPEDRAWSEGMENT:
pt_segm = (DRAWSEGMENT*) PtStruct;
if( pt_segm->GetLayer() == layer )
if( item->GetLayer() == layer )
{
Trace_DrawSegmentPcb( DrawPanel, DC, pt_segm, GR_XOR );
PtStruct ->DeleteStructure();
Trace_DrawSegmentPcb( DrawPanel, DC, (DRAWSEGMENT*) item, GR_XOR );
item->DeleteStructure();
}
break;
case TYPETEXTE:
pt_txt = (TEXTE_PCB*) PtStruct;
if( pt_txt->GetLayer() == layer )
{
pt_txt->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
PtStruct ->DeleteStructure();
}
break;
case TYPECOTATION:
Cotation = (COTATION*) PtStruct;
if( Cotation->GetLayer() == layer )
if( item->GetLayer() == layer )
{
Cotation->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
PtStruct ->DeleteStructure();
item->Draw( DrawPanel, DC, GR_XOR );
item->DeleteStructure();
}
break;
......
......@@ -443,7 +443,7 @@ void WinEDA_PadPropertiesFrame::PadPropertiesAccept( wxCommandEvent& event )
Module->m_LastEdit_Time = time( NULL );
if( m_DC )
CurrentPad->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_XOR );
CurrentPad->Draw( m_Parent->DrawPanel, m_DC, GR_XOR );
CurrentPad->m_PadShape = g_Pad_Master.m_PadShape;
CurrentPad->m_Attribut = g_Pad_Master.m_Attribut;
if (CurrentPad->m_Pos != g_Pad_Master.m_Pos )
......@@ -530,7 +530,7 @@ void WinEDA_PadPropertiesFrame::PadPropertiesAccept( wxCommandEvent& event )
Module->Set_Rectangle_Encadrement();
CurrentPad->Display_Infos( m_Parent );
if( m_DC )
CurrentPad->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_OR );
CurrentPad->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
m_Parent->GetScreen()->SetModify();
}
......
......@@ -477,10 +477,10 @@ void WinEDA_PcbFrame::Affiche_PadsNoConnect( wxDC* DC )
pt_pad = pt_chevelu->pad_start;
if( pt_pad )
pt_pad->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR | GR_SURBRILL );
pt_pad->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL );
pt_pad = pt_chevelu->pad_end;
if( pt_pad )
pt_pad->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR | GR_SURBRILL );
pt_pad->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL );
}
}
......@@ -56,7 +56,7 @@ TEXTE_MODULE* WinEDA_BasePcbFrame::CreateTextModule( MODULE* Module, wxDC* DC )
InstallTextModOptionsFrame( Text, NULL, wxPoint( -1, -1 ) );
Text->m_Flags = 0;
Text->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
Text->Draw( DrawPanel, DC, GR_OR );
Text->Display_Infos( this );
......@@ -74,14 +74,14 @@ void WinEDA_BasePcbFrame::RotateTextModule( TEXTE_MODULE* Text, wxDC* DC )
MODULE* module = (MODULE*) Text->m_Parent;
Text->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Text->Draw( DrawPanel, DC, GR_XOR );
Text->m_Orient += 900;
while( Text->m_Orient >= 1800 )
Text->m_Orient -= 1800;
/* Redessin du Texte */
Text->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Text->Draw( DrawPanel, DC, GR_XOR );
Text->Display_Infos( this );
......@@ -107,7 +107,7 @@ void WinEDA_BasePcbFrame::DeleteTextModule( TEXTE_MODULE* Text, wxDC* DC )
if( Text->m_Type == TEXT_is_DIVERS )
{
Text->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Text->Draw( DrawPanel, DC, GR_XOR );
/* liberation de la memoire : */
Text ->DeleteStructure();
......@@ -137,10 +137,10 @@ static void ExitTextModule( WinEDA_DrawPanel* Panel, wxDC* DC )
return;
Module = (MODULE*) Text->m_Parent;
Text->Draw( Panel, DC, MoveVector, GR_XOR );
Text->Draw( Panel, DC, GR_XOR, MoveVector );
/* Redessin du Texte */
Text->Draw( Panel, DC, wxPoint( 0, 0 ), GR_OR );
Text->Draw( Panel, DC, GR_OR );
Text->m_Flags = 0;
Module->m_Flags = 0;
......@@ -205,7 +205,7 @@ void WinEDA_BasePcbFrame::PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC )
GetScreen()->SetModify();
/* Redessin du Texte */
Text->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
Text->Draw( DrawPanel, DC, GR_OR );
}
}
......@@ -229,11 +229,11 @@ static void Show_MoveTexte_Module( WinEDA_DrawPanel* panel, wxDC* DC, bool erase
/* effacement du texte : */
if( erase )
Text->Draw( panel, DC, MoveVector, GR_XOR );
Text->Draw( panel, DC, GR_XOR, MoveVector );
MoveVector.x = -(screen->m_Curseur.x - CursorInitialPosition.x);
MoveVector.y = -(screen->m_Curseur.y - CursorInitialPosition.y);
/* Redessin du Texte */
Text->Draw( panel, DC, MoveVector, GR_XOR );
Text->Draw( panel, DC, GR_XOR, MoveVector );
}
......@@ -285,7 +285,7 @@ MODULE* WinEDA_PcbFrame::Genere_Self( wxDC* DC )
Module->m_Attributs = MOD_VIRTUAL | MOD_CMS;
Module->m_Flags = 0;
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Module->Draw( DrawPanel, DC, GR_XOR );
/* Generation des elements speciaux: drawsegments */
LastSegm = (EDGE_MODULE*) Module->m_Drawings;
......@@ -472,7 +472,7 @@ MODULE* WinEDA_PcbFrame::Genere_Self( wxDC* DC )
Module->Set_Rectangle_Encadrement();
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
Module->Draw( DrawPanel, DC, GR_OR );
return Module;
}
......
......@@ -266,7 +266,7 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC )
Module->Display_Infos( this );
/* Effacement du module */
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Module->Draw( DrawPanel, DC, GR_XOR );
pt_pad = (D_PAD*) Module->m_Pads;
for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext )
......@@ -345,7 +345,7 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC )
}
Module->Set_Rectangle_Encadrement();
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
Module->Draw( DrawPanel, DC, GR_OR );
}
GetScreen()->SetModify();
......
......@@ -69,21 +69,21 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl
case TYPECOTATION:
if( (g_TabOneLayerMask[ PtStruct->GetLayer()] & printmasklayer) == 0 )
break;
( (COTATION*) PtStruct )->Draw( this, DC, wxPoint( 0, 0 ), drawmode );
( (COTATION*) PtStruct )->Draw( this, DC, drawmode );
break;
case TYPETEXTE:
{
if( (g_TabOneLayerMask[ PtStruct->GetLayer()] & printmasklayer) == 0 )
break;
( (TEXTE_PCB*) PtStruct )->Draw( this, DC, wxPoint( 0, 0 ), drawmode );
( (TEXTE_PCB*) PtStruct )->Draw( this, DC, drawmode );
break;
}
case TYPEMIRE:
if( (g_TabOneLayerMask[ PtStruct->GetLayer()] & printmasklayer) == 0 )
break;
( (MIREPCB*) PtStruct )->Draw( this, DC, wxPoint( 0, 0 ), drawmode );
( (MIREPCB*) PtStruct )->Draw( this, DC, drawmode );
break;
case TYPEMARKER: /* Trace des marqueurs */
......@@ -170,7 +170,7 @@ static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC,
{
if( (pt_pad->m_Masque_Layer & masklayer ) == 0 )
continue;
pt_pad->Draw( panel, DC, wxPoint( 0, 0 ), draw_mode );
pt_pad->Draw( panel, DC, draw_mode );
}
/* draw footprint graphic shapes */
......@@ -192,9 +192,9 @@ static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC,
trace_val = FALSE;
if( trace_ref )
Module->m_Reference->Draw( panel, DC, wxPoint( 0, 0 ), draw_mode );
Module->m_Reference->Draw( panel, DC, draw_mode );
if( trace_val )
Module->m_Value->Draw( panel, DC, wxPoint( 0, 0 ), draw_mode );
Module->m_Value->Draw( panel, DC, draw_mode );
}
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
......@@ -206,7 +206,7 @@ static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC,
break;
TextMod = (TEXTE_MODULE*) PtStruct;
TextMod->Draw( panel, DC, wxPoint( 0, 0 ), draw_mode );
TextMod->Draw( panel, DC, draw_mode );
break;
case TYPEEDGEMODULE:
......@@ -214,7 +214,7 @@ static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC,
EDGE_MODULE* edge = (EDGE_MODULE*) PtStruct;
if( (g_TabOneLayerMask[edge->GetLayer()] & masklayer ) == 0 )
break;
edge->Draw( panel, DC, wxPoint( 0, 0 ), draw_mode );
edge->Draw( panel, DC, draw_mode );
break;
}
......
......@@ -162,7 +162,7 @@ MODULE* WinEDA_BasePcbFrame::Load_Module_From_Library( const wxString& library,
module->SetPosition( curspos );
build_liste_pads();
module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
module->Draw( DrawPanel, DC, GR_OR );
}
return module;
......
......@@ -143,13 +143,13 @@ void WinEDA_MirePropertiesFrame::OnOkClick( wxCommandEvent& event )
/* Met a jour les differents parametres pour le composant en cours d'dition
*/
{
m_MirePcb->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_XOR );
m_MirePcb->Draw( m_Parent->DrawPanel, m_DC, GR_XOR );
m_MirePcb->m_Width = m_MireWidthCtrl->GetValue();
MireDefaultSize = m_MirePcb->m_Size = m_MireSizeCtrl->GetValue();
m_MirePcb->m_Shape = m_MireShape->GetSelection() ? 1 : 0;
m_MirePcb->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_OR );
m_MirePcb->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
m_Parent->GetScreen()->SetModify();
EndModal( 1 );
......@@ -163,8 +163,8 @@ void WinEDA_PcbFrame::Delete_Mire( MIREPCB* MirePcb, wxDC* DC )
if( MirePcb == NULL )
return;
MirePcb->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
MirePcb ->DeleteStructure();
MirePcb->Draw( DrawPanel, DC, GR_XOR );
MirePcb->DeleteStructure();
}
......@@ -181,11 +181,11 @@ static void Exit_EditMire( WinEDA_DrawPanel* Panel, wxDC* DC )
if( MirePcb )
{
/* Effacement de la mire */
MirePcb->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR );
MirePcb->Draw( Panel, DC, GR_XOR );
if( MirePcb->m_Flags & IS_NEW )
{
MirePcb->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR );
MirePcb->Draw( Panel, DC, GR_XOR );
MirePcb ->DeleteStructure();
MirePcb = NULL;
}
......@@ -193,7 +193,7 @@ static void Exit_EditMire( WinEDA_DrawPanel* Panel, wxDC* DC )
{
MirePcb->m_Pos = OldPos;
MirePcb->m_Flags = 0;
MirePcb->Draw( Panel, DC, wxPoint( 0, 0 ), GR_OR );
MirePcb->Draw( Panel, DC, GR_OR );
}
}
}
......@@ -250,7 +250,7 @@ void WinEDA_PcbFrame::Place_Mire( MIREPCB* MirePcb, wxDC* DC )
if( MirePcb == NULL )
return;
MirePcb->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
MirePcb->Draw( DrawPanel, DC, GR_OR );
MirePcb->m_Flags = 0;
DrawPanel->ManageCurseur = NULL;
......@@ -273,10 +273,10 @@ static void Montre_Position_Mire( WinEDA_DrawPanel* panel, wxDC* DC, bool erase
/* efface ancienne position */
if( erase )
MirePcb->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR );
MirePcb->Draw( panel, DC, GR_XOR );
MirePcb->m_Pos = screen->m_Curseur;
// Reaffichage
MirePcb->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR );
MirePcb->Draw( panel, DC, GR_XOR );
}
......@@ -47,7 +47,7 @@ void Show_Pads_On_Off( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* module )
pt_pad = module->m_Pads;
for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext )
{
pt_pad->Draw( panel, DC, g_Offset_Module, GR_XOR );
pt_pad->Draw( panel, DC, GR_XOR, g_Offset_Module );
}
DisplayOpt.DisplayPadFill = pad_fill_tmp;
......@@ -200,7 +200,7 @@ void Exit_Module( WinEDA_DrawPanel* Panel, wxDC* DC )
pcbframe->Rotate_Module( NULL, module, ModuleInitOrient, FALSE );
if( ModuleInitLayer != module->GetLayer() )
pcbframe->m_Pcb->Change_Side_Module( module, NULL );
module->Draw( Panel, DC, wxPoint( 0, 0 ), GR_OR );
module->Draw( Panel, DC, GR_OR );
}
g_Drag_Pistes_On = FALSE;
Panel->ManageCurseur = NULL;
......@@ -520,7 +520,7 @@ void BOARD::Change_Side_Module( MODULE* Module, wxDC* DC )
{
if( DC && m_PcbFrame )
{
Module->Draw( m_PcbFrame->DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
Module->Draw( m_PcbFrame->DrawPanel, DC, GR_OR );
/* affichage chevelu general si necessaire */
m_PcbFrame->ReCompile_Ratsnest_After_Changes( DC );
......@@ -671,7 +671,7 @@ void WinEDA_BasePcbFrame::Place_Module( MODULE* module, wxDC* DC )
module->SetPosition( newpos );
if( DC )
module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
module->Draw( DrawPanel, DC, GR_OR );
/* Tracage des segments dragges et liberation memoire */
if( g_DragSegmentList )
......@@ -756,7 +756,7 @@ void WinEDA_BasePcbFrame::Rotate_Module( wxDC* DC, MODULE* module,
{
if( !(module->m_Flags & IS_MOVED) ) /* Rotation simple */
{
module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
module->Draw( DrawPanel, DC, GR_OR );
/* Reaffichage chevelu general si necessaire */
ReCompile_Ratsnest_After_Changes( DC );
......@@ -792,7 +792,7 @@ void DrawModuleOutlines( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* module )
pt_pad = module->m_Pads;
for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext )
{
pt_pad->Draw( panel, DC, g_Offset_Module, GR_XOR );
pt_pad->Draw( panel, DC, GR_XOR, g_Offset_Module );
}
DisplayOpt.DisplayPadFill = pad_fill_tmp;
......
......@@ -36,10 +36,10 @@ static void Exit_Move_Pad( WinEDA_DrawPanel* Panel, wxDC* DC )
if( pad == NULL )
return;
pad->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR );
pad->Draw( Panel, DC, GR_XOR );
pad->m_Flags = 0;
pad->m_Pos = Pad_OldPos;
pad->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR );
pad->Draw( Panel, DC, GR_XOR );
/* Pad Move en cours : remise a l'etat d'origine */
if( g_Drag_Pistes_On )
{
......@@ -72,9 +72,10 @@ static void Show_Pad_Move( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
D_PAD* pad = s_CurrentSelectedPad;
if( erase )
pad->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR );
pad->Draw( panel, DC, GR_XOR );
pad->m_Pos = screen->m_Curseur;
pad->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR );
pad->Draw( panel, DC, GR_XOR );
if( !g_Drag_Pistes_On )
return;
......@@ -141,7 +142,7 @@ void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* pt_pad, wxDC* DC )
*/
{
if( DC )
pt_pad->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
pt_pad->Draw( DrawPanel, DC, GR_XOR );
pt_pad->m_PadShape = g_Pad_Master.m_PadShape;
pt_pad->m_Masque_Layer = g_Pad_Master.m_Masque_Layer;
......@@ -178,7 +179,7 @@ void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* pt_pad, wxDC* DC )
pt_pad->ComputeRayon();
if( DC )
pt_pad->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
pt_pad->Draw( DrawPanel, DC, GR_XOR );
( (MODULE*) pt_pad->m_Parent )->m_LastEdit_Time = time( NULL );
}
......@@ -247,7 +248,7 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, wxDC* DC )
/* Redessin du module */
Module->Set_Rectangle_Encadrement();
Pad->Display_Infos( this );
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
Module->Draw( DrawPanel, DC, GR_OR );
}
......@@ -301,9 +302,9 @@ void WinEDA_BasePcbFrame::StartMovePad( D_PAD* Pad, wxDC* DC )
DrawPanel->ForceCloseManageCurseur = Exit_Move_Pad;
/* Draw the pad (SKETCH mode) */
Pad->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Pad->Draw( DrawPanel, DC, GR_XOR );
Pad->m_Flags |= IS_MOVED;
Pad->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Pad->Draw( DrawPanel, DC, GR_XOR );
/* Build the list of track segments to drag if the command is a drag pad*/
if( g_Drag_Pistes_On )
......@@ -329,7 +330,7 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC )
Module = (MODULE*) Pad->m_Parent;
/* Placement du pad */
Pad->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Pad->Draw( DrawPanel, DC, GR_XOR );
/* Save old module */
Pad->m_Pos = Pad_OldPos; SaveCopyInUndoList( m_Pcb->m_Modules );
......@@ -345,7 +346,7 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC )
Pad->m_Flags = 0;
Pad->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
Pad->Draw( DrawPanel, DC, GR_OR );
Module->Set_Rectangle_Encadrement();
Module->m_LastEdit_Time = time( NULL );
......@@ -386,7 +387,7 @@ void WinEDA_BasePcbFrame::RotatePad( D_PAD* Pad, wxDC* DC )
GetScreen()->SetModify();
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Module->Draw( DrawPanel, DC, GR_XOR );
EXCHG( Pad->m_Size.x, Pad->m_Size.y );
EXCHG( Pad->m_Drill.x, Pad->m_Drill.y );
......@@ -400,5 +401,5 @@ void WinEDA_BasePcbFrame::RotatePad( D_PAD* Pad, wxDC* DC )
Module->Set_Rectangle_Encadrement();
Pad->Display_Infos( this );
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
Module->Draw( DrawPanel, DC, GR_OR );
}
......@@ -86,7 +86,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveBasicShape( wxDC* DC,
}
if( DC )
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
Module->Draw( DrawPanel, DC, GR_OR );
return Module;
}
......@@ -102,12 +102,12 @@ static void Exit_Muonde( WinEDA_DrawFrame* frame, wxDC* DC )
{
if( Module->m_Flags & IS_NEW )
{
Module->Draw( frame->DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Module->Draw( frame->DrawPanel, DC, GR_XOR );
Module ->DeleteStructure();
}
else
{
Module->Draw( frame->DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Module->Draw( frame->DrawPanel, DC, GR_XOR );
}
}
......@@ -273,7 +273,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( wxDC* DC, int shape_type )
}
Module->Set_Rectangle_Encadrement();
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
Module->Draw( DrawPanel, DC, GR_OR );
DrawPanel->MouseToCursorSchema();
m_Pcb->m_Status_Pcb = 0;
m_CurrentScreen->SetModify();
......@@ -644,7 +644,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWavePolygonShape( wxDC* DC )
PolyEdges = NULL;
Module->Set_Rectangle_Encadrement();
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
Module->Draw( DrawPanel, DC, GR_OR );
m_Pcb->m_Status_Pcb = 0;
m_CurrentScreen->SetModify();
return Module;
......@@ -685,7 +685,7 @@ void WinEDA_PcbFrame::Edit_Gap( wxDC* DC, MODULE* Module )
}
/* Effacement du module: */
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Module->Draw( DrawPanel, DC, GR_XOR );
/* Calcul de la dimension actuelle */
gap_size = next_pad->m_Pos0.x - pad->m_Pos0.x - pad->m_Size.x;
......@@ -728,5 +728,5 @@ void WinEDA_PcbFrame::Edit_Gap( wxDC* DC, MODULE* Module )
RotatePoint( &(next_pad->m_Pos.x), &(next_pad->m_Pos.y),
Module->m_Pos.x, Module->m_Pos.y, Module->m_Orient );
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
Module->Draw( DrawPanel, DC, GR_OR );
}
......@@ -215,7 +215,7 @@ void WinEDA_TextPCBPropertiesFrame::OnOkClick( wxCommandEvent& event )
if( m_DC ) // Effacement ancien texte
{
CurrentTextPCB->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_XOR );
CurrentTextPCB->Draw( m_Parent->DrawPanel, m_DC, GR_XOR );
}
if( !m_Name->GetValue().IsEmpty() )
......@@ -238,7 +238,7 @@ void WinEDA_TextPCBPropertiesFrame::OnOkClick( wxCommandEvent& event )
if( m_DC ) // Affichage nouveau texte
{
/* Redessin du Texte */
CurrentTextPCB->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_OR );
CurrentTextPCB->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
}
m_Parent->m_CurrentScreen->SetModify();
EndModal( 1 );
......@@ -260,9 +260,9 @@ void Exit_Texte_Pcb( WinEDA_DrawPanel* Panel, wxDC* DC )
if( TextePcb )
{
TextePcb->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR );
TextePcb->Draw( Panel, DC, GR_XOR );
TextePcb->m_Pos = old_pos;
TextePcb->Draw( Panel, DC, wxPoint( 0, 0 ), GR_OR );
TextePcb->Draw( Panel, DC, GR_OR );
TextePcb->m_Flags = 0;
}
......@@ -284,7 +284,7 @@ void WinEDA_PcbFrame::Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
return;
TextePcb->CreateDrawData();
TextePcb->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
TextePcb->Draw( DrawPanel, DC, GR_OR );
DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL;
SetCurItem( NULL );
......@@ -303,7 +303,7 @@ void WinEDA_PcbFrame::StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC )
if( TextePcb == NULL )
return;
old_pos = TextePcb->m_Pos;
TextePcb->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
TextePcb->Draw( DrawPanel, DC, GR_XOR );
TextePcb->m_Flags |= IS_MOVED;
TextePcb->Display_Infos( this );
DrawPanel->ManageCurseur = Move_Texte_Pcb;
......@@ -327,12 +327,12 @@ static void Move_Texte_Pcb( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/* effacement du texte : */
if( erase )
TextePcb->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR );
TextePcb->Draw( panel, DC, GR_XOR );
TextePcb->m_Pos = panel->m_Parent->m_CurrentScreen->m_Curseur;
/* Redessin du Texte */
TextePcb->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR );
TextePcb->Draw( panel, DC, GR_XOR );
}
......@@ -343,7 +343,7 @@ void WinEDA_PcbFrame::Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
if( TextePcb == NULL )
return;
TextePcb->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
TextePcb->Draw( DrawPanel, DC, GR_XOR );
/* Suppression du texte en Memoire*/
TextePcb ->DeleteStructure();
......@@ -403,7 +403,7 @@ void WinEDA_PcbFrame::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
return;
/* effacement du texte : */
TextePcb->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
TextePcb->Draw( DrawPanel, DC, GR_XOR );
TextePcb->m_Orient += angle;
......@@ -415,7 +415,7 @@ void WinEDA_PcbFrame::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
TextePcb->CreateDrawData();
/* Redessin du Texte */
TextePcb->Draw( DrawPanel, DC, wxPoint( 0, 0 ), drawmode );
TextePcb->Draw( DrawPanel, DC, drawmode );
TextePcb->Display_Infos( this );
m_CurrentScreen->SetModify();
......
......@@ -254,8 +254,8 @@ int WinEDA_PcbFrame::Solve( wxDC* DC, int two_sides )
/* Affiche Liaison */
GRLine( &DrawPanel->m_ClipBox, DC, segm_oX, segm_oY, segm_fX, segm_fY, 0, WHITE | GR_XOR );
pt_cur_ch->pad_start->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR | GR_SURBRILL );
pt_cur_ch->pad_end->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR | GR_SURBRILL );
pt_cur_ch->pad_start->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL );
pt_cur_ch->pad_end->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL );
success = Route_1_Trace( this, DC, two_sides, row_source, col_source,
row_target, col_target, pt_cur_ch );
......@@ -288,8 +288,8 @@ int WinEDA_PcbFrame::Solve( wxDC* DC, int two_sides )
Affiche_1_Parametre( this, 72, wxT( "NoConn" ), msg, LIGHTCYAN );
/* Effacement des affichages de routage sur l'ecran */
pt_cur_ch->pad_start->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_AND );
pt_cur_ch->pad_end->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_AND );
pt_cur_ch->pad_start->Draw( DrawPanel, DC, GR_AND );
pt_cur_ch->pad_end->Draw( DrawPanel, DC, GR_AND );
if( stop )
break;
......
......@@ -184,15 +184,13 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode )
}
#endif
wxPoint zero(0,0); // construct outside loop for speed
// Redraw ZONE_CONTAINERS
BOARD::ZONE_CONTAINERS& zones = m_Pcb->m_ZoneDescriptorList;
for( BOARD::ZONE_CONTAINERS::iterator zc = zones.begin(); zc!=zones.end(); ++zc )
{
if( (*zc)->GetNet() == NetCode )
{
(*zc)->Draw( DrawPanel, DC, zero, draw_mode );
(*zc)->Draw( DrawPanel, DC, draw_mode );
}
}
......@@ -221,14 +219,12 @@ static void Pad_Surbrillance( WinEDA_DrawPanel* panel,
{
D_PAD* pt_pad;
wxPoint zero(0,0); // construct outside loop for speed
/* trace des pastilles */
for( pt_pad = Module->m_Pads; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext )
{
if( pt_pad->GetNet() == NetCode )
{
pt_pad->Draw( panel, DC, zero, draw_mode );
pt_pad->Draw( panel, DC, draw_mode );
}
}
}
......@@ -58,7 +58,7 @@ void Trace_Pads_Only( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* Module,
{
if( (pt_pad->m_Masque_Layer & MasqueLayer) == 0 )
continue;
pt_pad->Draw( panel, DC, wxPoint( ox, oy ), draw_mode );
pt_pad->Draw( panel, DC, draw_mode, wxPoint( ox, oy ) );
}
frame->m_DisplayPadFill = tmp;
......
......@@ -50,7 +50,7 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
Module = (MODULE*) m_Pcb->m_Modules;
for( ; Module != NULL; Module = (MODULE*) Module->Pnext )
{
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
Module->Draw( DrawPanel, DC, GR_OR );
}
Affiche_Status_Box();
......@@ -87,78 +87,73 @@ void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
Trace_Pcb( DC, GR_OR );
TraceWorkSheet( DC, GetScreen(), 0 );
Affiche_Status_Box();
if( DrawPanel->ManageCurseur )
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
/* Redraw the cursor */
// Redraw the cursor
DrawPanel->Trace_Curseur( DC );
}
#define DRAW_CUR_LAYER_LAST 1
/****************************************************/
void WinEDA_PcbFrame::Trace_Pcb( wxDC* DC, int mode )
/****************************************************/
/* Redraw the BOARD items but not cursors, axis or grid */
{
MODULE* Module;
EDA_BaseStruct* PtStruct;
if( !m_Pcb )
return;
Module = (MODULE*) m_Pcb->m_Modules;
for( ; Module != NULL; Module = (MODULE*) Module->Pnext )
for( MODULE* module = m_Pcb->m_Modules; module; module = module->Next() )
{
bool display = true;
int MaskLay = ALL_CU_LAYERS;
int layerMask = ALL_CU_LAYERS;
if( Module->m_Flags & IS_MOVED )
if( module->m_Flags & IS_MOVED )
continue;
if( !DisplayOpt.Show_Modules_Cmp )
{
if( Module->GetLayer() == CMP_N )
if( module->GetLayer() == CMP_N )
display = FALSE;
MaskLay &= ~CMP_LAYER;
layerMask &= ~CMP_LAYER;
}
if( !DisplayOpt.Show_Modules_Cu )
{
if( Module->GetLayer() == COPPER_LAYER_N )
if( module->GetLayer() == COPPER_LAYER_N )
display = FALSE;
MaskLay &= ~CUIVRE_LAYER;
layerMask &= ~CUIVRE_LAYER;
}
if( display )
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), mode );
module->Draw( DrawPanel, DC, mode );
else
Trace_Pads_Only( DrawPanel, DC, Module, 0, 0, MaskLay, mode );
Trace_Pads_Only( DrawPanel, DC, module, 0, 0, layerMask, mode );
}
/* Draw the graphic items */
PtStruct = m_Pcb->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Pnext )
// Draw the graphic items
for( BOARD_ITEM* item = m_Pcb->m_Drawings; item; item = item->Next() )
{
if( PtStruct->m_Flags & IS_MOVED )
if( item->m_Flags & IS_MOVED )
continue;
switch( PtStruct->Type() )
switch( item->Type() )
{
case TYPECOTATION:
( (COTATION*) PtStruct )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), mode );
break;
case TYPETEXTE:
( (TEXTE_PCB*) PtStruct )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), mode );
break;
case TYPEMIRE:
( (MIREPCB*) PtStruct )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), mode );
item->Draw( DrawPanel, DC, mode );
break;
case TYPEDRAWSEGMENT:
Trace_DrawSegmentPcb( DrawPanel, DC, (DRAWSEGMENT*) PtStruct, mode );
Trace_DrawSegmentPcb( DrawPanel, DC, (DRAWSEGMENT*) item, mode );
break;
default:
......@@ -166,24 +161,24 @@ void WinEDA_PcbFrame::Trace_Pcb( wxDC* DC, int mode )
}
}
// draw the BOARD's markers.
for( unsigned i=0; i<m_Pcb->m_markers.size(); ++i )
{
m_Pcb->m_markers[i]->Draw( DrawPanel, DC, mode );
}
Trace_Pistes( DrawPanel, m_Pcb, DC, mode );
if( g_HightLigt_Status )
DrawHightLight( DC, g_HightLigth_NetCode );
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{
ZONE_CONTAINER* edge_zone = m_Pcb->GetArea(ii);
// Areas must be drawn here only if not moved or dragged,
// because these areas are drawn by ManageCursor() in a specific manner
if ( (edge_zone->m_Flags & (IN_EDIT | IS_DRAGGED | IS_MOVED)) == 0 )
edge_zone->Draw( DrawPanel, DC, wxPoint(0,0), mode);
edge_zone->Draw( DrawPanel, DC, mode );
}
// draw the BOARD's markers.
for( unsigned i=0; i<m_Pcb->m_markers.size(); ++i )
{
m_Pcb->m_markers[i]->Draw( DrawPanel, DC, mode );
}
DrawGeneralRatsnest( DC );
......
......@@ -65,7 +65,7 @@ void WinEDA_PcbFrame::UnDeleteItem( wxDC* DC )
g_UnDeleteStack[g_UnDeleteStackPtr] = NULL;
((MODULE*) item)->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
((MODULE*) item)->Draw( DrawPanel, DC, GR_OR );
item->SetState( DELETED, OFF ); /* Creal DELETED flag */
item->m_Flags = 0;
......
......@@ -492,12 +492,12 @@ MODULE* WinEDA_ExchangeModuleFrame::Change_1_Module( MODULE* PtModule,
m_WinMsg->WriteText( wxT( "Ok\n" ) );
/* Effacement a l'ecran de l'ancien module */
PtModule->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_XOR );
PtModule->Draw( m_Parent->DrawPanel, m_DC, GR_XOR );
m_Parent->Exchange_Module( this, PtModule, NewModule );
/* Affichage du nouveau module */
NewModule->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_OR );
NewModule->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
Maj_ListeCmp( NewModule->m_Reference->m_Text, oldnamecmp, namecmp, ShowError );
......
......@@ -312,7 +312,7 @@ void WinEDA_PcbFrame::End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER
DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL;
if( DC )
zone_container->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
zone_container->Draw( DrawPanel, DC, GR_OR );
GetScreen()->SetModify();
s_AddCutoutToCurrentZone = false;
s_CurrentZone = NULL;
......@@ -353,7 +353,7 @@ void WinEDA_PcbFrame::Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_contain
if( zone_container->m_Poly->GetNumCorners() <= 3 )
{
zone_container->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
zone_container->Draw( DrawPanel, DC, GR_XOR );
Delete_Zone_Fill( DC, NULL, zone_container->m_TimeStamp );
m_Pcb->Delete( zone_container );
return;
......@@ -392,7 +392,7 @@ void Abort_Zone_Move_Corner_Or_Outlines( WinEDA_DrawPanel* Panel, wxDC* DC )
WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) Panel->m_Parent;
ZONE_CONTAINER* zone_container = (ZONE_CONTAINER*) pcbframe->GetCurItem();
zone_container->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR );
zone_container->Draw( Panel, DC, GR_XOR );
if( zone_container->m_Flags == IS_MOVED )
{
......@@ -418,7 +418,7 @@ void Abort_Zone_Move_Corner_Or_Outlines( WinEDA_DrawPanel* Panel, wxDC* DC )
zone_container->m_Poly->MoveCorner( zone_container->m_CornerSelection, pos.x, pos.y );
}
}
zone_container->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR );
zone_container->Draw( Panel, DC, GR_XOR );
Panel->ManageCurseur = NULL;
Panel->ForceCloseManageCurseur = NULL;
......@@ -441,7 +441,7 @@ void Show_Zone_Corner_Or_Outline_While_Move_Mouse( WinEDA_DrawPanel* Panel, wxDC
if( erase ) /* Undraw edge in old position*/
{
zone->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR );
zone->Draw( Panel, DC, GR_XOR );
}
wxPoint pos = pcbframe->GetScreen()->m_Curseur;
......@@ -462,7 +462,7 @@ void Show_Zone_Corner_Or_Outline_While_Move_Mouse( WinEDA_DrawPanel* Panel, wxDC
else
zone->m_Poly->MoveCorner( zone->m_CornerSelection, pos.x, pos.y );
zone->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR );
zone->Draw( Panel, DC, GR_XOR );
}
......@@ -737,7 +737,7 @@ void WinEDA_PcbFrame::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{
ZONE_CONTAINER* edge_zone = m_Pcb->GetArea( ii );
edge_zone->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
edge_zone->Draw( DrawPanel, DC, GR_XOR );
}
zone_container->SetLayer( s_Zone_Layer );
......@@ -777,7 +777,7 @@ void WinEDA_PcbFrame::Delete_Zone_Contour( wxDC* DC, ZONE_CONTAINER* zone_contai
int ncont = zone_container->m_Poly->GetContour( zone_container->m_CornerSelection );
if( DC )
zone_container->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
zone_container->Draw( DrawPanel, DC, GR_XOR );
Delete_Zone_Fill( DC, NULL, zone_container->m_TimeStamp ); // Remove fill segments
......@@ -788,7 +788,7 @@ void WinEDA_PcbFrame::Delete_Zone_Contour( wxDC* DC, ZONE_CONTAINER* zone_contai
{
zone_container->m_Poly->RemoveContour( ncont );
if( DC )
zone_container->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
zone_container->Draw( DrawPanel, DC, GR_OR );
}
GetScreen()->SetModify();
}
......
......@@ -550,7 +550,6 @@ void WinEDA_DrawPanel::EraseScreen( wxDC* DC )
/***************************************************/
void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event )
/***************************************************/
#if 1 // new code without multiple calls to ReDraw()
{
wxPaintDC paintDC( this );
EDA_Rect tmp;
......@@ -622,72 +621,6 @@ void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event )
}
#else // old code
{
wxPaintDC paintDC( this );
EDA_Rect tmp;
wxRect PaintClipBox;
wxPoint org;
static int counter;
++counter;
PrepareGraphicContext( &paintDC );
tmp = m_ClipBox;
org = m_ClipBox.GetOrigin();
wxRegionIterator upd( GetUpdateRegion() ); // get the update rect list
while( upd )
{
PaintClipBox = upd.GetRect();
upd++;
PaintClipBox.x += org.x;
PaintClipBox.y += org.y;
#if 0
printf( "PaintClipBox[%d]=(%d, %d, %d, %d)\n",
counter,
PaintClipBox.x,
PaintClipBox.y,
PaintClipBox.width,
PaintClipBox.height );
#endif
#ifdef WX_ZOOM
m_ClipBox.m_Pos.x = PaintClipBox.x * GetZoom();
m_ClipBox.m_Pos.y = PaintClipBox.y * GetZoom();
m_ClipBox.m_Size.x = PaintClipBox.m_Size.x * GetZoom();
m_ClipBox.m_Size.y = PaintClipBox.m_Size.y * GetZoom();
PaintClipBox = m_ClipBox;
#else
m_ClipBox.SetX( PaintClipBox.GetX() );
m_ClipBox.SetY( PaintClipBox.GetY() );
m_ClipBox.SetWidth( PaintClipBox.GetWidth() );
m_ClipBox.SetHeight( PaintClipBox.GetHeight() );
#endif
wxDCClipper* dcclip = new wxDCClipper( paintDC, PaintClipBox );
ReDraw( &paintDC, TRUE );
delete dcclip;
}
m_ClipBox = tmp;
event.Skip();
}
#endif
/****************************************************/
void WinEDA_DrawPanel::ReDraw( wxDC* DC, bool erasebg )
/****************************************************/
......
......@@ -74,3 +74,12 @@ edges editable.
2) final solution: get rid of requirement for tracks buried within a zone.
Reivew the GEDA source code and other sources to gather ideas before doing 2).
2008-Mar-31 Assigned To:
asked by: Dick Hollenbeck
================================================================================
EESCHEMA:
Derive all eeschema classes from SCH_ITEM, not EDA_BaseStruct.
Move the virtual EDA_BaseStruct::Draw() function into SCH_ITEM, so that
there is no EDA_BaseStruct::Draw() function.
Make the KICAD_T spelling mimic the class names.
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