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 */
static const char * add_zone_xpm[] = {
#ifndef XPMMAIN
extern const char *add_zone_xpm[];
#else
const char * add_zone_xpm[] = {
"16 16 3 1",
" c None",
". c #007D00",
......@@ -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
Please add newer entries at the top, list the date and your name with
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>
================================================================================
+pcbnew:
......
......@@ -73,9 +73,9 @@ wxString title;
m_Parent = parent;
m_DoUpdate = TRUE;
Create(parent, id, caption, pos, size, style);
title = _("from ") + g_EDA_Appl->m_CurrentOptionFile;
SetTitle(title);
Create(parent, id, caption, pos, size, style);
}
/*!
......
......@@ -34,6 +34,9 @@
#include "../bitmaps/plot_PS.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_Line.xpm"
#include "../bitmaps/Add_Arc.xpm"
......
......@@ -5,7 +5,7 @@
COMMON_GLOBL wxString g_BuildVersion
#ifdef EDA_BASE
(wxT("(2007-12-22)"))
(wxT("(2008-01-01)"))
#endif
;
......
......@@ -558,6 +558,9 @@ enum main_id {
ID_POPUP_PCB_FILL_ZONE,
ID_POPUP_PCB_DELETE_ZONE_CONTAINER,
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_UNUSED3,
ID_POPUP_ZONE_UNUSED4,
......
......@@ -129,16 +129,16 @@ enum Track_Shapes {
S_POLYGON /* polygon shape */
};
/* Forward declaration */
class MODULE;
class EQUIPOT;
class MARKER;
class TRACK;
class D_PAD;
struct CHEVELU;
class Ki_PageDescr;
class DrawBlockStruct;
//class Ki_PageDescr;
//class DrawBlockStruct;
/* main window classes : */
#include "wxPcbStruct.h"
/* Class to handle a board */
#include "class_board.h"
......
This diff is collapsed.
This diff is collapsed.
......@@ -14,7 +14,6 @@
#include "bitmaps.h"
#include "add_cotation.xpm"
#include "Add_Mires.xpm"
#include "Add_Zone.xpm"
/********************************************************/
......
......@@ -449,6 +449,14 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
Edit_Zone_Params( &dc, (ZONE_CONTAINER*) GetCurItem() );
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:
{
DrawPanel->MouseToCursorSchema();
......
......@@ -27,7 +27,6 @@
#include "Delete_Track.xpm"
#include "Move_Module.xpm"
//#include "Move_Track_Segment.xpm"
#include "Drag_Track_Segment.xpm"
#include "Drag_Segment_WithSlope.xpm"
#include "Drag_Module.xpm"
......@@ -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 );
/* We can reselect another item only if there are no item being edited
because ALL moving functions use GetCurItem(), therefore GetCurItem()
must return the same item during moving. We know an item is moving
if( item && (item->m_Flags != 0)) is true and after calling
PcbGeneralLocateAndDisplay(), GetCurItem() is any arbitrary BOARD_ITEM,
not the current item being edited. In such case we cannot call
PcbGeneralLocateAndDisplay().
* because ALL moving functions use GetCurItem(), therefore GetCurItem()
* must return the same item during moving. We know an item is moving
* if( item && (item->m_Flags != 0)) is true and after calling
* PcbGeneralLocateAndDisplay(), GetCurItem() is any arbitrary BOARD_ITEM,
* not the current item being edited. In such case we cannot call
* PcbGeneralLocateAndDisplay().
*/
if( !item || (item->m_Flags == 0) )
{
......@@ -265,7 +264,12 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
aPopMenu->Append( ID_POPUP_PCB_DELETE_DRAWING, _( "Delete Drawing" ) );
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 )
{
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE,
......@@ -275,42 +279,8 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
_( "Delete edge zone" ), delete_xpm );
break;
case TYPEZONE_CONTAINER:
{
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 );
}
}
case TYPEZONE_CONTAINER: // Item used to handle a zone area (outlines, holes ...)
createPopUpMenuForZones( (ZONE_CONTAINER*) item, aPopMenu );
break;
case TYPETEXTE:
......@@ -323,11 +293,6 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
createPopupMenuForTracks( (TRACK*) item, aPopMenu );
break;
case TYPEZONE:
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_ZONE,
_( "Delete Zone" ), delete_xpm );
break;
case TYPEMARKER:
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_MARKER,
_( "Delete Marker" ), delete_xpm );
......@@ -390,7 +355,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{
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,
_( "Fill or Refill All Zones" ), fill_zone_xpm );
......@@ -601,7 +566,8 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
ADD_MENUITEM_WITH_SUBMENU( PopMenu, track_mnu,
ID_POPUP_PCB_EDIT_TRACK_MNU, _( "Change Width" ), width_track_xpm );
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 )
{
......@@ -622,7 +588,7 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
ADD_MENUITEM_WITH_SUBMENU( PopMenu, track_mnu,
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 );
ADD_MENUITEM( track_mnu, ID_POPUP_PCB_DELETE_TRACKSEG,
......@@ -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 )
/*********************************************************************************/
......@@ -744,9 +760,9 @@ void WinEDA_PcbFrame::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* m
}
/***************************************************************/
/************************************************************************/
void WinEDA_PcbFrame::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu )
/***************************************************************/
/************************************************************************/
/* Create pop menu for pads */
{
wxMenu* sub_menu_Pad;
......
......@@ -36,7 +36,6 @@
#include "mw_Add_Gap.xpm"
#include "mw_toolbar.xpm"
#include "Add_Tracks.xpm"
#include "Add_Zone.xpm"
#include "Show_Zone.xpm"
#include "net_hightlight.xpm"
#include "PcbOffset.xpm"
......
......@@ -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 filling starts from starting points like pads, tracks.
* @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
* @return error level (0 = no error)
*/
......@@ -40,12 +40,10 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
int save_isol = g_DesignSettings.m_TrackClearence;
wxPoint ZoneStartFill;
wxString msg;
PCB_SCREEN* Screen = frame->GetScreen();
BOARD* Pcb = frame->m_Pcb;
g_DesignSettings.m_TrackClearence = g_DesignSettings.m_ZoneClearence;
g_HightLigth_NetCode = m_NetCode;
// Screen->m_Active_Layer = m_Layer;
s_TimeStamp = m_TimeStamp;
......@@ -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 );
/* 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 )
if( m_PadOption == THERMAL_PAD )
PlaceCells( Pcb, g_HightLigth_NetCode, FORCE_PADS );
if( Zone_Debug )
if( Zone_Debug && DC )
DisplayBoard( frame->DrawPanel, DC );
/* 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
* 1 - From left to right and create horizontal zone segments
* 2 - From top to bottom, and create vertical zone segments
* @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
* 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
pt_track->m_TimeStamp = s_TimeStamp;
pt_track->Insert( frame->m_Pcb, NULL );
if ( DC )
pt_track->Draw( frame->DrawPanel, DC, GR_OR );
nbsegm++;
}
......@@ -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->Insert( frame->m_Pcb, NULL );
if( DC )
pt_track->Draw( frame->DrawPanel, DC, GR_OR );
nbsegm++;
}
......@@ -654,6 +654,7 @@ bool WinEDA_PcbFrame::Genere_Pad_Connexion( wxDC* DC, int layer )
}
pt_track->Insert( m_Pcb, NULL );
if( DC )
pt_track->Draw( DrawPanel, DC, GR_OR );
}
}
......
......@@ -77,7 +77,7 @@ void WinEDA_PcbFrame::Delete_Zone( wxDC* DC, SEGZONE* aZone, long aTimestamp )
*/
{
int nb_segm = 0;
bool modify = FALSE;
bool modify = false;
unsigned long TimeStamp;
if( aZone == NULL )
......@@ -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 )
/*****************************************************************************/
/* 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
*/
{
......@@ -441,7 +441,7 @@ void WinEDA_PcbFrame::End_Zone( wxDC* DC )
if( net )
polygon->m_Netname = net->m_Netname;
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,
s_Zone_Hatching );
edge = edge->Next();
......@@ -585,13 +585,13 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v
/* Show the Net */
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
}
g_HightLigth_NetCode = s_NetcodeSelection;
if( !g_HightLigt_Status )
if( !g_HightLigt_Status && DC)
Hight_Light( DC );
if( g_HightLigth_NetCode > 0 )
......@@ -613,7 +613,7 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v
msg = _( "No Net" );
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_ZoneClearance = g_DesignSettings.m_ZoneClearence;
zone_container->m_GridFillValue = g_GridRoutingSize;
......@@ -641,13 +641,22 @@ int WinEDA_PcbFrame::Fill_All_Zones( wxDC* DC, bool verbose )
ZONE_CONTAINER* zone_container;
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++ )
{
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 )
break;
}
DrawPanel->Refresh(true);
return error_level;
}
......@@ -38,6 +38,7 @@ CPolyLine::CPolyLine()
m_dlist = NULL;
m_HatchStyle = 0;
m_sel_box = 0;
utility = 0;
m_gpc_poly = new gpc_polygon;
m_gpc_poly->num_contours = 0;
m_php_poly = new polygon;
......
......@@ -158,14 +158,15 @@ private:
int m_layer; // layer to draw on
int m_Width; // line width
int m_sel_box; // corner selection box width/2
public:
int utility;
protected:
std::vector <CPolyPt> corner; // array of points for corners
std::vector <int> side_style; // array of styles for sides
private:
std::vector <dl_element*> dl_side; // graphic elements
std::vector <dl_element*> dl_side_sel;
std::vector <dl_element*> dl_corner_sel;
public:
protected:
int m_HatchStyle; // hatch style, see enum above
std::vector <CSegment> m_HatchLines; // hatch lines
private:
......
......@@ -16,23 +16,23 @@ extern wxString g_Main_Title;
// Local
#ifdef GERBVIEW
static wxString MsgInfos(wxT("** GERBVIEW (jul 2001 .. 2007) **"));
static wxString MsgInfos(wxT("** GERBVIEW (jul 2001 .. 2008) **"));
#else
#ifdef PCBNEW
static wxString MsgInfos(wxT("** PCBNEW (sept 1992 .. 2007) **"));
static wxString MsgInfos(wxT("** PCBNEW (sept 1992 .. 2008) **"));
#endif
#endif
#ifdef CVPCB
static wxString MsgInfos(wxT("** CVPCB (sept 1992 .. 2007) **"));
static wxString MsgInfos(wxT("** CVPCB (sept 1992 .. 2008) **"));
#endif
#ifdef KICAD
static wxString MsgInfos(wxT("** KICAD (jul 2000 .. 2007) **"));
static wxString MsgInfos(wxT("** KICAD (jul 2000 .. 2008) **"));
#endif
#ifdef EESCHEMA
static wxString MsgInfos(wxT("** EESCHEMA (sept 1994 .. 2007) **"));
static wxString MsgInfos(wxT("** EESCHEMA (sept 1994 .. 2008) **"));
#endif
// 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