Commit 62a28440 authored by CHARRAS's avatar CHARRAS

wxstruct modified and wxPcbStuct.h added. some minor other changes

parent 0aaf01e9
/* XPM */
#ifndef XPMMAIN
extern const char *Add_Corner_xpm[];
#else
const char * Add_Corner_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 7 1",
" c None",
"X c #808080",
". c #008000",
"+ c #FFFF00",
"@ c #800000",
"o c #C0C0C0",
"O c #808000",
/* pixels */
" .XX ",
" .XX ",
" XooO ",
" ooX ",
"..X ooooX ..... ",
"X.XoooooX XXXXXX",
"XX ooo++O XXXXXX",
" X OOO@ X ",
" X X ",
" X.XX ",
" .XX ",
" .XX ",
" .XX ",
" .XX ",
" .XX ",
" XX "
};
#endif
/* XPM */ /* XPM */
static const char * add_zone_xpm[] = { #ifndef XPMMAIN
extern const char *add_zone_xpm[];
#else
const char * add_zone_xpm[] = {
"16 16 3 1", "16 16 3 1",
" c None", " c None",
". c #007D00", ". c #007D00",
...@@ -20,3 +24,4 @@ static const char * add_zone_xpm[] = { ...@@ -20,3 +24,4 @@ static const char * add_zone_xpm[] = {
".............. .", ".............. .",
"............... ", "............... ",
"............... "}; "............... "};
#endif
/* XPM */
#ifndef XPMMAIN
extern const char *add_zone_cutout[];
#else
const char * add_zone_cutout[] = {
"16 16 3 1",
" c None",
". c #007D00",
"+ c #900000",
" ..............",
".... ........",
"... ++++ .......",
".. + + .....",
". + + ...",
". + + ..",
". + + ..",
". + + .",
".. + + ..",
"... +++++++ ... ",
".... .... ",
"............ ",
"............. ",
".............. ",
" ............. ",
" ............ "};
#endif
...@@ -4,6 +4,13 @@ Started 2007-June-11 ...@@ -4,6 +4,13 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2008-jan-01 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+all
wxstruct modified and wxPcbStuct.h added:
classes relatives to pcbnew, cvpcb and gerbview are moved in wxPcbStuct.h
2007-Dec-29 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> 2007-Dec-29 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================ ================================================================================
+pcbnew: +pcbnew:
......
...@@ -73,9 +73,9 @@ wxString title; ...@@ -73,9 +73,9 @@ wxString title;
m_Parent = parent; m_Parent = parent;
m_DoUpdate = TRUE; m_DoUpdate = TRUE;
Create(parent, id, caption, pos, size, style);
title = _("from ") + g_EDA_Appl->m_CurrentOptionFile; title = _("from ") + g_EDA_Appl->m_CurrentOptionFile;
SetTitle(title); SetTitle(title);
Create(parent, id, caption, pos, size, style);
} }
/*! /*!
......
...@@ -34,6 +34,9 @@ ...@@ -34,6 +34,9 @@
#include "../bitmaps/plot_PS.xpm" #include "../bitmaps/plot_PS.xpm"
#include "../bitmaps/plot_HPG.xpm" #include "../bitmaps/plot_HPG.xpm"
#include "../bitmaps/Add_Zone.xpm"
#include "../bitmaps/Add_Zone_Cutout.xpm"
#include "../bitmaps/Add_Corner.xpm"
#include "../bitmaps/Add_Circle.xpm" #include "../bitmaps/Add_Circle.xpm"
#include "../bitmaps/Add_Line.xpm" #include "../bitmaps/Add_Line.xpm"
#include "../bitmaps/Add_Arc.xpm" #include "../bitmaps/Add_Arc.xpm"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
COMMON_GLOBL wxString g_BuildVersion COMMON_GLOBL wxString g_BuildVersion
#ifdef EDA_BASE #ifdef EDA_BASE
(wxT("(2007-12-22)")) (wxT("(2008-01-01)"))
#endif #endif
; ;
......
...@@ -558,6 +558,9 @@ enum main_id { ...@@ -558,6 +558,9 @@ enum main_id {
ID_POPUP_PCB_FILL_ZONE, ID_POPUP_PCB_FILL_ZONE,
ID_POPUP_PCB_DELETE_ZONE_CONTAINER, ID_POPUP_PCB_DELETE_ZONE_CONTAINER,
ID_POPUP_PCB_PLACE_ZONE_CORNER, ID_POPUP_PCB_PLACE_ZONE_CORNER,
ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE,
ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE,
ID_POPUP_ZONE_UNUSED1,
ID_POPUP_ZONE_UNUSED2, ID_POPUP_ZONE_UNUSED2,
ID_POPUP_ZONE_UNUSED3, ID_POPUP_ZONE_UNUSED3,
ID_POPUP_ZONE_UNUSED4, ID_POPUP_ZONE_UNUSED4,
......
...@@ -129,16 +129,16 @@ enum Track_Shapes { ...@@ -129,16 +129,16 @@ enum Track_Shapes {
S_POLYGON /* polygon shape */ S_POLYGON /* polygon shape */
}; };
/* Forward declaration */ /* Forward declaration */
class MODULE;
class EQUIPOT; class EQUIPOT;
class MARKER; class MARKER;
class TRACK;
class D_PAD;
struct CHEVELU; struct CHEVELU;
class Ki_PageDescr; //class Ki_PageDescr;
class DrawBlockStruct; //class DrawBlockStruct;
/* main window classes : */
#include "wxPcbStruct.h"
/* Class to handle a board */ /* Class to handle a board */
#include "class_board.h" #include "class_board.h"
......
This diff is collapsed.
This diff is collapsed.
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "bitmaps.h" #include "bitmaps.h"
#include "add_cotation.xpm" #include "add_cotation.xpm"
#include "Add_Mires.xpm" #include "Add_Mires.xpm"
#include "Add_Zone.xpm"
/********************************************************/ /********************************************************/
......
...@@ -449,6 +449,14 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -449,6 +449,14 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
Edit_Zone_Params( &dc, (ZONE_CONTAINER*) GetCurItem() ); Edit_Zone_Params( &dc, (ZONE_CONTAINER*) GetCurItem() );
break; break;
case ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE:
wxMessageBox(wxT("ToDo"));
break;
case ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE:
wxMessageBox(wxT("ToDo"));
break;
case ID_POPUP_PCB_DELETE_ZONE_CONTAINER: case ID_POPUP_PCB_DELETE_ZONE_CONTAINER:
{ {
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include "Delete_Track.xpm" #include "Delete_Track.xpm"
#include "Move_Module.xpm" #include "Move_Module.xpm"
//#include "Move_Track_Segment.xpm"
#include "Drag_Track_Segment.xpm" #include "Drag_Track_Segment.xpm"
#include "Drag_Segment_WithSlope.xpm" #include "Drag_Segment_WithSlope.xpm"
#include "Drag_Module.xpm" #include "Drag_Module.xpm"
...@@ -173,12 +172,12 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -173,12 +172,12 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
// printf( "cursor=(%d, %d) select=(%d,%d)\n", cursorPos.x, cursorPos.y, selectPos.x, selectPos.y ); // printf( "cursor=(%d, %d) select=(%d,%d)\n", cursorPos.x, cursorPos.y, selectPos.x, selectPos.y );
/* We can reselect another item only if there are no item being edited /* We can reselect another item only if there are no item being edited
because ALL moving functions use GetCurItem(), therefore GetCurItem() * because ALL moving functions use GetCurItem(), therefore GetCurItem()
must return the same item during moving. We know an item is moving * must return the same item during moving. We know an item is moving
if( item && (item->m_Flags != 0)) is true and after calling * if( item && (item->m_Flags != 0)) is true and after calling
PcbGeneralLocateAndDisplay(), GetCurItem() is any arbitrary BOARD_ITEM, * PcbGeneralLocateAndDisplay(), GetCurItem() is any arbitrary BOARD_ITEM,
not the current item being edited. In such case we cannot call * not the current item being edited. In such case we cannot call
PcbGeneralLocateAndDisplay(). * PcbGeneralLocateAndDisplay().
*/ */
if( !item || (item->m_Flags == 0) ) if( !item || (item->m_Flags == 0) )
{ {
...@@ -265,7 +264,12 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -265,7 +264,12 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
aPopMenu->Append( ID_POPUP_PCB_DELETE_DRAWING, _( "Delete Drawing" ) ); aPopMenu->Append( ID_POPUP_PCB_DELETE_DRAWING, _( "Delete Drawing" ) );
break; break;
case TYPEEDGEZONE: case TYPEZONE: // Item used to fill a zone
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_ZONE,
_( "Delete Zone" ), delete_xpm );
break;
case TYPEEDGEZONE: // Graphic Item used to create a new zone outline
if( flags & IS_NEW ) if( flags & IS_NEW )
{ {
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE, ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE,
...@@ -275,42 +279,8 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -275,42 +279,8 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
_( "Delete edge zone" ), delete_xpm ); _( "Delete edge zone" ), delete_xpm );
break; break;
case TYPEZONE_CONTAINER: case TYPEZONE_CONTAINER: // Item used to handle a zone area (outlines, holes ...)
{ createPopUpMenuForZones( (ZONE_CONTAINER*) item, aPopMenu );
ZONE_CONTAINER * edge_zone = (ZONE_CONTAINER *) item;
if ( edge_zone->m_Flags )
{
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_CORNER,
_( "Place Corner" ), apply_xpm );
}
else
{
edge_zone->m_CornerSelection = -1;
int index;
if ( (index = edge_zone->HitTestForCorner( GetScreen()->m_Curseur )) >= 0 )
{
edge_zone->m_CornerSelection = index;
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_MOVE_ZONE_CORNER,
_( "Move Corner" ), move_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_ZONE_CORNER,
_( "Delete Corner" ), delete_xpm );
}
else if ( (index = edge_zone->HitTestForEdge( GetScreen()->m_Curseur )) >= 0 )
{
edge_zone->m_CornerSelection = index;
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_ADD_ZONE_CORNER,
_( "Create Corner" ), move_xpm );
}
aPopMenu->AppendSeparator();
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_FILL_ZONE,
_( "Fill zone" ), fill_zone_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_ZONE_PARAMS,
_( "Edit Zone Params" ), edit_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_ZONE_CONTAINER,
_( "Delete Zone Outline" ), delete_xpm );
}
}
break; break;
case TYPETEXTE: case TYPETEXTE:
...@@ -323,11 +293,6 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -323,11 +293,6 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
createPopupMenuForTracks( (TRACK*) item, aPopMenu ); createPopupMenuForTracks( (TRACK*) item, aPopMenu );
break; break;
case TYPEZONE:
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_ZONE,
_( "Delete Zone" ), delete_xpm );
break;
case TYPEMARKER: case TYPEMARKER:
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_MARKER, ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_MARKER,
_( "Delete Marker" ), delete_xpm ); _( "Delete Marker" ), delete_xpm );
...@@ -390,7 +355,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -390,7 +355,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{ {
case ID_PCB_ZONES_BUTT: case ID_PCB_ZONES_BUTT:
{ {
if ( m_Pcb->m_ZoneDescriptorList.size() > 0 ) if( m_Pcb->m_ZoneDescriptorList.size() > 0 )
{ {
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_FILL_ALL_ZONES, ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_FILL_ALL_ZONES,
_( "Fill or Refill All Zones" ), fill_zone_xpm ); _( "Fill or Refill All Zones" ), fill_zone_xpm );
...@@ -601,7 +566,8 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) ...@@ -601,7 +566,8 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
ADD_MENUITEM_WITH_SUBMENU( PopMenu, track_mnu, ADD_MENUITEM_WITH_SUBMENU( PopMenu, track_mnu,
ID_POPUP_PCB_EDIT_TRACK_MNU, _( "Change Width" ), width_track_xpm ); ID_POPUP_PCB_EDIT_TRACK_MNU, _( "Change Width" ), width_track_xpm );
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_EDIT_TRACKSEG, ADD_MENUITEM( track_mnu, ID_POPUP_PCB_EDIT_TRACKSEG,
Track->Type()==TYPEVIA ? _( "Edit Via" ) : _( "Edit Segment" ), width_segment_xpm ); Track->Type()==TYPEVIA ? _( "Edit Via" ) : _(
"Edit Segment" ), width_segment_xpm );
if( !flags ) if( !flags )
{ {
...@@ -622,7 +588,7 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) ...@@ -622,7 +588,7 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
ADD_MENUITEM_WITH_SUBMENU( PopMenu, track_mnu, ADD_MENUITEM_WITH_SUBMENU( PopMenu, track_mnu,
ID_POPUP_PCB_DELETE_TRACK_MNU, _( "Delete" ), delete_xpm ); ID_POPUP_PCB_DELETE_TRACK_MNU, _( "Delete" ), delete_xpm );
msg = AddHotkeyName( Track->Type()==TYPEVIA ? _("Delete Via") : _( "Delete Segment" ), msg = AddHotkeyName( Track->Type()==TYPEVIA ? _( "Delete Via" ) : _( "Delete Segment" ),
s_Board_Editor_Hokeys_Descr, HK_BACK_SPACE ); s_Board_Editor_Hokeys_Descr, HK_BACK_SPACE );
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_DELETE_TRACKSEG, ADD_MENUITEM( track_mnu, ID_POPUP_PCB_DELETE_TRACKSEG,
...@@ -659,6 +625,56 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) ...@@ -659,6 +625,56 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
} }
/********************************************************************************************/
void WinEDA_PcbFrame::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu )
/********************************************************************************************/
/* Create the wxMenuitem list for zone outlines editing and zone filling
*/
{
if( edge_zone->m_Flags )
{
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_CORNER,
_( "Place Corner" ), apply_xpm );
}
else
{
edge_zone->m_CornerSelection = -1;
int index;
if( ( index = edge_zone->HitTestForCorner( GetScreen()->m_Curseur ) ) >= 0 )
{
edge_zone->m_CornerSelection = index;
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_MOVE_ZONE_CORNER,
_( "Move Corner" ), move_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_ZONE_CORNER,
_( "Delete Corner" ), delete_xpm );
}
else if( ( index = edge_zone->HitTestForEdge( GetScreen()->m_Curseur ) ) >= 0 )
{
edge_zone->m_CornerSelection = index;
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_ADD_ZONE_CORNER,
_( "Create Corner" ), Add_Corner_xpm );
}
aPopMenu->AppendSeparator();
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE,
_( "Add Similar Zone" ), fill_zone_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE,
_( "Add Cutout Zone" ), add_zone_cutout );
aPopMenu->AppendSeparator();
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_FILL_ZONE,
_( "Fill Zone" ), fill_zone_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_ZONE_PARAMS,
_( "Edit Zone Params" ), edit_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_ZONE_CONTAINER,
_( "Delete Zone Outline" ), delete_xpm );
}
}
/*********************************************************************************/ /*********************************************************************************/
void WinEDA_PcbFrame::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* menu ) void WinEDA_PcbFrame::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* menu )
/*********************************************************************************/ /*********************************************************************************/
...@@ -744,9 +760,9 @@ void WinEDA_PcbFrame::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* m ...@@ -744,9 +760,9 @@ void WinEDA_PcbFrame::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* m
} }
/***************************************************************/ /************************************************************************/
void WinEDA_PcbFrame::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu ) void WinEDA_PcbFrame::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu )
/***************************************************************/ /************************************************************************/
/* Create pop menu for pads */ /* Create pop menu for pads */
{ {
wxMenu* sub_menu_Pad; wxMenu* sub_menu_Pad;
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "mw_Add_Gap.xpm" #include "mw_Add_Gap.xpm"
#include "mw_toolbar.xpm" #include "mw_toolbar.xpm"
#include "Add_Tracks.xpm" #include "Add_Tracks.xpm"
#include "Add_Zone.xpm"
#include "Show_Zone.xpm" #include "Show_Zone.xpm"
#include "net_hightlight.xpm" #include "net_hightlight.xpm"
#include "PcbOffset.xpm" #include "PcbOffset.xpm"
......
...@@ -29,7 +29,7 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose ) ...@@ -29,7 +29,7 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
* The zone outline is a frontier, and can be complex (with holes) * The zone outline is a frontier, and can be complex (with holes)
* The filling starts from starting points like pads, tracks. * The filling starts from starting points like pads, tracks.
* @param frame = reference to the main frame * @param frame = reference to the main frame
* @param DC = current Device Context * @param DC = current Device Context (can be NULL)
* @param verbose = true to show error messages * @param verbose = true to show error messages
* @return error level (0 = no error) * @return error level (0 = no error)
*/ */
...@@ -40,12 +40,10 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose ) ...@@ -40,12 +40,10 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
int save_isol = g_DesignSettings.m_TrackClearence; int save_isol = g_DesignSettings.m_TrackClearence;
wxPoint ZoneStartFill; wxPoint ZoneStartFill;
wxString msg; wxString msg;
PCB_SCREEN* Screen = frame->GetScreen();
BOARD* Pcb = frame->m_Pcb; BOARD* Pcb = frame->m_Pcb;
g_DesignSettings.m_TrackClearence = g_DesignSettings.m_ZoneClearence; g_DesignSettings.m_TrackClearence = g_DesignSettings.m_ZoneClearence;
g_HightLigth_NetCode = m_NetCode; g_HightLigth_NetCode = m_NetCode;
// Screen->m_Active_Layer = m_Layer;
s_TimeStamp = m_TimeStamp; s_TimeStamp = m_TimeStamp;
...@@ -234,7 +232,7 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose ) ...@@ -234,7 +232,7 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
} }
} }
if( Zone_Debug ) if( Zone_Debug && DC )
DisplayBoard( frame->DrawPanel, DC ); DisplayBoard( frame->DrawPanel, DC );
/* Filling the cells of the matrix (this is the zone building)*/ /* Filling the cells of the matrix (this is the zone building)*/
...@@ -250,7 +248,7 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose ) ...@@ -250,7 +248,7 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
if( m_PadOption == THERMAL_PAD ) if( m_PadOption == THERMAL_PAD )
PlaceCells( Pcb, g_HightLigth_NetCode, FORCE_PADS ); PlaceCells( Pcb, g_HightLigth_NetCode, FORCE_PADS );
if( Zone_Debug ) if( Zone_Debug && DC )
DisplayBoard( frame->DrawPanel, DC ); DisplayBoard( frame->DrawPanel, DC );
/* Convert the matrix information (cells) to segments which are actually the zone */ /* Convert the matrix information (cells) to segments which are actually the zone */
...@@ -291,7 +289,7 @@ static void Genere_Segments_Zone( WinEDA_PcbFrame* frame, wxDC* DC, int net_code ...@@ -291,7 +289,7 @@ static void Genere_Segments_Zone( WinEDA_PcbFrame* frame, wxDC* DC, int net_code
* 1 - From left to right and create horizontal zone segments * 1 - From left to right and create horizontal zone segments
* 2 - From top to bottom, and create vertical zone segments * 2 - From top to bottom, and create vertical zone segments
* @param net_code = net_code common to all segment zone created * @param net_code = net_code common to all segment zone created
* @param DC = current device context * @param DC = current device context ( can be NULL )
* @param frame = current WinEDA_PcbFrame * @param frame = current WinEDA_PcbFrame
* global: parameter TimeStamp: time stamp common to all segment zone created * global: parameter TimeStamp: time stamp common to all segment zone created
*/ */
...@@ -341,6 +339,7 @@ static void Genere_Segments_Zone( WinEDA_PcbFrame* frame, wxDC* DC, int net_code ...@@ -341,6 +339,7 @@ static void Genere_Segments_Zone( WinEDA_PcbFrame* frame, wxDC* DC, int net_code
pt_track->m_TimeStamp = s_TimeStamp; pt_track->m_TimeStamp = s_TimeStamp;
pt_track->Insert( frame->m_Pcb, NULL ); pt_track->Insert( frame->m_Pcb, NULL );
if ( DC )
pt_track->Draw( frame->DrawPanel, DC, GR_OR ); pt_track->Draw( frame->DrawPanel, DC, GR_OR );
nbsegm++; nbsegm++;
} }
...@@ -385,6 +384,7 @@ static void Genere_Segments_Zone( WinEDA_PcbFrame* frame, wxDC* DC, int net_code ...@@ -385,6 +384,7 @@ static void Genere_Segments_Zone( WinEDA_PcbFrame* frame, wxDC* DC, int net_code
pt_track->m_TimeStamp = s_TimeStamp; pt_track->m_TimeStamp = s_TimeStamp;
pt_track->Insert( frame->m_Pcb, NULL ); pt_track->Insert( frame->m_Pcb, NULL );
if( DC )
pt_track->Draw( frame->DrawPanel, DC, GR_OR ); pt_track->Draw( frame->DrawPanel, DC, GR_OR );
nbsegm++; nbsegm++;
} }
...@@ -654,6 +654,7 @@ bool WinEDA_PcbFrame::Genere_Pad_Connexion( wxDC* DC, int layer ) ...@@ -654,6 +654,7 @@ bool WinEDA_PcbFrame::Genere_Pad_Connexion( wxDC* DC, int layer )
} }
pt_track->Insert( m_Pcb, NULL ); pt_track->Insert( m_Pcb, NULL );
if( DC )
pt_track->Draw( DrawPanel, DC, GR_OR ); pt_track->Draw( DrawPanel, DC, GR_OR );
} }
} }
......
...@@ -77,7 +77,7 @@ void WinEDA_PcbFrame::Delete_Zone( wxDC* DC, SEGZONE* aZone, long aTimestamp ) ...@@ -77,7 +77,7 @@ void WinEDA_PcbFrame::Delete_Zone( wxDC* DC, SEGZONE* aZone, long aTimestamp )
*/ */
{ {
int nb_segm = 0; int nb_segm = 0;
bool modify = FALSE; bool modify = false;
unsigned long TimeStamp; unsigned long TimeStamp;
if( aZone == NULL ) if( aZone == NULL )
...@@ -113,7 +113,7 @@ void WinEDA_PcbFrame::Delete_Zone( wxDC* DC, SEGZONE* aZone, long aTimestamp ) ...@@ -113,7 +113,7 @@ void WinEDA_PcbFrame::Delete_Zone( wxDC* DC, SEGZONE* aZone, long aTimestamp )
EDGE_ZONE* WinEDA_PcbFrame::Del_SegmEdgeZone( wxDC* DC, EDGE_ZONE* edge_zone ) EDGE_ZONE* WinEDA_PcbFrame::Del_SegmEdgeZone( wxDC* DC, EDGE_ZONE* edge_zone )
/*****************************************************************************/ /*****************************************************************************/
/* Used only while creating a new zonz outline /* Used only while creating a new zone outline
* Remove and delete the current outline segment in progress * Remove and delete the current outline segment in progress
*/ */
{ {
...@@ -441,7 +441,7 @@ void WinEDA_PcbFrame::End_Zone( wxDC* DC ) ...@@ -441,7 +441,7 @@ void WinEDA_PcbFrame::End_Zone( wxDC* DC )
if( net ) if( net )
polygon->m_Netname = net->m_Netname; polygon->m_Netname = net->m_Netname;
edge = m_Pcb->m_CurrentLimitZone; edge = m_Pcb->m_CurrentLimitZone;
polygon->Start( GetScreen()->m_Active_Layer, 0, NULL, polygon->Start( GetScreen()->m_Active_Layer, 0, 0,
edge->m_Start.x, edge->m_Start.y, edge->m_Start.x, edge->m_Start.y,
s_Zone_Hatching ); s_Zone_Hatching );
edge = edge->Next(); edge = edge->Next();
...@@ -585,13 +585,13 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v ...@@ -585,13 +585,13 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v
/* Show the Net */ /* Show the Net */
s_NetcodeSelection = zone_container->GetNet(); s_NetcodeSelection = zone_container->GetNet();
if( (g_HightLigth_NetCode > 0) && (g_HightLigth_NetCode != s_NetcodeSelection) ) if( (g_HightLigth_NetCode > 0) && (g_HightLigth_NetCode != s_NetcodeSelection) && DC )
{ {
Hight_Light( DC ); // Remove old hightlight selection Hight_Light( DC ); // Remove old hightlight selection
} }
g_HightLigth_NetCode = s_NetcodeSelection; g_HightLigth_NetCode = s_NetcodeSelection;
if( !g_HightLigt_Status ) if( !g_HightLigt_Status && DC)
Hight_Light( DC ); Hight_Light( DC );
if( g_HightLigth_NetCode > 0 ) if( g_HightLigth_NetCode > 0 )
...@@ -613,7 +613,7 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v ...@@ -613,7 +613,7 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v
msg = _( "No Net" ); msg = _( "No Net" );
Affiche_1_Parametre( this, 22, _( "NetName" ), msg, RED ); Affiche_1_Parametre( this, 22, _( "NetName" ), msg, RED );
wxBusyCursor dummy; // Shows an hourglass cursor (removed by its destructor)
zone_container->m_PadOption = s_Zone_Pad_Options; zone_container->m_PadOption = s_Zone_Pad_Options;
zone_container->m_ZoneClearance = g_DesignSettings.m_ZoneClearence; zone_container->m_ZoneClearance = g_DesignSettings.m_ZoneClearence;
zone_container->m_GridFillValue = g_GridRoutingSize; zone_container->m_GridFillValue = g_GridRoutingSize;
...@@ -641,13 +641,22 @@ int WinEDA_PcbFrame::Fill_All_Zones( wxDC* DC, bool verbose ) ...@@ -641,13 +641,22 @@ int WinEDA_PcbFrame::Fill_All_Zones( wxDC* DC, bool verbose )
ZONE_CONTAINER* zone_container; ZONE_CONTAINER* zone_container;
int error_level = 0; int error_level = 0;
// Remove all zones :
if ( m_Pcb->m_Zone )
{
m_Pcb->m_Zone->DeleteStructList();
m_Pcb->m_Zone = NULL;
m_Pcb->m_NbSegmZone = 0;
}
for( unsigned ii = 0; ii < m_Pcb->m_ZoneDescriptorList.size(); ii++ ) for( unsigned ii = 0; ii < m_Pcb->m_ZoneDescriptorList.size(); ii++ )
{ {
zone_container = m_Pcb->m_ZoneDescriptorList[ii]; zone_container = m_Pcb->m_ZoneDescriptorList[ii];
error_level = Fill_Zone( DC, zone_container, verbose ); error_level = Fill_Zone( NULL, zone_container, verbose );
if( error_level && ! verbose ) if( error_level && ! verbose )
break; break;
} }
DrawPanel->Refresh(true);
return error_level; return error_level;
} }
...@@ -38,6 +38,7 @@ CPolyLine::CPolyLine() ...@@ -38,6 +38,7 @@ CPolyLine::CPolyLine()
m_dlist = NULL; m_dlist = NULL;
m_HatchStyle = 0; m_HatchStyle = 0;
m_sel_box = 0; m_sel_box = 0;
utility = 0;
m_gpc_poly = new gpc_polygon; m_gpc_poly = new gpc_polygon;
m_gpc_poly->num_contours = 0; m_gpc_poly->num_contours = 0;
m_php_poly = new polygon; m_php_poly = new polygon;
......
...@@ -158,14 +158,15 @@ private: ...@@ -158,14 +158,15 @@ private:
int m_layer; // layer to draw on int m_layer; // layer to draw on
int m_Width; // line width int m_Width; // line width
int m_sel_box; // corner selection box width/2 int m_sel_box; // corner selection box width/2
public: int utility;
protected:
std::vector <CPolyPt> corner; // array of points for corners std::vector <CPolyPt> corner; // array of points for corners
std::vector <int> side_style; // array of styles for sides std::vector <int> side_style; // array of styles for sides
private: private:
std::vector <dl_element*> dl_side; // graphic elements std::vector <dl_element*> dl_side; // graphic elements
std::vector <dl_element*> dl_side_sel; std::vector <dl_element*> dl_side_sel;
std::vector <dl_element*> dl_corner_sel; std::vector <dl_element*> dl_corner_sel;
public: protected:
int m_HatchStyle; // hatch style, see enum above int m_HatchStyle; // hatch style, see enum above
std::vector <CSegment> m_HatchLines; // hatch lines std::vector <CSegment> m_HatchLines; // hatch lines
private: private:
......
...@@ -16,23 +16,23 @@ extern wxString g_Main_Title; ...@@ -16,23 +16,23 @@ extern wxString g_Main_Title;
// Local // Local
#ifdef GERBVIEW #ifdef GERBVIEW
static wxString MsgInfos(wxT("** GERBVIEW (jul 2001 .. 2007) **")); static wxString MsgInfos(wxT("** GERBVIEW (jul 2001 .. 2008) **"));
#else #else
#ifdef PCBNEW #ifdef PCBNEW
static wxString MsgInfos(wxT("** PCBNEW (sept 1992 .. 2007) **")); static wxString MsgInfos(wxT("** PCBNEW (sept 1992 .. 2008) **"));
#endif #endif
#endif #endif
#ifdef CVPCB #ifdef CVPCB
static wxString MsgInfos(wxT("** CVPCB (sept 1992 .. 2007) **")); static wxString MsgInfos(wxT("** CVPCB (sept 1992 .. 2008) **"));
#endif #endif
#ifdef KICAD #ifdef KICAD
static wxString MsgInfos(wxT("** KICAD (jul 2000 .. 2007) **")); static wxString MsgInfos(wxT("** KICAD (jul 2000 .. 2008) **"));
#endif #endif
#ifdef EESCHEMA #ifdef EESCHEMA
static wxString MsgInfos(wxT("** EESCHEMA (sept 1994 .. 2007) **")); static wxString MsgInfos(wxT("** EESCHEMA (sept 1994 .. 2008) **"));
#endif #endif
// Routines Locales // Routines Locales
......
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