Commit b5c0cada authored by Miguel Angel Ajo's avatar Miguel Angel Ajo

merges tip, conflict resolved

parents 30e251bf e936d3c1
...@@ -258,7 +258,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List() ...@@ -258,7 +258,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List()
if( curr_zone->m_FillMode == 0 ) if( curr_zone->m_FillMode == 0 )
{ {
// solid polygons only are used to fill areas // solid polygons only are used to fill areas
if( curr_zone->m_FilledPolysList.size() > 3 ) if( curr_zone->GetFilledPolysList().size() > 3 )
{ {
Draw3D_SolidPolygonsInZones( curr_zone ); Draw3D_SolidPolygonsInZones( curr_zone );
} }
...@@ -286,14 +286,16 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List() ...@@ -286,14 +286,16 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List()
{ {
ZONE_CONTAINER* zone = pcb->GetArea( ii ); ZONE_CONTAINER* zone = pcb->GetArea( ii );
if( zone->m_FilledPolysList.size() == 0 ) std::vector<CPolyPt> polysList = zone->GetFilledPolysList();
if( polysList.size() == 0 )
continue; continue;
if( zone->m_ZoneMinThickness <= 1 ) if( zone->m_ZoneMinThickness <= 1 )
continue; continue;
int imax = zone->m_FilledPolysList.size() - 1; int imax = polysList.size() - 1;
CPolyPt* firstcorner = &zone->m_FilledPolysList[0]; CPolyPt* firstcorner = &polysList[0];
CPolyPt* begincorner = firstcorner; CPolyPt* begincorner = firstcorner;
SEGZONE dummysegment( pcb ); SEGZONE dummysegment( pcb );
dummysegment.SetLayer( zone->GetLayer() ); dummysegment.SetLayer( zone->GetLayer() );
...@@ -301,7 +303,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List() ...@@ -301,7 +303,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List()
for( int ic = 1; ic <= imax; ic++ ) for( int ic = 1; ic <= imax; ic++ )
{ {
CPolyPt* endcorner = &zone->m_FilledPolysList[ic]; CPolyPt* endcorner = &polysList[ic];
if( begincorner->utility == 0 ) if( begincorner->utility == 0 )
{ {
...@@ -330,7 +332,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List() ...@@ -330,7 +332,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List()
ic++; ic++;
if( ic < imax - 1 ) if( ic < imax - 1 )
begincorner = firstcorner = &zone->m_FilledPolysList[ic]; begincorner = firstcorner = &polysList[ic];
} }
else else
{ {
...@@ -440,7 +442,8 @@ void EDA_3D_CANVAS::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* aZone ) ...@@ -440,7 +442,8 @@ void EDA_3D_CANVAS::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* aZone )
// Draw solid areas contained in this zone // Draw solid areas contained in this zone
int StartContour = 1; int StartContour = 1;
for( unsigned ii = 0; ii < aZone->m_FilledPolysList.size(); ii++ ) std::vector<CPolyPt> polysList = aZone->GetFilledPolysList();
for( unsigned ii = 0; ii < polysList.size(); ii++ )
{ {
if( StartContour == 1 ) if( StartContour == 1 )
{ {
...@@ -449,11 +452,11 @@ void EDA_3D_CANVAS::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* aZone ) ...@@ -449,11 +452,11 @@ void EDA_3D_CANVAS::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* aZone )
StartContour = 0; StartContour = 0;
} }
v_data[0] = aZone->m_FilledPolysList[ii].x * g_Parm_3D_Visu.m_BoardScale; v_data[0] = polysList[ii].x * g_Parm_3D_Visu.m_BoardScale;
v_data[1] = -aZone->m_FilledPolysList[ii].y * g_Parm_3D_Visu.m_BoardScale; v_data[1] = -polysList[ii].y * g_Parm_3D_Visu.m_BoardScale;
gluTessVertex( tess, v_data, &aZone->m_FilledPolysList[ii] ); gluTessVertex( tess, v_data, &polysList[ii] );
if( aZone->m_FilledPolysList[ii].end_contour == 1 ) if( polysList[ii].end_contour == 1 )
{ {
gluTessEndContour( tess ); gluTessEndContour( tess );
gluTessEndPolygon( tess ); gluTessEndPolygon( tess );
......
...@@ -42,6 +42,14 @@ Dialogs: ...@@ -42,6 +42,14 @@ Dialogs:
leaving them all bundled tightly together. The dialog box should look leaving them all bundled tightly together. The dialog box should look
nice at any size large enough to show all the components. nice at any size large enough to show all the components.
When using wxFormBuilder, please add the following settings to the
"Dialog" node:
subclass.name <- DIALOG_SHIM
subclass.header <- dialog_shim.h
This will provide for an override of the Show( bool ) wxWindow() function
and provide retentitive size and position for the session.
Use tooltips to explain the functionality of each non-obvious control. Use tooltips to explain the functionality of each non-obvious control.
This is important because the help files and the wiki often lag behind This is important because the help files and the wiki often lag behind
the source code. the source code.
......
...@@ -55,6 +55,7 @@ const wxString SchematicFileWildcard( _( "KiCad schematic files (*.sch)|*.sch" ) ...@@ -55,6 +55,7 @@ const wxString SchematicFileWildcard( _( "KiCad schematic files (*.sch)|*.sch" )
const wxString NetlistFileWildcard( _( "KiCad netlist files (*.net)|*.net" ) ); const wxString NetlistFileWildcard( _( "KiCad netlist files (*.net)|*.net" ) );
const wxString GerberFileWildcard( _( "Gerber files (*.pho)|*.pho" ) ); const wxString GerberFileWildcard( _( "Gerber files (*.pho)|*.pho" ) );
const wxString LegacyPcbFileWildcard( _( "KiCad printed circuit board files (*.brd)|*.brd" ) ); const wxString LegacyPcbFileWildcard( _( "KiCad printed circuit board files (*.brd)|*.brd" ) );
const wxString EaglePcbFileWildcard( _( "Eagle ver. 6.x XML PCB files (*.brd)|*.brd" ) );
const wxString PcbFileWildcard( _( "KiCad s-expr printed circuit board files (*.kicad_pcb)|*.kicad_pcb" ) ); const wxString PcbFileWildcard( _( "KiCad s-expr printed circuit board files (*.kicad_pcb)|*.kicad_pcb" ) );
const wxString FootprintLibFileWildcard( _( "KiCad footprint library file (*.mod)|*.mod" ) ); const wxString FootprintLibFileWildcard( _( "KiCad footprint library file (*.mod)|*.mod" ) );
const wxString PdfFileWildcard( _( "Portable document format files (*.pdf)|*.pdf" ) ); const wxString PdfFileWildcard( _( "Portable document format files (*.pdf)|*.pdf" ) );
......
...@@ -34,6 +34,14 @@ public: ...@@ -34,6 +34,14 @@ public:
void OnUpdateTextDrawMode( wxUpdateUIEvent& aEvent ); void OnUpdateTextDrawMode( wxUpdateUIEvent& aEvent );
void OnUpdateLineDrawMode( wxUpdateUIEvent& aEvent ); void OnUpdateLineDrawMode( wxUpdateUIEvent& aEvent );
/**
* Function InitDisplay
* Refresh the full display for this frame:
* Set the title, the status line and redraw the canvas
* Must be called after the footprint to display is modifed
*/
void InitDisplay();
/** /**
* Function IsGridVisible() , virtual * Function IsGridVisible() , virtual
* @return true if the grid must be shown * @return true if the grid must be shown
......
...@@ -30,82 +30,78 @@ ...@@ -30,82 +30,78 @@
*/ */
void CVPCB_MAINFRAME::CreateScreenCmp() void CVPCB_MAINFRAME::CreateScreenCmp()
{ {
wxString msg, FootprintName;
bool IsNew = false;
FootprintName = m_FootprintList->GetSelectedFootprint();
if( m_DisplayFootprintFrame == NULL ) if( m_DisplayFootprintFrame == NULL )
{ {
m_DisplayFootprintFrame = new DISPLAY_FOOTPRINTS_FRAME( this, _( "Module" ), m_DisplayFootprintFrame = new DISPLAY_FOOTPRINTS_FRAME( this, _( "Module" ),
wxPoint( 0, 0 ), wxPoint( 0, 0 ),
wxSize( 600, 400 ), wxSize( 600, 400 ),
KICAD_DEFAULT_DRAWFRAME_STYLE ); KICAD_DEFAULT_DRAWFRAME_STYLE );
IsNew = true;
m_DisplayFootprintFrame->Show( true ); m_DisplayFootprintFrame->Show( true );
} }
else else
{ {
// Raising the window does not show the window on Windows if iconized.
// This should work on any platform.
if( m_DisplayFootprintFrame->IsIconized() ) if( m_DisplayFootprintFrame->IsIconized() )
m_DisplayFootprintFrame->Iconize( false ); m_DisplayFootprintFrame->Iconize( false );
m_DisplayFootprintFrame->Raise();
// Raising the window does not set the focus on Linux. This should work on any platform.
if( wxWindow::FindFocus() != m_DisplayFootprintFrame )
m_DisplayFootprintFrame->SetFocus();
} }
if( !FootprintName.IsEmpty() ) m_DisplayFootprintFrame->InitDisplay();
}
/* Refresh the full display for this frame:
* Set the title, the status line and redraw the canvas
* Must be called after the footprint to display is modifed
*/
void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
{
wxString msg;
CVPCB_MAINFRAME * parentframe = (CVPCB_MAINFRAME *) GetParent();
wxString footprintName = parentframe->m_FootprintList->GetSelectedFootprint();
if( !footprintName.IsEmpty() )
{ {
msg = _( "Footprint: " ) + FootprintName; msg = _( "Footprint: " ) + footprintName;
m_DisplayFootprintFrame->SetTitle( msg ); SetTitle( msg );
FOOTPRINT_INFO* Module = m_footprints.GetModuleInfo( FootprintName ); FOOTPRINT_INFO* module_info = parentframe->m_footprints.GetModuleInfo( footprintName );
msg = _( "Lib: " ); msg = _( "Lib: " );
if( Module ) if( module_info )
msg += Module->m_LibName; msg += module_info->m_LibName;
else else
msg += wxT( "???" ); msg += wxT( "???" );
m_DisplayFootprintFrame->SetStatusText( msg, 0 ); SetStatusText( msg, 0 );
if( m_DisplayFootprintFrame->GetBoard()->m_Modules.GetCount() ) if( GetBoard()->m_Modules.GetCount() )
{ {
// there is only one module in the list // there is only one module in the list
m_DisplayFootprintFrame->GetBoard()->m_Modules.DeleteAll(); GetBoard()->m_Modules.DeleteAll();
} }
MODULE* mod = m_DisplayFootprintFrame->Get_Module( FootprintName ); MODULE* module = Get_Module( footprintName );
if( mod )
m_DisplayFootprintFrame->GetBoard()->m_Modules.PushBack( mod );
m_DisplayFootprintFrame->Zoom_Automatique( false ); if( module )
m_DisplayFootprintFrame->GetCanvas()->Refresh(); GetBoard()->m_Modules.PushBack( module );
// Display new cursor coordinates and zoom value: Zoom_Automatique( false );
m_DisplayFootprintFrame->UpdateStatusBar();
if( m_DisplayFootprintFrame->m_Draw3DFrame )
m_DisplayFootprintFrame->m_Draw3DFrame->NewDisplay();
} }
else if( !IsNew ) // No footprint to display. Erase old footprint, if any else // No footprint to display. Erase old footprint, if any
{ {
if( m_DisplayFootprintFrame->GetBoard()->m_Modules.GetCount() ) if( GetBoard()->m_Modules.GetCount() )
{ {
m_DisplayFootprintFrame->GetBoard()->m_Modules.DeleteAll(); GetBoard()->m_Modules.DeleteAll();
m_DisplayFootprintFrame->Zoom_Automatique( false ); Zoom_Automatique( false );
m_DisplayFootprintFrame->SetStatusText( wxEmptyString, 0 ); SetStatusText( wxEmptyString, 0 );
m_DisplayFootprintFrame->UpdateStatusBar(); }
} }
m_DisplayFootprintFrame->Refresh(); // Display new cursor coordinates and zoom value:
UpdateStatusBar();
if( m_DisplayFootprintFrame->m_Draw3DFrame ) GetCanvas()->Refresh();
m_DisplayFootprintFrame->m_Draw3DFrame->NewDisplay();
} if( m_Draw3DFrame )
m_Draw3DFrame->NewDisplay();
} }
/* /*
......
...@@ -321,7 +321,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::deleteFieldButtonHandler( wxCommandEven ...@@ -321,7 +321,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::deleteFieldButtonHandler( wxCommandEven
if( fieldNdx >= m_FieldsBuf.size() ) // traps the -1 case too if( fieldNdx >= m_FieldsBuf.size() ) // traps the -1 case too
return; return;
if( fieldNdx <= VALUE ) if( fieldNdx < MANDATORY_FIELDS )
{ {
wxBell(); wxBell();
return; return;
...@@ -360,7 +360,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB:: moveUpButtonHandler( wxCommandEvent& e ...@@ -360,7 +360,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB:: moveUpButtonHandler( wxCommandEvent& e
if( fieldNdx >= m_FieldsBuf.size() ) // traps the -1 case too if( fieldNdx >= m_FieldsBuf.size() ) // traps the -1 case too
return; return;
if( fieldNdx <= MANDATORY_FIELDS ) if( fieldNdx < MANDATORY_FIELDS )
{ {
wxBell(); wxBell();
return; return;
...@@ -651,10 +651,10 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copySelectedFieldToPanel() ...@@ -651,10 +651,10 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copySelectedFieldToPanel()
// only user defined fields may be moved, and not the top most user defined // only user defined fields may be moved, and not the top most user defined
// field since it would be moving up into the fixed fields, > not >= // field since it would be moving up into the fixed fields, > not >=
moveUpButton->Enable( fieldNdx > MANDATORY_FIELDS ); moveUpButton->Enable( fieldNdx >= MANDATORY_FIELDS );
// if fieldNdx == REFERENCE, VALUE, then disable delete button // if fieldNdx == REFERENCE, VALUE, then disable delete button
deleteFieldButton->Enable( fieldNdx > VALUE ); deleteFieldButton->Enable( fieldNdx >= MANDATORY_FIELDS );
fieldValueTextCtrl->SetValue( field.m_Text ); fieldValueTextCtrl->SetValue( field.m_Text );
......
...@@ -35,14 +35,13 @@ ...@@ -35,14 +35,13 @@
#include <wxEeschemaStruct.h> #include <wxEeschemaStruct.h>
#include <general.h> #include <general.h>
#include <protos.h>
#include <class_library.h> #include <class_library.h>
#include <sch_component.h> #include <sch_component.h>
#include <dialog_edit_one_field.h> #include <dialog_edit_one_field.h>
void SCH_EDIT_FRAME::EditComponentFieldText( SCH_FIELD* aField, wxDC* aDC ) void SCH_EDIT_FRAME::EditComponentFieldText( SCH_FIELD* aField )
{ {
wxCHECK_RET( aField != NULL && aField->Type() == SCH_FIELD_T, wxCHECK_RET( aField != NULL && aField->Type() == SCH_FIELD_T,
wxT( "Cannot edit invalid schematic field." ) ); wxT( "Cannot edit invalid schematic field." ) );
...@@ -81,7 +80,6 @@ create a new power component with the new value." ), GetChars( entry->GetName() ...@@ -81,7 +80,6 @@ create a new power component with the new value." ), GetChars( entry->GetName()
wxString title; wxString title;
title.Printf( _( "Edit %s Field" ), GetChars( aField->GetName() ) ); title.Printf( _( "Edit %s Field" ), GetChars( aField->GetName() ) );
// wxTextEntryDialog dlg( this, wxEmptyString , title, newtext );
if( aField->GetText().IsEmpty() ) // Means the field was not already in use if( aField->GetText().IsEmpty() ) // Means the field was not already in use
{ {
aField->m_Pos = component->GetPosition(); aField->m_Pos = component->GetPosition();
...@@ -104,7 +102,7 @@ create a new power component with the new value." ), GetChars( entry->GetName() ...@@ -104,7 +102,7 @@ create a new power component with the new value." ), GetChars( entry->GetName()
{ {
if( fieldNdx == REFERENCE ) if( fieldNdx == REFERENCE )
{ {
// Test is reference is acceptable: // Test if the reference string is valid:
if( SCH_COMPONENT::IsReferenceStringValid( newtext ) ) if( SCH_COMPONENT::IsReferenceStringValid( newtext ) )
{ {
component->SetRef( m_CurrentSheet, newtext ); component->SetRef( m_CurrentSheet, newtext );
...@@ -136,10 +134,9 @@ create a new power component with the new value." ), GetChars( entry->GetName() ...@@ -136,10 +134,9 @@ create a new power component with the new value." ), GetChars( entry->GetName()
if( can_update ) if( can_update )
{ {
aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
dlg.TransfertDataToField(); dlg.TransfertDataToField();
aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
OnModify(); OnModify();
m_canvas->Refresh();
} }
component->DisplayInfo( this ); component->DisplayInfo( this );
......
...@@ -363,7 +363,7 @@ void SCH_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition ) ...@@ -363,7 +363,7 @@ void SCH_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition )
break; break;
case SCH_FIELD_T: case SCH_FIELD_T:
EditComponentFieldText( (SCH_FIELD*) item, aDC ); EditComponentFieldText( (SCH_FIELD*) item );
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
break; break;
......
...@@ -811,15 +811,15 @@ void SCH_EDIT_FRAME::OnEditItem( wxCommandEvent& aEvent ) ...@@ -811,15 +811,15 @@ void SCH_EDIT_FRAME::OnEditItem( wxCommandEvent& aEvent )
switch( aEvent.GetId() ) switch( aEvent.GetId() )
{ {
case ID_SCH_EDIT_COMPONENT_REFERENCE: case ID_SCH_EDIT_COMPONENT_REFERENCE:
EditComponentFieldText( ( (SCH_COMPONENT*) item )->GetField( REFERENCE ), &dc ); EditComponentFieldText( ( (SCH_COMPONENT*) item )->GetField( REFERENCE ) );
break; break;
case ID_SCH_EDIT_COMPONENT_VALUE: case ID_SCH_EDIT_COMPONENT_VALUE:
EditComponentFieldText( ( (SCH_COMPONENT*) item )->GetField( VALUE ), &dc ); EditComponentFieldText( ( (SCH_COMPONENT*) item )->GetField( VALUE ) );
break; break;
case ID_SCH_EDIT_COMPONENT_FOOTPRINT: case ID_SCH_EDIT_COMPONENT_FOOTPRINT:
EditComponentFieldText( ( (SCH_COMPONENT*) item )->GetField( FOOTPRINT ), &dc ); EditComponentFieldText( ( (SCH_COMPONENT*) item )->GetField( FOOTPRINT ) );
break; break;
case ID_SCH_EDIT_ITEM: case ID_SCH_EDIT_ITEM:
...@@ -850,7 +850,7 @@ void SCH_EDIT_FRAME::OnEditItem( wxCommandEvent& aEvent ) ...@@ -850,7 +850,7 @@ void SCH_EDIT_FRAME::OnEditItem( wxCommandEvent& aEvent )
break; break;
case SCH_FIELD_T: case SCH_FIELD_T:
EditComponentFieldText( (SCH_FIELD*) item, &dc ); EditComponentFieldText( (SCH_FIELD*) item );
break; break;
case SCH_BITMAP_T: case SCH_BITMAP_T:
......
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
#include "detail/transform_detail.hpp" #include "detail/transform_detail.hpp"
#include "detail/polygon_sort_adaptor.hpp" #include "detail/polygon_sort_adaptor.hpp"
#include "detail/polygon_sort_adaptor.hpp"
//interval //interval
#include "interval_data.hpp" #include "interval_data.hpp"
#include "interval_traits.hpp" #include "interval_traits.hpp"
......
...@@ -63,6 +63,7 @@ extern const wxString NetlistFileWildcard; ...@@ -63,6 +63,7 @@ extern const wxString NetlistFileWildcard;
extern const wxString GerberFileWildcard; extern const wxString GerberFileWildcard;
extern const wxString LegacyPcbFileWildcard; extern const wxString LegacyPcbFileWildcard;
extern const wxString PcbFileWildcard; extern const wxString PcbFileWildcard;
extern const wxString EaglePcbFileWildcard;
extern const wxString PdfFileWildcard; extern const wxString PdfFileWildcard;
extern const wxString MacrosFileWildcard; extern const wxString MacrosFileWildcard;
extern const wxString AllFilesWildcard; extern const wxString AllFilesWildcard;
......
...@@ -238,9 +238,10 @@ public: ...@@ -238,9 +238,10 @@ public:
* Function CursorGoto * Function CursorGoto
* positions the cursor at a given coordinate and reframes the drawing if the * positions the cursor at a given coordinate and reframes the drawing if the
* requested point is out of view. * requested point is out of view.
* @param aPos The point to go to. * @param aPos is the point to go to.
* @param aWarp is true if the pointer should be warped to the new position.
*/ */
void CursorGoto( const wxPoint& aPos ); void CursorGoto( const wxPoint& aPos, bool aWarp = true );
/** /**
* Function Save_Module_In_Library * Function Save_Module_In_Library
...@@ -319,10 +320,14 @@ public: ...@@ -319,10 +320,14 @@ public:
* Function ResetModuleTextSizes * Function ResetModuleTextSizes
* resets text size and width of all module text fields of given field * resets text size and width of all module text fields of given field
* type to current settings in Preferences->Dimensions->Texts and Drawings. * type to current settings in Preferences->Dimensions->Texts and Drawings.
* @param aType is the field type (TEXT_is_REFERENCE, TEXT_is_VALUE, or TEXT_is_DIVERS). * @param aFilter is a filter: footprint names must match this filter.
* @param aDC is the drawing context. * an empty filter, or "*" do not filter anything.
*/ * @param aRef = true to modify the reference of footprints.
void ResetModuleTextSizes( int aType, wxDC* aDC ); * @param aValue = true to modify the value of footprints.
* @param aOthers = true to modify the other fields of footprints.
*/
void ResetModuleTextSizes( const wxString & aFilter, bool aRef,
bool aValue, bool aOthers );
void InstallPadOptionsFrame( D_PAD* pad ); void InstallPadOptionsFrame( D_PAD* pad );
void InstallTextModOptionsFrame( TEXTE_MODULE* TextMod, wxDC* DC ); void InstallTextModOptionsFrame( TEXTE_MODULE* TextMod, wxDC* DC );
......
...@@ -963,7 +963,14 @@ private: ...@@ -963,7 +963,14 @@ private:
void ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC ); void ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC );
void SetInitCmp( SCH_COMPONENT* DrawComponent, wxDC* DC ); void SetInitCmp( SCH_COMPONENT* DrawComponent, wxDC* DC );
void EditComponentFieldText( SCH_FIELD* aField, wxDC* aDC ); /**
* Function EditComponentFieldText
* displays the edit field dialog to edit the parameters of \a aField.
*
* @param aField is a pointer to the SCH_FIELD object to be edited.
*/
void EditComponentFieldText( SCH_FIELD* aField );
void RotateField( SCH_FIELD* aField, wxDC* aDC ); void RotateField( SCH_FIELD* aField, wxDC* aDC );
/** /**
......
...@@ -481,6 +481,13 @@ public: ...@@ -481,6 +481,13 @@ public:
void Tracks_and_Vias_Size_Event( wxCommandEvent& event ); void Tracks_and_Vias_Size_Event( wxCommandEvent& event );
void OnSelectTool( wxCommandEvent& aEvent ); void OnSelectTool( wxCommandEvent& aEvent );
/**
* Function OnResetModuleTextSizes
* resets text size and width of all module text fields of given field
* type to current settings in Preferences
*/
void OnResetModuleTextSizes( wxCommandEvent& event );
void ProcessMuWaveFunctions( wxCommandEvent& event ); void ProcessMuWaveFunctions( wxCommandEvent& event );
void MuWaveCommand( wxDC* DC, const wxPoint& MousePos ); void MuWaveCommand( wxDC* DC, const wxPoint& MousePos );
...@@ -921,6 +928,7 @@ public: ...@@ -921,6 +928,7 @@ public:
// Handling texts on the board // Handling texts on the board
void Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ); void Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
void FlipTextePcb( TEXTE_PCB* aTextePcb, wxDC* aDC );
TEXTE_PCB* Create_Texte_Pcb( wxDC* DC ); TEXTE_PCB* Create_Texte_Pcb( wxDC* DC );
void Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ); void Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
void StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC ); void StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC );
...@@ -1488,7 +1496,7 @@ public: ...@@ -1488,7 +1496,7 @@ public:
void Clean_Pcb( wxDC* DC ); void Clean_Pcb( wxDC* DC );
void InstallFindFrame( const wxPoint& pos, wxDC* DC ); void InstallFindFrame();
/** /**
* Function SendMessageToEESCHEMA * Function SendMessageToEESCHEMA
......
...@@ -55,6 +55,8 @@ set(PCBNEW_DIALOGS ...@@ -55,6 +55,8 @@ set(PCBNEW_DIALOGS
dialogs/dialog_edit_module_text_base.cpp dialogs/dialog_edit_module_text_base.cpp
dialogs/dialog_exchange_modules_base.cpp dialogs/dialog_exchange_modules_base.cpp
dialogs/dialog_export_3Dfiles_base.cpp dialogs/dialog_export_3Dfiles_base.cpp
dialogs/dialog_find_base.cpp
dialogs/dialog_find.cpp
dialogs/dialog_freeroute_exchange.cpp dialogs/dialog_freeroute_exchange.cpp
dialogs/dialog_freeroute_exchange_base.cpp dialogs/dialog_freeroute_exchange_base.cpp
dialogs/dialog_gendrill.cpp dialogs/dialog_gendrill.cpp
...@@ -64,6 +66,8 @@ set(PCBNEW_DIALOGS ...@@ -64,6 +66,8 @@ set(PCBNEW_DIALOGS
dialogs/dialog_general_options_BoardEditor_base.cpp dialogs/dialog_general_options_BoardEditor_base.cpp
dialogs/dialog_global_edit_tracks_and_vias.cpp dialogs/dialog_global_edit_tracks_and_vias.cpp
dialogs/dialog_global_edit_tracks_and_vias_base.cpp dialogs/dialog_global_edit_tracks_and_vias_base.cpp
dialogs/dialog_global_modules_fields_edition.cpp
dialogs/dialog_global_modules_fields_edition_base.cpp
dialogs/dialog_global_pads_edition_base.cpp dialogs/dialog_global_pads_edition_base.cpp
dialogs/dialog_graphic_items_options.cpp dialogs/dialog_graphic_items_options.cpp
dialogs/dialog_graphic_items_options_base.cpp dialogs/dialog_graphic_items_options_base.cpp
...@@ -144,7 +148,6 @@ set(PCBNEW_CLASS_SRCS ...@@ -144,7 +148,6 @@ set(PCBNEW_CLASS_SRCS
export_gencad.cpp export_gencad.cpp
export_vrml.cpp export_vrml.cpp
files.cpp files.cpp
find.cpp
gen_drill_report_files.cpp gen_drill_report_files.cpp
gen_holes_and_tools_lists_for_drill.cpp gen_holes_and_tools_lists_for_drill.cpp
gen_modules_placefile.cpp gen_modules_placefile.cpp
......
...@@ -266,28 +266,31 @@ double PCB_BASE_FRAME::BestZoom() ...@@ -266,28 +266,31 @@ double PCB_BASE_FRAME::BestZoom()
} }
void PCB_BASE_FRAME::CursorGoto( const wxPoint& aPos ) void PCB_BASE_FRAME::CursorGoto( const wxPoint& aPos, bool aWarp )
{ {
// factored out of pcbnew/find.cpp // factored out of pcbnew/find.cpp
PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen(); PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen();
wxClientDC dc( m_canvas ); INSTALL_UNBUFFERED_DC( dc, m_canvas );
// There may be need to reframe the drawing. // There may be need to reframe the drawing.
if( !m_canvas->IsPointOnDisplay( aPos ) ) if( !m_canvas->IsPointOnDisplay( aPos ) )
{ {
screen->SetCrossHairPosition( aPos ); screen->SetCrossHairPosition( aPos );
RedrawScreen( aPos, true ); RedrawScreen( aPos, aWarp );
} }
else else
{ {
// Put cursor on item position // Put cursor on item position
m_canvas->CrossHairOff( &dc ); m_canvas->CrossHairOff( &dc );
screen->SetCrossHairPosition( aPos ); screen->SetCrossHairPosition( aPos );
if( aWarp )
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
m_canvas->CrossHairOn( &dc );
} }
m_canvas->CrossHairOn( &dc );
m_canvas->CrossHairOn( &dc );
} }
......
...@@ -89,6 +89,12 @@ BOARD::~BOARD() ...@@ -89,6 +89,12 @@ BOARD::~BOARD()
} }
void BOARD::Move( const wxPoint& aMoveVector ) // overload
{
}
void BOARD::chainMarkedSegments( wxPoint aPosition, int aLayerMask, TRACK_PTRS* aList ) void BOARD::chainMarkedSegments( wxPoint aPosition, int aLayerMask, TRACK_PTRS* aList )
{ {
TRACK* segment; // The current segment being analyzed. TRACK* segment; // The current segment being analyzed.
...@@ -1468,7 +1474,7 @@ int BOARD::SetAreasNetCodesFromNetNames( void ) ...@@ -1468,7 +1474,7 @@ int BOARD::SetAreasNetCodesFromNetNames( void )
if( GetArea( ii )->GetNet() != 0 ) // i.e. if this zone is connected to a net if( GetArea( ii )->GetNet() != 0 ) // i.e. if this zone is connected to a net
{ {
const NETINFO_ITEM* net = FindNet( GetArea( ii )->m_Netname ); const NETINFO_ITEM* net = FindNet( GetArea( ii )->GetNetName() );
if( net ) if( net )
{ {
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* @brief Class BOARD to handle a board. * @brief Class BOARD to handle a board.
*/ */
#ifndef CLASS_BOARD_H #ifndef CLASS_BOARD_H_
#define CLASS_BOARD_H #define CLASS_BOARD_H_
#include <dlist.h> #include <dlist.h>
...@@ -255,10 +255,11 @@ public: ...@@ -255,10 +255,11 @@ public:
BOARD(); BOARD();
~BOARD(); ~BOARD();
void Move( const wxPoint& aMoveVector ); // overload
void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; } void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
int GetFileFormatVersionAtLoad() const { return m_fileFormatVersionAtLoad; } int GetFileFormatVersionAtLoad() const { return m_fileFormatVersionAtLoad; }
/** /**
* Function GetDefaultLayerName * Function GetDefaultLayerName
* returns a default name of a PCB layer when given \a aLayerNumber. This * returns a default name of a PCB layer when given \a aLayerNumber. This
...@@ -1327,4 +1328,4 @@ public: ...@@ -1327,4 +1328,4 @@ public:
TRACK* CreateLockPoint( wxPoint& aPosition, TRACK* aSegment, PICKED_ITEMS_LIST* aList ); TRACK* CreateLockPoint( wxPoint& aPosition, TRACK* aSegment, PICKED_ITEMS_LIST* aList );
}; };
#endif // #ifndef CLASS_BOARD_H #endif // CLASS_BOARD_H_
...@@ -206,7 +206,7 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx ...@@ -206,7 +206,7 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx
if( ( draw_mode & GR_ALLOW_HIGHCONTRAST ) && DisplayOpt.ContrastModeDisplay ) if( ( draw_mode & GR_ALLOW_HIGHCONTRAST ) && DisplayOpt.ContrastModeDisplay )
{ {
if( !IsOnLayer( curr_layer ) ) if( !IsOnLayer( curr_layer ) && !IsOnLayer( EDGE_N ) )
{ {
color &= ~MASKCOLOR; color &= ~MASKCOLOR;
color |= DARKDARKGRAY; color |= DARKDARKGRAY;
......
...@@ -42,14 +42,11 @@ class EDA_DRAW_FRAME; ...@@ -42,14 +42,11 @@ class EDA_DRAW_FRAME;
class EDGE_MODULE : public DRAWSEGMENT class EDGE_MODULE : public DRAWSEGMENT
{ {
public:
wxPoint m_Start0; // Start point or center, relative to module origin, orient 0.
wxPoint m_End0; // End point, relative to module origin, orient 0.
public: public:
EDGE_MODULE( MODULE* parent, STROKE_T aShape = S_SEGMENT ); EDGE_MODULE( MODULE* parent, STROKE_T aShape = S_SEGMENT );
// Do not create a copy constructor. The one generated by the compiler is adequate. // Do not create a copy constructor. The one generated by the compiler is adequate.
// EDGE_MODULE( const EDGE_MODULE& );
~EDGE_MODULE(); ~EDGE_MODULE();
...@@ -90,6 +87,11 @@ public: ...@@ -90,6 +87,11 @@ public:
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // overload void Show( int nestLevel, std::ostream& os ) const; // overload
#endif #endif
//protected: @todo: is it just me?
wxPoint m_Start0; // Start point or center, relative to module origin, orient 0.
wxPoint m_End0; // End point, relative to module origin, orient 0.
}; };
#endif // CLASS_EDGE_MOD_H_ #endif // CLASS_EDGE_MOD_H_
...@@ -161,7 +161,10 @@ void TEXTE_PCB::Flip(const wxPoint& aCentre ) ...@@ -161,7 +161,10 @@ void TEXTE_PCB::Flip(const wxPoint& aCentre )
{ {
m_Pos.y = aCentre.y - ( m_Pos.y - aCentre.y ); m_Pos.y = aCentre.y - ( m_Pos.y - aCentre.y );
// NEGATE( m_Orient ); not needed: m_Mirror handles this // NEGATE( m_Orient ); not needed: m_Mirror handles this
if( ( GetLayer() == LAYER_N_BACK ) || ( GetLayer() == LAYER_N_FRONT ) ) if( GetLayer() == LAYER_N_BACK
|| GetLayer() == LAYER_N_FRONT
|| GetLayer() == SILKSCREEN_N_BACK
|| GetLayer() == SILKSCREEN_N_FRONT )
{ {
m_Mirror = not m_Mirror; /* inverse mirror */ m_Mirror = not m_Mirror; /* inverse mirror */
} }
......
...@@ -50,7 +50,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) : ...@@ -50,7 +50,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
BOARD_ITEM( parent, PCB_MODULE_TEXT_T ), BOARD_ITEM( parent, PCB_MODULE_TEXT_T ),
EDA_TEXT() EDA_TEXT()
{ {
MODULE* Module = (MODULE*) m_Parent; MODULE* module = (MODULE*) m_Parent;
m_Type = text_type; /* Reference */ m_Type = text_type; /* Reference */
...@@ -63,11 +63,11 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) : ...@@ -63,11 +63,11 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
SetLayer( SILKSCREEN_N_FRONT ); SetLayer( SILKSCREEN_N_FRONT );
if( Module && ( Module->Type() == PCB_MODULE_T ) ) if( module && ( module->Type() == PCB_MODULE_T ) )
{ {
m_Pos = Module->m_Pos; m_Pos = module->m_Pos;
int moduleLayer = Module->GetLayer(); int moduleLayer = module->GetLayer();
if( moduleLayer == LAYER_N_BACK ) if( moduleLayer == LAYER_N_BACK )
SetLayer( SILKSCREEN_N_BACK ); SetLayer( SILKSCREEN_N_BACK );
...@@ -120,18 +120,18 @@ int TEXTE_MODULE::GetLength() const ...@@ -120,18 +120,18 @@ int TEXTE_MODULE::GetLength() const
// Update draw coordinates // Update draw coordinates
void TEXTE_MODULE::SetDrawCoord() void TEXTE_MODULE::SetDrawCoord()
{ {
MODULE* Module = (MODULE*) m_Parent; MODULE* module = (MODULE*) m_Parent;
m_Pos = m_Pos0; m_Pos = m_Pos0;
if( Module == NULL ) if( module == NULL )
return; return;
int angle = Module->m_Orient; double angle = module->GetOrientation();
NORMALIZE_ANGLE_POS( angle ); NORMALIZE_ANGLE_POS( angle );
RotatePoint( &m_Pos.x, &m_Pos.y, angle ); RotatePoint( &m_Pos.x, &m_Pos.y, angle );
m_Pos += Module->m_Pos; m_Pos += module->GetPosition();
} }
...@@ -139,17 +139,17 @@ void TEXTE_MODULE::SetDrawCoord() ...@@ -139,17 +139,17 @@ void TEXTE_MODULE::SetDrawCoord()
// anchor point) // anchor point)
void TEXTE_MODULE::SetLocalCoord() void TEXTE_MODULE::SetLocalCoord()
{ {
MODULE* Module = (MODULE*) m_Parent; MODULE* module = (MODULE*) m_Parent;
if( Module == NULL ) if( module == NULL )
{ {
m_Pos0 = m_Pos; m_Pos0 = m_Pos;
return; return;
} }
m_Pos0 = m_Pos - Module->m_Pos; m_Pos0 = m_Pos - module->m_Pos;
int angle = Module->m_Orient; int angle = module->m_Orient;
NORMALIZE_ANGLE_POS( angle ); NORMALIZE_ANGLE_POS( angle );
RotatePoint( &m_Pos0.x, &m_Pos0.y, -angle ); RotatePoint( &m_Pos0.x, &m_Pos0.y, -angle );
...@@ -242,7 +242,7 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w ...@@ -242,7 +242,7 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w
wxSize size; wxSize size;
wxPoint pos; // Center of text wxPoint pos; // Center of text
PCB_BASE_FRAME* frame; PCB_BASE_FRAME* frame;
MODULE* Module = (MODULE*) m_Parent; /* parent must *not* be null MODULE* module = (MODULE*) m_Parent; /* parent must *not* be null
* (a module text without a footprint * (a module text without a footprint
* parent has no sense) */ * parent has no sense) */
...@@ -282,16 +282,16 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w ...@@ -282,16 +282,16 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w
pos.x, pos.y + anchor_size, 0, color ); pos.x, pos.y + anchor_size, 0, color );
} }
color = brd->GetLayerColor(Module->GetLayer()); color = brd->GetLayerColor(module->GetLayer());
if( Module->GetLayer() == LAYER_N_BACK ) if( module->GetLayer() == LAYER_N_BACK )
{ {
if( brd->IsElementVisible( MOD_TEXT_BK_VISIBLE ) == false ) if( brd->IsElementVisible( MOD_TEXT_BK_VISIBLE ) == false )
return; return;
color = brd->GetVisibleElementColor(MOD_TEXT_BK_VISIBLE); color = brd->GetVisibleElementColor(MOD_TEXT_BK_VISIBLE);
} }
else if( Module->GetLayer() == LAYER_N_FRONT ) else if( module->GetLayer() == LAYER_N_FRONT )
{ {
if( brd->IsElementVisible( MOD_TEXT_FR_VISIBLE ) == false ) if( brd->IsElementVisible( MOD_TEXT_FR_VISIBLE ) == false )
return; return;
...@@ -336,12 +336,12 @@ void TEXTE_MODULE::DrawUmbilical( EDA_DRAW_PANEL* aPanel, ...@@ -336,12 +336,12 @@ void TEXTE_MODULE::DrawUmbilical( EDA_DRAW_PANEL* aPanel,
int TEXTE_MODULE::GetDrawRotation() const int TEXTE_MODULE::GetDrawRotation() const
{ {
int rotation; int rotation;
MODULE* Module = (MODULE*) m_Parent; MODULE* module = (MODULE*) m_Parent;
rotation = m_Orient; rotation = m_Orient;
if( Module ) if( module )
rotation += Module->m_Orient; rotation += module->m_Orient;
NORMALIZE_ANGLE_POS( rotation ); NORMALIZE_ANGLE_POS( rotation );
......
...@@ -74,6 +74,7 @@ ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone ) : ...@@ -74,6 +74,7 @@ ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone ) :
// For corner moving, corner index to drag, or -1 if no selection // For corner moving, corner index to drag, or -1 if no selection
m_CornerSelection = -1; m_CornerSelection = -1;
m_IsFilled = aZone.m_IsFilled;
m_ZoneClearance = aZone.m_ZoneClearance; // clearance value m_ZoneClearance = aZone.m_ZoneClearance; // clearance value
m_ZoneMinThickness = aZone.m_ZoneMinThickness; m_ZoneMinThickness = aZone.m_ZoneMinThickness;
m_FillMode = aZone.m_FillMode; // Filling mode (segments/polygons) m_FillMode = aZone.m_FillMode; // Filling mode (segments/polygons)
...@@ -84,6 +85,11 @@ ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone ) : ...@@ -84,6 +85,11 @@ ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone ) :
m_ThermalReliefCopperBridge = aZone.m_ThermalReliefCopperBridge; m_ThermalReliefCopperBridge = aZone.m_ThermalReliefCopperBridge;
m_FilledPolysList = aZone.m_FilledPolysList; m_FilledPolysList = aZone.m_FilledPolysList;
m_FillSegmList = aZone.m_FillSegmList; m_FillSegmList = aZone.m_FillSegmList;
cornerSmoothingType = aZone.cornerSmoothingType;
cornerRadius = aZone.cornerRadius;
utility = aZone.utility;
utility2 = aZone.utility;
} }
...@@ -717,7 +723,7 @@ void ZONE_CONTAINER::DisplayInfo( EDA_DRAW_FRAME* frame ) ...@@ -717,7 +723,7 @@ void ZONE_CONTAINER::DisplayInfo( EDA_DRAW_FRAME* frame )
frame->AppendMsgPanel( _( "Corners" ), msg, BLUE ); frame->AppendMsgPanel( _( "Corners" ), msg, BLUE );
if( m_FillMode ) if( m_FillMode )
msg.Printf( _( "Segments" ), m_FillMode ); msg = _( "Segments" );
else else
msg = _( "Polygons" ); msg = _( "Polygons" );
......
...@@ -77,58 +77,7 @@ struct SEGMENT ...@@ -77,58 +77,7 @@ struct SEGMENT
class ZONE_CONTAINER : public BOARD_CONNECTED_ITEM class ZONE_CONTAINER : public BOARD_CONNECTED_ITEM
{ {
public: public:
wxString m_Netname; // Net Name
CPolyLine* m_Poly; // outlines
// For corner moving, corner index to drag, or -1 if no selection.
int m_CornerSelection;
int m_ZoneClearance; // clearance value
int m_ZoneMinThickness; // Min thickness value in filled areas
// How to fill areas: 0 = use filled polygons, != 0 fill with segments.
int m_FillMode;
// number of segments to convert a circle to a polygon (uses
//ARC_APPROX_SEGMENTS_COUNT_LOW_DEF or ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF)
int m_ArcToSegmentsCount;
// thickness of the gap in thermal reliefs.
int m_ThermalReliefGap;
// thickness of the copper bridge in thermal reliefs
int m_ThermalReliefCopperBridge;
int utility, utility2; // flags used in polygon calculations
// true when a zone was filled, false after deleting the filled areas
bool m_IsFilled;
/* set of filled polygons used to draw a zone as a filled area.
* from outlines (m_Poly) but unlike m_Poly these filled polygons have no hole
* (they are* all in one piece) In very simple cases m_FilledPolysList is same
* as m_Poly. In less simple cases (when m_Poly has holes) m_FilledPolysList is
* a polygon equivalent to m_Poly, without holes but with extra outline segment
* connecting "holes" with external main outline. In complex cases an outline
* described by m_Poly can have many filled areas
*/
std::vector <CPolyPt> m_FilledPolysList;
/* set of segments used to fill area, when fill zone by segment is used.
* ( m_FillMode == 1 )
* in this case segments have m_ZoneMinThickness width
*/
std::vector <SEGMENT> m_FillSegmList;
private:
CPolyLine* smoothedPoly; // Corner-smoothed version of m_Poly
int cornerSmoothingType;
unsigned int cornerRadius;
// Priority: when a zone outline is inside and other zone, if its priority is higher
// the other zone priority, it will be created inside.
// if priorities are equal, a DRC error is set
unsigned m_priority;
ZoneConnection m_PadConnection;
public:
ZONE_CONTAINER( BOARD* parent ); ZONE_CONTAINER( BOARD* parent );
ZONE_CONTAINER( const ZONE_CONTAINER& aZone ); ZONE_CONTAINER( const ZONE_CONTAINER& aZone );
...@@ -508,6 +457,34 @@ public: ...@@ -508,6 +457,34 @@ public:
*/ */
bool IsSame( const ZONE_CONTAINER &aZoneToCompare ); bool IsSame( const ZONE_CONTAINER &aZoneToCompare );
/**
* Function ClearFilledPolysList
* clears the list of filled polygons.
*/
void ClearFilledPolysList()
{
m_FilledPolysList.clear();
}
/**
* Function GetFilledPolysList
* returns a reference to the list of filled polygons.
* @return Reference to the list of filled polygons.
*/
const std::vector<CPolyPt>& GetFilledPolysList() const
{
return m_FilledPolysList;
}
/**
* Function AddFilledPolysList
* sets the list of filled polygons.
*/
void AddFilledPolysList( std::vector<CPolyPt>& aPolysList )
{
m_FilledPolysList = aPolysList;
}
/** /**
* Function GetSmoothedPoly * Function GetSmoothedPoly
* returns a pointer to the corner-smoothed version of * returns a pointer to the corner-smoothed version of
...@@ -547,6 +524,59 @@ public: ...@@ -547,6 +524,59 @@ public:
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif
CPolyLine* m_Poly; // outlines
// For corner moving, corner index to drag, or -1 if no selection.
int m_CornerSelection;
int m_ZoneClearance; // clearance value
int m_ZoneMinThickness; // Min thickness value in filled areas
// How to fill areas: 0 = use filled polygons, != 0 fill with segments.
int m_FillMode;
// number of segments to convert a circle to a polygon (uses
//ARC_APPROX_SEGMENTS_COUNT_LOW_DEF or ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF)
int m_ArcToSegmentsCount;
// thickness of the gap in thermal reliefs.
int m_ThermalReliefGap;
// thickness of the copper bridge in thermal reliefs
int m_ThermalReliefCopperBridge;
int utility, utility2; // flags used in polygon calculations
// true when a zone was filled, false after deleting the filled areas
bool m_IsFilled;
/* set of segments used to fill area, when fill zone by segment is used.
* ( m_FillMode == 1 )
* in this case segments have m_ZoneMinThickness width
*/
std::vector <SEGMENT> m_FillSegmList;
private:
wxString m_Netname; // Net Name
CPolyLine* smoothedPoly; // Corner-smoothed version of m_Poly
int cornerSmoothingType;
unsigned int cornerRadius;
// Priority: when a zone outline is inside and other zone, if its priority is higher
// the other zone priority, it will be created inside.
// if priorities are equal, a DRC error is set
unsigned m_priority;
ZoneConnection m_PadConnection;
/* set of filled polygons used to draw a zone as a filled area.
* from outlines (m_Poly) but unlike m_Poly these filled polygons have no hole
* (they are* all in one piece) In very simple cases m_FilledPolysList is same
* as m_Poly. In less simple cases (when m_Poly has holes) m_FilledPolysList is
* a polygon equivalent to m_Poly, without holes but with extra outline segment
* connecting "holes" with external main outline. In complex cases an outline
* described by m_Poly can have many filled areas
*/
std::vector <CPolyPt> m_FilledPolysList;
}; };
......
...@@ -56,9 +56,6 @@ private: ...@@ -56,9 +56,6 @@ private:
wxListView* m_LayerSelectionCtrl; wxListView* m_LayerSelectionCtrl;
static wxPoint prevPosition; ///< Dialog position & size
static wxSize prevSize;
/** /**
* Function initDialog * Function initDialog
* fills in the dialog controls using the current settings. * fills in the dialog controls using the current settings.
...@@ -108,8 +105,6 @@ private: ...@@ -108,8 +105,6 @@ private:
// Initialize static member variables // Initialize static member variables
wxString DIALOG_COPPER_ZONE::m_netNameShowFilter( wxT( "*" ) ); wxString DIALOG_COPPER_ZONE::m_netNameShowFilter( wxT( "*" ) );
wxPoint DIALOG_COPPER_ZONE::prevPosition( -1, -1 );
wxSize DIALOG_COPPER_ZONE::prevSize;
ZONE_EDIT_T InvokeCopperZonesEditor( PCB_BASE_FRAME* aCaller, ZONE_SETTINGS* aSettings ) ZONE_EDIT_T InvokeCopperZonesEditor( PCB_BASE_FRAME* aCaller, ZONE_SETTINGS* aSettings )
...@@ -157,10 +152,6 @@ DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* ...@@ -157,10 +152,6 @@ DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS*
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
if( prevPosition.x != -1 )
SetSize( prevPosition.x, prevPosition.y,
prevSize.x, prevSize.y );
else
Center(); Center();
} }
...@@ -169,8 +160,6 @@ void DIALOG_COPPER_ZONE::initDialog() ...@@ -169,8 +160,6 @@ void DIALOG_COPPER_ZONE::initDialog()
{ {
BOARD* board = m_Parent->GetBoard(); BOARD* board = m_Parent->GetBoard();
SetFocus(); // Required under wxGTK if we want to demiss the dialog with the ESC key
wxString msg; wxString msg;
if( m_settings.m_Zone_45_Only ) if( m_settings.m_Zone_45_Only )
...@@ -297,8 +286,6 @@ void DIALOG_COPPER_ZONE::OnButtonCancelClick( wxCommandEvent& event ) ...@@ -297,8 +286,6 @@ void DIALOG_COPPER_ZONE::OnButtonCancelClick( wxCommandEvent& event )
void DIALOG_COPPER_ZONE::OnButtonOkClick( wxCommandEvent& event ) void DIALOG_COPPER_ZONE::OnButtonOkClick( wxCommandEvent& event )
{ {
m_netNameShowFilter = m_ShowNetNameFilter->GetValue(); m_netNameShowFilter = m_ShowNetNameFilter->GetValue();
prevPosition = GetPosition();
prevSize = GetSize();
if( AcceptOptions( true ) ) if( AcceptOptions( true ) )
{ {
...@@ -311,9 +298,6 @@ void DIALOG_COPPER_ZONE::OnButtonOkClick( wxCommandEvent& event ) ...@@ -311,9 +298,6 @@ void DIALOG_COPPER_ZONE::OnButtonOkClick( wxCommandEvent& event )
// called on system close button // called on system close button
void DIALOG_COPPER_ZONE::OnClose( wxCloseEvent& event ) void DIALOG_COPPER_ZONE::OnClose( wxCloseEvent& event )
{ {
prevPosition = GetPosition();
prevSize = GetSize();
if( m_OnExitCode != ZONE_ABORT ) if( m_OnExitCode != ZONE_ABORT )
*m_ptr = m_settings; *m_ptr = m_settings;
...@@ -384,7 +368,7 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportab ...@@ -384,7 +368,7 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportab
wxString txtvalue = m_ZoneClearanceCtrl->GetValue(); wxString txtvalue = m_ZoneClearanceCtrl->GetValue();
m_settings.m_ZoneClearance = ReturnValueFromString( g_UserUnit, txtvalue ); m_settings.m_ZoneClearance = ReturnValueFromString( g_UserUnit, txtvalue );
// Test if this is a reasonnable value for this parameter // Test if this is a reasonable value for this parameter
// A too large value can hang Pcbnew // A too large value can hang Pcbnew
#define CLEARANCE_MAX_VALUE 5000 // in 1/10000 inch #define CLEARANCE_MAX_VALUE 5000 // in 1/10000 inch
if( m_settings.m_ZoneClearance > CLEARANCE_MAX_VALUE ) if( m_settings.m_ZoneClearance > CLEARANCE_MAX_VALUE )
...@@ -519,9 +503,6 @@ void DIALOG_COPPER_ZONE::OnNetSortingOptionSelected( wxCommandEvent& event ) ...@@ -519,9 +503,6 @@ void DIALOG_COPPER_ZONE::OnNetSortingOptionSelected( wxCommandEvent& event )
void DIALOG_COPPER_ZONE::ExportSetupToOtherCopperZones( wxCommandEvent& event ) void DIALOG_COPPER_ZONE::ExportSetupToOtherCopperZones( wxCommandEvent& event )
{ {
prevPosition = GetPosition();
prevSize = GetSize();
if( !AcceptOptions( true, true ) ) if( !AcceptOptions( true, true ) )
return; return;
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 30 2011) // C++ code generated with wxFormBuilder (version Apr 11 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE( DIALOG_COPPER_ZONE_BASE, wxDialog ) BEGIN_EVENT_TABLE( DIALOG_COPPER_ZONE_BASE, DIALOG_SHIM )
EVT_CLOSE( DIALOG_COPPER_ZONE_BASE::_wxFB_OnClose ) EVT_CLOSE( DIALOG_COPPER_ZONE_BASE::_wxFB_OnClose )
EVT_SIZE( DIALOG_COPPER_ZONE_BASE::_wxFB_OnSize ) EVT_SIZE( DIALOG_COPPER_ZONE_BASE::_wxFB_OnSize )
EVT_CHOICE( ID_M_NETDISPLAYOPTION, DIALOG_COPPER_ZONE_BASE::_wxFB_OnNetSortingOptionSelected ) EVT_CHOICE( ID_M_NETDISPLAYOPTION, DIALOG_COPPER_ZONE_BASE::_wxFB_OnNetSortingOptionSelected )
...@@ -23,7 +23,7 @@ BEGIN_EVENT_TABLE( DIALOG_COPPER_ZONE_BASE, wxDialog ) ...@@ -23,7 +23,7 @@ BEGIN_EVENT_TABLE( DIALOG_COPPER_ZONE_BASE, wxDialog )
EVT_BUTTON( wxID_CANCEL, DIALOG_COPPER_ZONE_BASE::_wxFB_OnButtonCancelClick ) EVT_BUTTON( wxID_CANCEL, DIALOG_COPPER_ZONE_BASE::_wxFB_OnButtonCancelClick )
END_EVENT_TABLE() END_EVENT_TABLE()
DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{ {
this->SetSizeHints( wxDefaultSize, wxDefaultSize ); this->SetSizeHints( wxDefaultSize, wxDefaultSize );
...@@ -38,6 +38,7 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i ...@@ -38,6 +38,7 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i
m_staticText17->Wrap( -1 ); m_staticText17->Wrap( -1 );
m_layerSizer->Add( m_staticText17, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); m_layerSizer->Add( m_staticText17, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
m_OptionsBoxSizer->Add( m_layerSizer, 1, wxEXPAND, 5 ); m_OptionsBoxSizer->Add( m_layerSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer7; wxBoxSizer* bSizer7;
...@@ -50,6 +51,7 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i ...@@ -50,6 +51,7 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i
m_ListNetNameSelection = new wxListBox( this, ID_NETNAME_SELECTION, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); m_ListNetNameSelection = new wxListBox( this, ID_NETNAME_SELECTION, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
bSizer7->Add( m_ListNetNameSelection, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); bSizer7->Add( m_ListNetNameSelection, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_OptionsBoxSizer->Add( bSizer7, 1, wxEXPAND, 5 ); m_OptionsBoxSizer->Add( bSizer7, 1, wxEXPAND, 5 );
wxStaticBoxSizer* m_NetSortOptSizer; wxStaticBoxSizer* m_NetSortOptSizer;
...@@ -86,8 +88,10 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i ...@@ -86,8 +88,10 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i
m_buttonRunFilter = new wxButton( this, wxID_APPLY_FILTERS, _("Apply Filters"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonRunFilter = new wxButton( this, wxID_APPLY_FILTERS, _("Apply Filters"), wxDefaultPosition, wxDefaultSize, 0 );
m_NetSortOptSizer->Add( m_buttonRunFilter, 0, wxALL|wxEXPAND, 5 ); m_NetSortOptSizer->Add( m_buttonRunFilter, 0, wxALL|wxEXPAND, 5 );
m_OptionsBoxSizer->Add( m_NetSortOptSizer, 0, wxALL, 5 ); m_OptionsBoxSizer->Add( m_NetSortOptSizer, 0, wxALL, 5 );
m_MainBoxSizer->Add( m_OptionsBoxSizer, 1, wxALL|wxEXPAND, 5 ); m_MainBoxSizer->Add( m_OptionsBoxSizer, 1, wxALL|wxEXPAND, 5 );
wxStaticBoxSizer* m_ExportableSetupSizer; wxStaticBoxSizer* m_ExportableSetupSizer;
...@@ -129,6 +133,7 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i ...@@ -129,6 +133,7 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i
m_cornerSmoothingCtrl = new wxTextCtrl( this, ID_M_CORNERSMOOTHINGCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_cornerSmoothingCtrl = new wxTextCtrl( this, ID_M_CORNERSMOOTHINGCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizer9->Add( m_cornerSmoothingCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); bSizer9->Add( m_cornerSmoothingCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_ExportableSetupSizer->Add( bSizer9, 0, wxEXPAND, 5 ); m_ExportableSetupSizer->Add( bSizer9, 0, wxEXPAND, 5 );
wxBoxSizer* m_LeftBox; wxBoxSizer* m_LeftBox;
...@@ -165,8 +170,10 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i ...@@ -165,8 +170,10 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i
m_ThermalShapesParamsSizer->Add( m_CopperWidthValue, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); m_ThermalShapesParamsSizer->Add( m_CopperWidthValue, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_LeftBox->Add( m_ThermalShapesParamsSizer, 0, wxALL|wxEXPAND, 5 ); m_LeftBox->Add( m_ThermalShapesParamsSizer, 0, wxALL|wxEXPAND, 5 );
m_ExportableSetupSizer->Add( m_LeftBox, 0, wxEXPAND, 5 ); m_ExportableSetupSizer->Add( m_LeftBox, 0, wxEXPAND, 5 );
wxBoxSizer* m_MiddleBox; wxBoxSizer* m_MiddleBox;
...@@ -201,6 +208,7 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i ...@@ -201,6 +208,7 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i
m_ArcApproximationOpt->SetSelection( 0 ); m_ArcApproximationOpt->SetSelection( 0 );
m_MiddleBox->Add( m_ArcApproximationOpt, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); m_MiddleBox->Add( m_ArcApproximationOpt, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_ExportableSetupSizer->Add( m_MiddleBox, 0, wxEXPAND, 5 ); m_ExportableSetupSizer->Add( m_MiddleBox, 0, wxEXPAND, 5 );
wxBoxSizer* bSizer81; wxBoxSizer* bSizer81;
...@@ -226,8 +234,10 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i ...@@ -226,8 +234,10 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i
m_OutlineAppearanceCtrl->SetSelection( 0 ); m_OutlineAppearanceCtrl->SetSelection( 0 );
bSizer81->Add( m_OutlineAppearanceCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); bSizer81->Add( m_OutlineAppearanceCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_ExportableSetupSizer->Add( bSizer81, 0, wxEXPAND, 5 ); m_ExportableSetupSizer->Add( bSizer81, 0, wxEXPAND, 5 );
m_MainBoxSizer->Add( m_ExportableSetupSizer, 1, wxALL|wxEXPAND, 5 ); m_MainBoxSizer->Add( m_ExportableSetupSizer, 1, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizer10; wxBoxSizer* bSizer10;
...@@ -245,8 +255,10 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i ...@@ -245,8 +255,10 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i
m_ButtonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); m_ButtonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer10->Add( m_ButtonCancel, 0, wxALL|wxEXPAND, 5 ); bSizer10->Add( m_ButtonCancel, 0, wxALL|wxEXPAND, 5 );
m_MainBoxSizer->Add( bSizer10, 0, wxALIGN_RIGHT|wxALL, 5 ); m_MainBoxSizer->Add( bSizer10, 0, wxALIGN_RIGHT|wxALL, 5 );
this->SetSizer( m_MainBoxSizer ); this->SetSizer( m_MainBoxSizer );
this->Layout(); this->Layout();
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 30 2011) // C++ code generated with wxFormBuilder (version Apr 11 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
#include <wx/intl.h> #include <wx/intl.h>
#include "dialog_shim.h"
#include <wx/string.h> #include <wx/string.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
...@@ -31,7 +32,7 @@ ...@@ -31,7 +32,7 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_COPPER_ZONE_BASE /// Class DIALOG_COPPER_ZONE_BASE
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DIALOG_COPPER_ZONE_BASE : public wxDialog class DIALOG_COPPER_ZONE_BASE : public DIALOG_SHIM
{ {
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
private: private:
...@@ -66,7 +67,7 @@ class DIALOG_COPPER_ZONE_BASE : public wxDialog ...@@ -66,7 +67,7 @@ class DIALOG_COPPER_ZONE_BASE : public wxDialog
ID_M_ARCAPPROXIMATIONOPT, ID_M_ARCAPPROXIMATIONOPT,
ID_M_ORIENTEDGESOPT, ID_M_ORIENTEDGESOPT,
ID_M_OUTLINEAPPEARANCECTRL, ID_M_OUTLINEAPPEARANCECTRL,
wxID_BUTTON_EXPORT, wxID_BUTTON_EXPORT
}; };
wxBoxSizer* m_MainBoxSizer; wxBoxSizer* m_MainBoxSizer;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2012 Marco Mattila <marcom99@gmail.com>
* Copyright (C) 2006 Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
* Copyright (C) 1992-2012 Kicad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fctsys.h>
#include <gr_basic.h>
#include <class_drawpanel.h>
#include <confirm.h>
#include <kicad_string.h>
#include <wxPcbStruct.h>
#include <class_board.h>
#include <class_module.h>
#include <class_marker_pcb.h>
#include <pcbnew.h>
#include <pcbnew_id.h>
#include <protos.h>
#include <dialog_find_base.h>
class DIALOG_FIND : public DIALOG_FIND_BASE
{
public:
DIALOG_FIND( PCB_BASE_FRAME* aParent );
private:
PCB_BASE_FRAME* parent;
int itemCount, markerCount;
static wxString prevSearchString;
static bool warpMouse;
void onButtonFindItemClick( wxCommandEvent& event );
void onButtonFindMarkerClick( wxCommandEvent& event );
void onButtonCloseClick( wxCommandEvent& event );
void onClose( wxCloseEvent& event );
};
// Initialize static member variables
wxString DIALOG_FIND::prevSearchString;
bool DIALOG_FIND::warpMouse = true;
DIALOG_FIND::DIALOG_FIND( PCB_BASE_FRAME* aParent ) : DIALOG_FIND_BASE( aParent )
{
parent = aParent;
SetFocus();
GetSizer()->SetSizeHints( this );
m_SearchTextCtrl->AppendText( prevSearchString );
m_NoMouseWarpCheckBox->SetValue( !warpMouse );
itemCount = markerCount = 0;
Center();
}
void DIALOG_FIND::onButtonCloseClick( wxCommandEvent& aEvent )
{
Close( true );
}
void DIALOG_FIND::onButtonFindItemClick( wxCommandEvent& aEvent )
{
PCB_SCREEN* screen = (PCB_SCREEN*) ( parent->GetScreen() );
wxPoint pos;
BOARD_ITEM* foundItem = 0;
wxString searchString = m_SearchTextCtrl->GetValue();
if( !searchString.IsSameAs( prevSearchString, false ) )
{
itemCount = 0;
}
prevSearchString = searchString;
parent->GetCanvas()->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y );
int count = 0;
for( MODULE* module = parent->GetBoard()->m_Modules; module; module = module->Next() )
{
if( WildCompareString( searchString, module->GetReference().GetData(), false ) )
{
count++;
if( count > itemCount )
{
foundItem = module;
pos = module->GetPosition();
itemCount++;
break;
}
}
if( WildCompareString( searchString, module->m_Value->m_Text.GetData(), false ) )
{
count++;
if( count > itemCount )
{
foundItem = module;
pos = module->m_Pos;
itemCount++;
break;
}
}
}
wxString msg;
if( foundItem )
{
parent->SetCurItem( foundItem );
msg.Printf( _( "<%s> found" ), GetChars( searchString ) );
parent->SetStatusText( msg );
parent->CursorGoto( pos, !m_NoMouseWarpCheckBox->IsChecked() );
}
else
{
parent->SetStatusText( wxEmptyString );
msg.Printf( _( "<%s> not found" ), GetChars( searchString ) );
DisplayError( this, msg, 10 );
itemCount = 0;
}
}
void DIALOG_FIND::onButtonFindMarkerClick( wxCommandEvent& aEvent )
{
PCB_SCREEN* screen = (PCB_SCREEN*) ( parent->GetScreen() );
wxPoint pos;
BOARD_ITEM* foundItem = 0;
parent->GetCanvas()->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y );
MARKER_PCB* marker = parent->GetBoard()->GetMARKER( markerCount++ );
if( marker )
{
foundItem = marker;
pos = marker->GetPosition();
}
wxString msg;
if( foundItem )
{
parent->SetCurItem( foundItem );
msg = _( "Marker found" );
parent->SetStatusText( msg );
parent->CursorGoto( pos, !m_NoMouseWarpCheckBox->IsChecked() );
}
else
{
parent->SetStatusText( wxEmptyString );
msg = _( "No marker found" );
DisplayError( this, msg, 10 );
markerCount = 0;
}
}
void DIALOG_FIND::onClose( wxCloseEvent& aEvent )
{
warpMouse = !m_NoMouseWarpCheckBox->IsChecked();
EndModal( 1 );
}
void PCB_EDIT_FRAME::InstallFindFrame()
{
DIALOG_FIND dlg( this );
dlg.ShowModal();
}
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug 24 2011)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_find_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_FIND_BASE::DIALOG_FIND_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizer3;
bSizer3 = new wxBoxSizer( wxVERTICAL );
m_staticText1 = new wxStaticText( this, wxID_ANY, _("Search for:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1->Wrap( -1 );
bSizer3->Add( m_staticText1, 0, wxALL, 5 );
m_SearchTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 200,-1 ), 0 );
bSizer3->Add( m_SearchTextCtrl, 0, wxALL|wxEXPAND, 5 );
m_NoMouseWarpCheckBox = new wxCheckBox( this, wxID_ANY, _("Do not warp mouse pointer"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer3->Add( m_NoMouseWarpCheckBox, 0, wxALL, 5 );
bSizerMain->Add( bSizer3, 1, 0, 5 );
wxBoxSizer* bSizer4;
bSizer4 = new wxBoxSizer( wxVERTICAL );
m_button1 = new wxButton( this, wxID_ANY, _("Find Item"), wxDefaultPosition, wxDefaultSize, 0 );
m_button1->SetDefault();
bSizer4->Add( m_button1, 0, wxALL, 5 );
m_button2 = new wxButton( this, wxID_ANY, _("Find Marker"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer4->Add( m_button2, 0, wxALL, 5 );
m_button3 = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer4->Add( m_button3, 0, wxALL, 5 );
bSizerMain->Add( bSizer4, 0, 0, 5 );
this->SetSizer( bSizerMain );
this->Layout();
bSizerMain->Fit( this );
this->Centre( wxBOTH );
// Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_FIND_BASE::onClose ) );
m_button1->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonFindItemClick ), NULL, this );
m_button2->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonFindMarkerClick ), NULL, this );
m_button3->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonCloseClick ), NULL, this );
}
DIALOG_FIND_BASE::~DIALOG_FIND_BASE()
{
// Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_FIND_BASE::onClose ) );
m_button1->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonFindItemClick ), NULL, this );
m_button2->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonFindMarkerClick ), NULL, this );
m_button3->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonCloseClick ), NULL, this );
}
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="10" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_python_events">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_find_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">1</property>
<property name="name">dialog_find</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_python_events">1</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_managed">0</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center">wxBOTH</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="extra_style"></property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">DIALOG_FIND_BASE</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="resize">Resizable</property>
<property name="row"></property>
<property name="show">1</property>
<property name="size">-1,-1</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Find</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnClose">onClose</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerMain</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag"></property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer3</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Search for:</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticText1</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="resize">Resizable</property>
<property name="row"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_SearchTextCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="resize">Resizable</property>
<property name="row"></property>
<property name="show">1</property>
<property name="size">200,-1</property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Do not warp mouse pointer</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_NoMouseWarpCheckBox</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="resize">Resizable</property>
<property name="row"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag"></property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer4</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Find Item</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_button1</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="resize">Resizable</property>
<property name="row"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">onButtonFindItemClick</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Find Marker</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_button2</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="resize">Resizable</property>
<property name="row"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">onButtonFindMarkerClick</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_CANCEL</property>
<property name="label">Close</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_button3</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="resize">Resizable</property>
<property name="row"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">onButtonCloseClick</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug 24 2011)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_FIND_BASE_H__
#define __DIALOG_FIND_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/checkbox.h>
#include <wx/sizer.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_FIND_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_FIND_BASE : public DIALOG_SHIM
{
private:
protected:
wxStaticText* m_staticText1;
wxTextCtrl* m_SearchTextCtrl;
wxCheckBox* m_NoMouseWarpCheckBox;
wxButton* m_button1;
wxButton* m_button2;
wxButton* m_button3;
// Virtual event handlers, overide them in your derived class
virtual void onClose( wxCloseEvent& event ) { event.Skip(); }
virtual void onButtonFindItemClick( wxCommandEvent& event ) { event.Skip(); }
virtual void onButtonFindMarkerClick( wxCommandEvent& event ) { event.Skip(); }
virtual void onButtonCloseClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_FIND_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Find"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_FIND_BASE();
};
#endif //__DIALOG_FIND_BASE_H__
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file dialog_global_modules_fields_edition.cpp
* @brief global module fields edition.
*/
#include <fctsys.h>
#include <common.h>
#include <class_drawpanel.h>
#include <wxBasePcbFrame.h>
#include <base_units.h>
#include <kicad_string.h>
#include <pcbnew.h>
#include <wxPcbStruct.h>
#include <class_board.h>
#include <class_module.h>
#include <class_text_mod.h>
#include <dialog_global_modules_fields_edition_base.h>
// The dialog to set options for global fields edition:
// optionas are:
// - edited fields (ref, value, others
// - the footprint filter, for selective edition
class DIALOG_GLOBAL_MODULES_FIELDS_EDITION : public DIALOG_GLOBAL_MODULES_FIELDS_EDITION_BASE
{
PCB_EDIT_FRAME* m_parent;
BOARD_DESIGN_SETTINGS* m_brdSettings;
// Static variable to remember options, withing a session:
static bool m_refSelection;
static bool m_valueSelection;
static bool m_othersSelection;
static wxString m_filterString;
public:
DIALOG_GLOBAL_MODULES_FIELDS_EDITION( PCB_EDIT_FRAME* parent )
: DIALOG_GLOBAL_MODULES_FIELDS_EDITION_BASE( parent )
{
m_parent = parent;
initDialog();
}
private:
void initDialog();
// event handlers
void OnOKClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event )
{
EndModal( wxID_CANCEL );
}
};
bool DIALOG_GLOBAL_MODULES_FIELDS_EDITION::m_refSelection = false;
bool DIALOG_GLOBAL_MODULES_FIELDS_EDITION::m_valueSelection = false;
bool DIALOG_GLOBAL_MODULES_FIELDS_EDITION::m_othersSelection = false;
wxString DIALOG_GLOBAL_MODULES_FIELDS_EDITION::m_filterString;
void DIALOG_GLOBAL_MODULES_FIELDS_EDITION::initDialog()
{
m_sdbSizerButtonsOK->SetDefault();
m_brdSettings = &m_parent->GetDesignSettings();
m_ReferenceOpt->SetValue(m_refSelection),
m_ValueOpt->SetValue(m_valueSelection),
m_OtherFields->SetValue(m_othersSelection);
m_ModuleFilter->SetValue(m_filterString);
m_SizeXunit->SetLabel( GetAbbreviatedUnitsLabel() );
m_SizeYunit->SetLabel( GetAbbreviatedUnitsLabel() );
m_Ticknessunit->SetLabel( GetAbbreviatedUnitsLabel() );
m_SizeX_Value->SetValue(
ReturnStringFromValue( g_UserUnit, m_brdSettings->m_ModuleTextSize.x ) );
m_SizeY_Value->SetValue(
ReturnStringFromValue( g_UserUnit, m_brdSettings->m_ModuleTextSize.y ) );
m_TicknessValue->SetValue(
ReturnStringFromValue( g_UserUnit, m_brdSettings->m_ModuleTextWidth) );
Layout();
GetSizer()->SetSizeHints( this );
Centre();
}
void DIALOG_GLOBAL_MODULES_FIELDS_EDITION::OnOKClick( wxCommandEvent& event )
{
m_refSelection = m_ReferenceOpt->GetValue();
m_valueSelection = m_ValueOpt->GetValue();
m_othersSelection = m_OtherFields->GetValue();
m_filterString = m_ModuleFilter->GetValue();
m_brdSettings->m_ModuleTextSize.x = ReturnValueFromTextCtrl( *m_SizeX_Value );
m_brdSettings->m_ModuleTextSize.y = ReturnValueFromTextCtrl( *m_SizeY_Value );
m_brdSettings->m_ModuleTextWidth = ReturnValueFromTextCtrl( *m_TicknessValue );
// clip m_ModuleTextWidth to the 1/4 of min size, to keep it always readable
int minsize = min( m_brdSettings->m_ModuleTextSize.x,
m_brdSettings->m_ModuleTextSize.y ) / 4;
if( m_brdSettings->m_ModuleTextWidth > minsize )
m_brdSettings->m_ModuleTextWidth = minsize;
m_parent->ResetModuleTextSizes( m_filterString, m_refSelection,
m_valueSelection, m_othersSelection );
EndModal( wxID_OK );
}
void PCB_EDIT_FRAME::OnResetModuleTextSizes( wxCommandEvent& event )
{
DIALOG_GLOBAL_MODULES_FIELDS_EDITION dlg(this);
dlg.ShowModal();
m_canvas->Refresh();
}
void PCB_BASE_FRAME::ResetModuleTextSizes( const wxString & aFilter, bool aRef,
bool aValue, bool aOthers )
{
MODULE* module;
BOARD_ITEM* boardItem;
TEXTE_MODULE* item;
ITEM_PICKER itemWrapper( NULL, UR_CHANGED );
PICKED_ITEMS_LIST undoItemList;
unsigned int ii;
// Prepare undo list
for( module = GetBoard()->m_Modules; module; module = module->Next() )
{
itemWrapper.SetItem( module );
if( ! aFilter.IsEmpty() )
{
if( ! WildCompareString( aFilter, module->GetLibRef(), false ) )
continue;
}
if( aRef )
{
item = module->m_Reference;
if( item->GetSize() != GetDesignSettings().m_ModuleTextSize ||
item->GetThickness() != GetDesignSettings().m_ModuleTextWidth )
{
undoItemList.PushItem( itemWrapper );
}
}
if( aValue )
{
item = module->m_Value;
if( item->GetSize() != GetDesignSettings().m_ModuleTextSize ||
item->GetThickness() != GetDesignSettings().m_ModuleTextWidth )
{
undoItemList.PushItem( itemWrapper );
}
}
if( aOthers )
{
// Go through all other module text fields
for( boardItem = module->m_Drawings; boardItem; boardItem = boardItem->Next() )
{
if( boardItem->Type() == PCB_MODULE_TEXT_T )
{
item = (TEXTE_MODULE*) boardItem;
if( item->GetSize() != GetDesignSettings().m_ModuleTextSize
|| item->GetThickness() != GetDesignSettings().m_ModuleTextWidth )
{
undoItemList.PushItem( itemWrapper );
}
}
}
}
}
// Exit if there's nothing to do
if( !undoItemList.GetCount() )
return;
SaveCopyInUndoList( undoItemList, UR_CHANGED );
// Apply changes to modules in the undo list
for( ii = 0; ii < undoItemList.GetCount(); ii++ )
{
module = (MODULE*) undoItemList.GetPickedItem( ii );
if( aRef )
{
module->m_Reference->SetThickness( GetDesignSettings().m_ModuleTextWidth );
module->m_Reference->SetSize( GetDesignSettings().m_ModuleTextSize );
}
if( aValue )
{
module->m_Value->SetThickness( GetDesignSettings().m_ModuleTextWidth );
module->m_Value->SetSize( GetDesignSettings().m_ModuleTextSize );
}
if( aOthers )
{
for( boardItem = module->m_Drawings; boardItem; boardItem = boardItem->Next() )
{
if( boardItem->Type() == PCB_MODULE_TEXT_T )
{
item = (TEXTE_MODULE*) boardItem;
item->SetThickness( GetDesignSettings().m_ModuleTextWidth );
item->SetSize( GetDesignSettings().m_ModuleTextSize );
}
}
}
}
OnModify();
}
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 10 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_global_modules_fields_edition_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_GLOBAL_MODULES_FIELDS_EDITION_BASE::DIALOG_GLOBAL_MODULES_FIELDS_EDITION_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerUpper;
bSizerUpper = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bLeftSizer;
bLeftSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizer1;
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Fields:") ), wxVERTICAL );
m_ReferenceOpt = new wxCheckBox( this, wxID_ANY, _("Modify reference"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer1->Add( m_ReferenceOpt, 0, wxALL|wxEXPAND, 5 );
m_ValueOpt = new wxCheckBox( this, wxID_ANY, _("Modify value"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer1->Add( m_ValueOpt, 0, wxALL|wxEXPAND, 5 );
m_OtherFields = new wxCheckBox( this, wxID_ANY, _("Modify other fields"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer1->Add( m_OtherFields, 0, wxALL|wxEXPAND, 5 );
bLeftSizer->Add( sbSizer1, 1, wxEXPAND|wxRIGHT, 5 );
m_staticTextFilter = new wxStaticText( this, wxID_ANY, _("Modules Filter:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextFilter->Wrap( -1 );
m_staticTextFilter->SetToolTip( _("A string to filter modules to edit.\nIf not void, footprint names should match this filter.\nA filter can be something like SM* (case insensitive)") );
bLeftSizer->Add( m_staticTextFilter, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ModuleFilter = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_ModuleFilter->SetMinSize( wxSize( 180,-1 ) );
bLeftSizer->Add( m_ModuleFilter, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
bSizerUpper->Add( bLeftSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bRightSizer;
bRightSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizerSettings;
sbSizerSettings = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Current Design Settings:") ), wxVERTICAL );
wxFlexGridSizer* fgSizerCurrSettings;
fgSizerCurrSettings = new wxFlexGridSizer( 3, 3, 0, 0 );
fgSizerCurrSettings->AddGrowableCol( 1 );
fgSizerCurrSettings->SetFlexibleDirection( wxBOTH );
fgSizerCurrSettings->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticText3 = new wxStaticText( this, wxID_ANY, _("Size X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 );
fgSizerCurrSettings->Add( m_staticText3, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_SizeX_Value = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerCurrSettings->Add( m_SizeX_Value, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_SizeXunit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_SizeXunit->Wrap( -1 );
fgSizerCurrSettings->Add( m_SizeXunit, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_staticText6 = new wxStaticText( this, wxID_ANY, _("Size Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText6->Wrap( -1 );
fgSizerCurrSettings->Add( m_staticText6, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT|wxALIGN_RIGHT, 5 );
m_SizeY_Value = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerCurrSettings->Add( m_SizeY_Value, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_SizeYunit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_SizeYunit->Wrap( -1 );
fgSizerCurrSettings->Add( m_SizeYunit, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
m_staticText9 = new wxStaticText( this, wxID_ANY, _("Thickness:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText9->Wrap( -1 );
fgSizerCurrSettings->Add( m_staticText9, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_TicknessValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerCurrSettings->Add( m_TicknessValue, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_Ticknessunit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_Ticknessunit->Wrap( -1 );
fgSizerCurrSettings->Add( m_Ticknessunit, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
sbSizerSettings->Add( fgSizerCurrSettings, 1, wxEXPAND, 5 );
bRightSizer->Add( sbSizerSettings, 0, wxEXPAND|wxLEFT, 5 );
bSizerUpper->Add( bRightSizer, 0, wxEXPAND, 5 );
bMainSizer->Add( bSizerUpper, 1, wxEXPAND, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_sdbSizerButtons = new wxStdDialogButtonSizer();
m_sdbSizerButtonsOK = new wxButton( this, wxID_OK );
m_sdbSizerButtons->AddButton( m_sdbSizerButtonsOK );
m_sdbSizerButtonsCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizerButtons->AddButton( m_sdbSizerButtonsCancel );
m_sdbSizerButtons->Realize();
bMainSizer->Add( m_sdbSizerButtons, 0, wxEXPAND|wxBOTTOM|wxRIGHT, 5 );
this->SetSizer( bMainSizer );
this->Layout();
// Connect Events
m_sdbSizerButtonsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_MODULES_FIELDS_EDITION_BASE::OnCancelClick ), NULL, this );
m_sdbSizerButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_MODULES_FIELDS_EDITION_BASE::OnOKClick ), NULL, this );
}
DIALOG_GLOBAL_MODULES_FIELDS_EDITION_BASE::~DIALOG_GLOBAL_MODULES_FIELDS_EDITION_BASE()
{
// Disconnect Events
m_sdbSizerButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_MODULES_FIELDS_EDITION_BASE::OnCancelClick ), NULL, this );
m_sdbSizerButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_MODULES_FIELDS_EDITION_BASE::OnOKClick ), NULL, this );
}
This source diff could not be displayed because it is too large. You can view the blob instead.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 10 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_GLOBAL_MODULES_FIELDS_EDITION_BASE_H__
#define __DIALOG_GLOBAL_MODULES_FIELDS_EDITION_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/checkbox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_GLOBAL_MODULES_FIELDS_EDITION_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_GLOBAL_MODULES_FIELDS_EDITION_BASE : public DIALOG_SHIM
{
private:
protected:
wxCheckBox* m_ReferenceOpt;
wxCheckBox* m_ValueOpt;
wxCheckBox* m_OtherFields;
wxStaticText* m_staticTextFilter;
wxTextCtrl* m_ModuleFilter;
wxStaticText* m_staticText3;
wxTextCtrl* m_SizeX_Value;
wxStaticText* m_SizeXunit;
wxStaticText* m_staticText6;
wxTextCtrl* m_SizeY_Value;
wxStaticText* m_SizeYunit;
wxStaticText* m_staticText9;
wxTextCtrl* m_TicknessValue;
wxStaticText* m_Ticknessunit;
wxStaticLine* m_staticline1;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOKClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_GLOBAL_MODULES_FIELDS_EDITION_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Global Module Fields Edition"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 409,199 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_GLOBAL_MODULES_FIELDS_EDITION_BASE();
};
#endif //__DIALOG_GLOBAL_MODULES_FIELDS_EDITION_BASE_H__
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project> <wxFormBuilder_Project>
<FileVersion major="1" minor="10" /> <FileVersion major="1" minor="11" />
<object class="Project" expanded="1"> <object class="Project" expanded="1">
<property name="class_decoration"></property> <property name="class_decoration" />
<property name="code_generation">C++</property> <property name="code_generation">C++</property>
<property name="disconnect_events">1</property> <property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property> <property name="disconnect_mode">source_name</property>
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
<property name="help_provider">none</property> <property name="help_provider">none</property>
<property name="internationalize">1</property> <property name="internationalize">1</property>
<property name="name">dialog_global_pads_edition</property> <property name="name">dialog_global_pads_edition</property>
<property name="namespace"></property> <property name="namespace" />
<property name="path">.</property> <property name="path">.</property>
<property name="precompiled_header"></property> <property name="precompiled_header" />
<property name="relative_path">1</property> <property name="relative_path">1</property>
<property name="skip_python_events">1</property> <property name="skip_python_events">1</property>
<property name="use_enum">0</property> <property name="use_enum">0</property>
...@@ -28,15 +28,15 @@ ...@@ -28,15 +28,15 @@
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
<property name="TopDockable">1</property> <property name="TopDockable">1</property>
<property name="aui_managed">0</property> <property name="aui_managed">0</property>
<property name="aui_name"></property> <property name="aui_name" />
<property name="best_size"></property> <property name="best_size" />
<property name="bg"></property> <property name="bg" />
<property name="caption"></property> <property name="caption" />
<property name="caption_visible">1</property> <property name="caption_visible">1</property>
<property name="center"></property> <property name="center" />
<property name="center_pane">0</property> <property name="center_pane">0</property>
<property name="close_button">1</property> <property name="close_button">1</property>
<property name="context_help"></property> <property name="context_help" />
<property name="context_menu">1</property> <property name="context_menu">1</property>
<property name="default_pane">0</property> <property name="default_pane">0</property>
<property name="dock">Dock</property> <property name="dock">Dock</property>
...@@ -44,82 +44,82 @@ ...@@ -44,82 +44,82 @@
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="event_handler">impl_virtual</property> <property name="event_handler">impl_virtual</property>
<property name="extra_style"></property> <property name="extra_style" />
<property name="fg"></property> <property name="fg" />
<property name="floatable">1</property> <property name="floatable">1</property>
<property name="font"></property> <property name="font" />
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="layer"></property> <property name="layer" />
<property name="max_size"></property> <property name="max_size" />
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size" />
<property name="min_size"></property> <property name="min_size" />
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size" />
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">DIALOG_GLOBAL_PADS_EDITION_BASE</property> <property name="name">DIALOG_GLOBAL_PADS_EDITION_BASE</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
<property name="pane_position"></property> <property name="pane_position" />
<property name="pane_size"></property> <property name="pane_size" />
<property name="pin_button">1</property> <property name="pin_button">1</property>
<property name="pos"></property> <property name="pos" />
<property name="position"></property> <property name="position" />
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="row"></property> <property name="row" />
<property name="show">1</property> <property name="show">1</property>
<property name="size">482,165</property> <property name="size">482,165</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property> <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass"></property> <property name="subclass" />
<property name="title">Global Pads Edition</property> <property name="title">Global Pads Edition</property>
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip"></property> <property name="tooltip" />
<property name="validator_data_type"></property> <property name="validator_data_type" />
<property name="validator_style">wxFILTER_NONE</property> <property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property> <property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property> <property name="validator_variable" />
<property name="window_extra_style"></property> <property name="window_extra_style" />
<property name="window_name"></property> <property name="window_name" />
<property name="window_style"></property> <property name="window_style" />
<event name="OnActivate"></event> <event name="OnActivate" />
<event name="OnActivateApp"></event> <event name="OnActivateApp" />
<event name="OnAuiFindManager"></event> <event name="OnAuiFindManager" />
<event name="OnAuiPaneButton"></event> <event name="OnAuiPaneButton" />
<event name="OnAuiPaneClose"></event> <event name="OnAuiPaneClose" />
<event name="OnAuiPaneMaximize"></event> <event name="OnAuiPaneMaximize" />
<event name="OnAuiPaneRestore"></event> <event name="OnAuiPaneRestore" />
<event name="OnAuiRender"></event> <event name="OnAuiRender" />
<event name="OnChar"></event> <event name="OnChar" />
<event name="OnClose"></event> <event name="OnClose" />
<event name="OnEnterWindow"></event> <event name="OnEnterWindow" />
<event name="OnEraseBackground"></event> <event name="OnEraseBackground" />
<event name="OnHibernate"></event> <event name="OnHibernate" />
<event name="OnIconize"></event> <event name="OnIconize" />
<event name="OnIdle"></event> <event name="OnIdle" />
<event name="OnInitDialog"></event> <event name="OnInitDialog" />
<event name="OnKeyDown"></event> <event name="OnKeyDown" />
<event name="OnKeyUp"></event> <event name="OnKeyUp" />
<event name="OnKillFocus"></event> <event name="OnKillFocus" />
<event name="OnLeaveWindow"></event> <event name="OnLeaveWindow" />
<event name="OnLeftDClick"></event> <event name="OnLeftDClick" />
<event name="OnLeftDown"></event> <event name="OnLeftDown" />
<event name="OnLeftUp"></event> <event name="OnLeftUp" />
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick" />
<event name="OnMiddleDown"></event> <event name="OnMiddleDown" />
<event name="OnMiddleUp"></event> <event name="OnMiddleUp" />
<event name="OnMotion"></event> <event name="OnMotion" />
<event name="OnMouseEvents"></event> <event name="OnMouseEvents" />
<event name="OnMouseWheel"></event> <event name="OnMouseWheel" />
<event name="OnPaint"></event> <event name="OnPaint" />
<event name="OnRightDClick"></event> <event name="OnRightDClick" />
<event name="OnRightDown"></event> <event name="OnRightDown" />
<event name="OnRightUp"></event> <event name="OnRightUp" />
<event name="OnSetFocus"></event> <event name="OnSetFocus" />
<event name="OnSize"></event> <event name="OnSize" />
<event name="OnUpdateUI"></event> <event name="OnUpdateUI" />
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size" />
<property name="name">bMainSizer</property> <property name="name">bMainSizer</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property> <property name="permission">none</property>
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size" />
<property name="name">bLeftSizer</property> <property name="name">bLeftSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
...@@ -139,11 +139,11 @@ ...@@ -139,11 +139,11 @@
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Pad Filter :</property> <property name="label">Pad Filter :</property>
<property name="minimum_size"></property> <property name="minimum_size" />
<property name="name">sbSizer1</property> <property name="name">sbSizer1</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI" />
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL</property> <property name="flag">wxALL</property>
...@@ -153,83 +153,83 @@ ...@@ -153,83 +153,83 @@
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
<property name="TopDockable">1</property> <property name="TopDockable">1</property>
<property name="aui_name"></property> <property name="aui_name" />
<property name="best_size"></property> <property name="best_size" />
<property name="bg"></property> <property name="bg" />
<property name="caption"></property> <property name="caption" />
<property name="caption_visible">1</property> <property name="caption_visible">1</property>
<property name="center_pane">0</property> <property name="center_pane">0</property>
<property name="checked">0</property> <property name="checked">0</property>
<property name="close_button">1</property> <property name="close_button">1</property>
<property name="context_help"></property> <property name="context_help" />
<property name="context_menu">1</property> <property name="context_menu">1</property>
<property name="default_pane">0</property> <property name="default_pane">0</property>
<property name="dock">Dock</property> <property name="dock">Dock</property>
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg" />
<property name="floatable">1</property> <property name="floatable">1</property>
<property name="font"></property> <property name="font" />
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Do not modify pads having a different shape</property> <property name="label">Do not modify pads having a different shape</property>
<property name="layer"></property> <property name="layer" />
<property name="max_size"></property> <property name="max_size" />
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size" />
<property name="min_size"></property> <property name="min_size" />
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size" />
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_Pad_Shape_Filter_CB</property> <property name="name">m_Pad_Shape_Filter_CB</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
<property name="pane_position"></property> <property name="pane_position" />
<property name="pane_size"></property> <property name="pane_size" />
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pin_button">1</property> <property name="pin_button">1</property>
<property name="pos"></property> <property name="pos" />
<property name="position"></property> <property name="position" />
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="row"></property> <property name="row" />
<property name="show">1</property> <property name="show">1</property>
<property name="size"></property> <property name="size" />
<property name="style"></property> <property name="style" />
<property name="subclass"></property> <property name="subclass" />
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip"></property> <property name="tooltip" />
<property name="validator_data_type"></property> <property name="validator_data_type" />
<property name="validator_style">wxFILTER_NONE</property> <property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property> <property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property> <property name="validator_variable" />
<property name="window_extra_style"></property> <property name="window_extra_style" />
<property name="window_name"></property> <property name="window_name" />
<property name="window_style"></property> <property name="window_style" />
<event name="OnChar"></event> <event name="OnChar" />
<event name="OnCheckBox"></event> <event name="OnCheckBox" />
<event name="OnEnterWindow"></event> <event name="OnEnterWindow" />
<event name="OnEraseBackground"></event> <event name="OnEraseBackground" />
<event name="OnKeyDown"></event> <event name="OnKeyDown" />
<event name="OnKeyUp"></event> <event name="OnKeyUp" />
<event name="OnKillFocus"></event> <event name="OnKillFocus" />
<event name="OnLeaveWindow"></event> <event name="OnLeaveWindow" />
<event name="OnLeftDClick"></event> <event name="OnLeftDClick" />
<event name="OnLeftDown"></event> <event name="OnLeftDown" />
<event name="OnLeftUp"></event> <event name="OnLeftUp" />
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick" />
<event name="OnMiddleDown"></event> <event name="OnMiddleDown" />
<event name="OnMiddleUp"></event> <event name="OnMiddleUp" />
<event name="OnMotion"></event> <event name="OnMotion" />
<event name="OnMouseEvents"></event> <event name="OnMouseEvents" />
<event name="OnMouseWheel"></event> <event name="OnMouseWheel" />
<event name="OnPaint"></event> <event name="OnPaint" />
<event name="OnRightDClick"></event> <event name="OnRightDClick" />
<event name="OnRightDown"></event> <event name="OnRightDown" />
<event name="OnRightUp"></event> <event name="OnRightUp" />
<event name="OnSetFocus"></event> <event name="OnSetFocus" />
<event name="OnSize"></event> <event name="OnSize" />
<event name="OnUpdateUI"></event> <event name="OnUpdateUI" />
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
...@@ -241,83 +241,83 @@ ...@@ -241,83 +241,83 @@
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
<property name="TopDockable">1</property> <property name="TopDockable">1</property>
<property name="aui_name"></property> <property name="aui_name" />
<property name="best_size"></property> <property name="best_size" />
<property name="bg"></property> <property name="bg" />
<property name="caption"></property> <property name="caption" />
<property name="caption_visible">1</property> <property name="caption_visible">1</property>
<property name="center_pane">0</property> <property name="center_pane">0</property>
<property name="checked">0</property> <property name="checked">0</property>
<property name="close_button">1</property> <property name="close_button">1</property>
<property name="context_help"></property> <property name="context_help" />
<property name="context_menu">1</property> <property name="context_menu">1</property>
<property name="default_pane">0</property> <property name="default_pane">0</property>
<property name="dock">Dock</property> <property name="dock">Dock</property>
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg" />
<property name="floatable">1</property> <property name="floatable">1</property>
<property name="font"></property> <property name="font" />
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Do not modify pads having different layers</property> <property name="label">Do not modify pads having different layers</property>
<property name="layer"></property> <property name="layer" />
<property name="max_size"></property> <property name="max_size" />
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size" />
<property name="min_size"></property> <property name="min_size" />
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size" />
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_Pad_Layer_Filter_CB</property> <property name="name">m_Pad_Layer_Filter_CB</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
<property name="pane_position"></property> <property name="pane_position" />
<property name="pane_size"></property> <property name="pane_size" />
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pin_button">1</property> <property name="pin_button">1</property>
<property name="pos"></property> <property name="pos" />
<property name="position"></property> <property name="position" />
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="row"></property> <property name="row" />
<property name="show">1</property> <property name="show">1</property>
<property name="size"></property> <property name="size" />
<property name="style"></property> <property name="style" />
<property name="subclass"></property> <property name="subclass" />
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip"></property> <property name="tooltip" />
<property name="validator_data_type"></property> <property name="validator_data_type" />
<property name="validator_style">wxFILTER_NONE</property> <property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property> <property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property> <property name="validator_variable" />
<property name="window_extra_style"></property> <property name="window_extra_style" />
<property name="window_name"></property> <property name="window_name" />
<property name="window_style"></property> <property name="window_style" />
<event name="OnChar"></event> <event name="OnChar" />
<event name="OnCheckBox"></event> <event name="OnCheckBox" />
<event name="OnEnterWindow"></event> <event name="OnEnterWindow" />
<event name="OnEraseBackground"></event> <event name="OnEraseBackground" />
<event name="OnKeyDown"></event> <event name="OnKeyDown" />
<event name="OnKeyUp"></event> <event name="OnKeyUp" />
<event name="OnKillFocus"></event> <event name="OnKillFocus" />
<event name="OnLeaveWindow"></event> <event name="OnLeaveWindow" />
<event name="OnLeftDClick"></event> <event name="OnLeftDClick" />
<event name="OnLeftDown"></event> <event name="OnLeftDown" />
<event name="OnLeftUp"></event> <event name="OnLeftUp" />
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick" />
<event name="OnMiddleDown"></event> <event name="OnMiddleDown" />
<event name="OnMiddleUp"></event> <event name="OnMiddleUp" />
<event name="OnMotion"></event> <event name="OnMotion" />
<event name="OnMouseEvents"></event> <event name="OnMouseEvents" />
<event name="OnMouseWheel"></event> <event name="OnMouseWheel" />
<event name="OnPaint"></event> <event name="OnPaint" />
<event name="OnRightDClick"></event> <event name="OnRightDClick" />
<event name="OnRightDown"></event> <event name="OnRightDown" />
<event name="OnRightUp"></event> <event name="OnRightUp" />
<event name="OnSetFocus"></event> <event name="OnSetFocus" />
<event name="OnSize"></event> <event name="OnSize" />
<event name="OnUpdateUI"></event> <event name="OnUpdateUI" />
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
...@@ -329,83 +329,83 @@ ...@@ -329,83 +329,83 @@
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
<property name="TopDockable">1</property> <property name="TopDockable">1</property>
<property name="aui_name"></property> <property name="aui_name" />
<property name="best_size"></property> <property name="best_size" />
<property name="bg"></property> <property name="bg" />
<property name="caption"></property> <property name="caption" />
<property name="caption_visible">1</property> <property name="caption_visible">1</property>
<property name="center_pane">0</property> <property name="center_pane">0</property>
<property name="checked">0</property> <property name="checked">0</property>
<property name="close_button">1</property> <property name="close_button">1</property>
<property name="context_help"></property> <property name="context_help" />
<property name="context_menu">1</property> <property name="context_menu">1</property>
<property name="default_pane">0</property> <property name="default_pane">0</property>
<property name="dock">Dock</property> <property name="dock">Dock</property>
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg" />
<property name="floatable">1</property> <property name="floatable">1</property>
<property name="font"></property> <property name="font" />
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Do not modify pads having a different orientation</property> <property name="label">Do not modify pads having a different orientation</property>
<property name="layer"></property> <property name="layer" />
<property name="max_size"></property> <property name="max_size" />
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size" />
<property name="min_size"></property> <property name="min_size" />
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size" />
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_Pad_Orient_Filter_CB</property> <property name="name">m_Pad_Orient_Filter_CB</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
<property name="pane_position"></property> <property name="pane_position" />
<property name="pane_size"></property> <property name="pane_size" />
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pin_button">1</property> <property name="pin_button">1</property>
<property name="pos"></property> <property name="pos" />
<property name="position"></property> <property name="position" />
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="row"></property> <property name="row" />
<property name="show">1</property> <property name="show">1</property>
<property name="size"></property> <property name="size" />
<property name="style"></property> <property name="style" />
<property name="subclass"></property> <property name="subclass" />
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip"></property> <property name="tooltip" />
<property name="validator_data_type"></property> <property name="validator_data_type" />
<property name="validator_style">wxFILTER_NONE</property> <property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property> <property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property> <property name="validator_variable" />
<property name="window_extra_style"></property> <property name="window_extra_style" />
<property name="window_name"></property> <property name="window_name" />
<property name="window_style"></property> <property name="window_style" />
<event name="OnChar"></event> <event name="OnChar" />
<event name="OnCheckBox"></event> <event name="OnCheckBox" />
<event name="OnEnterWindow"></event> <event name="OnEnterWindow" />
<event name="OnEraseBackground"></event> <event name="OnEraseBackground" />
<event name="OnKeyDown"></event> <event name="OnKeyDown" />
<event name="OnKeyUp"></event> <event name="OnKeyUp" />
<event name="OnKillFocus"></event> <event name="OnKillFocus" />
<event name="OnLeaveWindow"></event> <event name="OnLeaveWindow" />
<event name="OnLeftDClick"></event> <event name="OnLeftDClick" />
<event name="OnLeftDown"></event> <event name="OnLeftDown" />
<event name="OnLeftUp"></event> <event name="OnLeftUp" />
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick" />
<event name="OnMiddleDown"></event> <event name="OnMiddleDown" />
<event name="OnMiddleUp"></event> <event name="OnMiddleUp" />
<event name="OnMotion"></event> <event name="OnMotion" />
<event name="OnMouseEvents"></event> <event name="OnMouseEvents" />
<event name="OnMouseWheel"></event> <event name="OnMouseWheel" />
<event name="OnPaint"></event> <event name="OnPaint" />
<event name="OnRightDClick"></event> <event name="OnRightDClick" />
<event name="OnRightDown"></event> <event name="OnRightDown" />
<event name="OnRightUp"></event> <event name="OnRightUp" />
<event name="OnSetFocus"></event> <event name="OnSetFocus" />
<event name="OnSize"></event> <event name="OnSize" />
<event name="OnUpdateUI"></event> <event name="OnUpdateUI" />
</object> </object>
</object> </object>
</object> </object>
...@@ -417,7 +417,7 @@ ...@@ -417,7 +417,7 @@
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size" />
<property name="name">bRightSizer</property> <property name="name">bRightSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
...@@ -430,14 +430,14 @@ ...@@ -430,14 +430,14 @@
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
<property name="TopDockable">1</property> <property name="TopDockable">1</property>
<property name="aui_name"></property> <property name="aui_name" />
<property name="best_size"></property> <property name="best_size" />
<property name="bg"></property> <property name="bg" />
<property name="caption"></property> <property name="caption" />
<property name="caption_visible">1</property> <property name="caption_visible">1</property>
<property name="center_pane">0</property> <property name="center_pane">0</property>
<property name="close_button">1</property> <property name="close_button">1</property>
<property name="context_help"></property> <property name="context_help" />
<property name="context_menu">1</property> <property name="context_menu">1</property>
<property name="default">0</property> <property name="default">0</property>
<property name="default_pane">0</property> <property name="default_pane">0</property>
...@@ -445,73 +445,73 @@ ...@@ -445,73 +445,73 @@
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg" />
<property name="floatable">1</property> <property name="floatable">1</property>
<property name="font"></property> <property name="font" />
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_CHANGE_GET_PAD_SETTINGS</property> <property name="id">ID_CHANGE_GET_PAD_SETTINGS</property>
<property name="label">Pad Editor</property> <property name="label">Pad Editor</property>
<property name="layer"></property> <property name="layer" />
<property name="max_size"></property> <property name="max_size" />
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size" />
<property name="min_size"></property> <property name="min_size" />
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size" />
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_buttonPadEditor</property> <property name="name">m_buttonPadEditor</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
<property name="pane_position"></property> <property name="pane_position" />
<property name="pane_size"></property> <property name="pane_size" />
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pin_button">1</property> <property name="pin_button">1</property>
<property name="pos"></property> <property name="pos" />
<property name="position"></property> <property name="position" />
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="row"></property> <property name="row" />
<property name="show">1</property> <property name="show">1</property>
<property name="size"></property> <property name="size" />
<property name="style"></property> <property name="style" />
<property name="subclass"></property> <property name="subclass" />
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip"></property> <property name="tooltip" />
<property name="validator_data_type"></property> <property name="validator_data_type" />
<property name="validator_style">wxFILTER_NONE</property> <property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property> <property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property> <property name="validator_variable" />
<property name="window_extra_style"></property> <property name="window_extra_style" />
<property name="window_name"></property> <property name="window_name" />
<property name="window_style"></property> <property name="window_style" />
<event name="OnButtonClick">InstallPadEditor</event> <event name="OnButtonClick">InstallPadEditor</event>
<event name="OnChar"></event> <event name="OnChar" />
<event name="OnEnterWindow"></event> <event name="OnEnterWindow" />
<event name="OnEraseBackground"></event> <event name="OnEraseBackground" />
<event name="OnKeyDown"></event> <event name="OnKeyDown" />
<event name="OnKeyUp"></event> <event name="OnKeyUp" />
<event name="OnKillFocus"></event> <event name="OnKillFocus" />
<event name="OnLeaveWindow"></event> <event name="OnLeaveWindow" />
<event name="OnLeftDClick"></event> <event name="OnLeftDClick" />
<event name="OnLeftDown"></event> <event name="OnLeftDown" />
<event name="OnLeftUp"></event> <event name="OnLeftUp" />
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick" />
<event name="OnMiddleDown"></event> <event name="OnMiddleDown" />
<event name="OnMiddleUp"></event> <event name="OnMiddleUp" />
<event name="OnMotion"></event> <event name="OnMotion" />
<event name="OnMouseEvents"></event> <event name="OnMouseEvents" />
<event name="OnMouseWheel"></event> <event name="OnMouseWheel" />
<event name="OnPaint"></event> <event name="OnPaint" />
<event name="OnRightDClick"></event> <event name="OnRightDClick" />
<event name="OnRightDown"></event> <event name="OnRightDown" />
<event name="OnRightUp"></event> <event name="OnRightUp" />
<event name="OnSetFocus"></event> <event name="OnSetFocus" />
<event name="OnSize"></event> <event name="OnSize" />
<event name="OnUpdateUI"></event> <event name="OnUpdateUI" />
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag"></property> <property name="flag" />
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="spacer" expanded="1"> <object class="spacer" expanded="1">
<property name="height">10</property> <property name="height">10</property>
...@@ -528,14 +528,14 @@ ...@@ -528,14 +528,14 @@
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
<property name="TopDockable">1</property> <property name="TopDockable">1</property>
<property name="aui_name"></property> <property name="aui_name" />
<property name="best_size"></property> <property name="best_size" />
<property name="bg"></property> <property name="bg" />
<property name="caption"></property> <property name="caption" />
<property name="caption_visible">1</property> <property name="caption_visible">1</property>
<property name="center_pane">0</property> <property name="center_pane">0</property>
<property name="close_button">1</property> <property name="close_button">1</property>
<property name="context_help"></property> <property name="context_help" />
<property name="context_menu">1</property> <property name="context_menu">1</property>
<property name="default">0</property> <property name="default">0</property>
<property name="default_pane">0</property> <property name="default_pane">0</property>
...@@ -543,68 +543,68 @@ ...@@ -543,68 +543,68 @@
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg" />
<property name="floatable">1</property> <property name="floatable">1</property>
<property name="font"></property> <property name="font" />
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_CHANGE_CURRENT_MODULE</property> <property name="id">ID_CHANGE_CURRENT_MODULE</property>
<property name="label">Change Pads on Module</property> <property name="label">Change Pads on Module</property>
<property name="layer"></property> <property name="layer" />
<property name="max_size"></property> <property name="max_size" />
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size" />
<property name="min_size"></property> <property name="min_size" />
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size" />
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_buttonChangeModule</property> <property name="name">m_buttonChangeModule</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
<property name="pane_position"></property> <property name="pane_position" />
<property name="pane_size"></property> <property name="pane_size" />
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pin_button">1</property> <property name="pin_button">1</property>
<property name="pos"></property> <property name="pos" />
<property name="position"></property> <property name="position" />
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="row"></property> <property name="row" />
<property name="show">1</property> <property name="show">1</property>
<property name="size"></property> <property name="size" />
<property name="style"></property> <property name="style" />
<property name="subclass"></property> <property name="subclass" />
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip"></property> <property name="tooltip" />
<property name="validator_data_type"></property> <property name="validator_data_type" />
<property name="validator_style">wxFILTER_NONE</property> <property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property> <property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property> <property name="validator_variable" />
<property name="window_extra_style"></property> <property name="window_extra_style" />
<property name="window_name"></property> <property name="window_name" />
<property name="window_style"></property> <property name="window_style" />
<event name="OnButtonClick">PadPropertiesAccept</event> <event name="OnButtonClick">PadPropertiesAccept</event>
<event name="OnChar"></event> <event name="OnChar" />
<event name="OnEnterWindow"></event> <event name="OnEnterWindow" />
<event name="OnEraseBackground"></event> <event name="OnEraseBackground" />
<event name="OnKeyDown"></event> <event name="OnKeyDown" />
<event name="OnKeyUp"></event> <event name="OnKeyUp" />
<event name="OnKillFocus"></event> <event name="OnKillFocus" />
<event name="OnLeaveWindow"></event> <event name="OnLeaveWindow" />
<event name="OnLeftDClick"></event> <event name="OnLeftDClick" />
<event name="OnLeftDown"></event> <event name="OnLeftDown" />
<event name="OnLeftUp"></event> <event name="OnLeftUp" />
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick" />
<event name="OnMiddleDown"></event> <event name="OnMiddleDown" />
<event name="OnMiddleUp"></event> <event name="OnMiddleUp" />
<event name="OnMotion"></event> <event name="OnMotion" />
<event name="OnMouseEvents"></event> <event name="OnMouseEvents" />
<event name="OnMouseWheel"></event> <event name="OnMouseWheel" />
<event name="OnPaint"></event> <event name="OnPaint" />
<event name="OnRightDClick"></event> <event name="OnRightDClick" />
<event name="OnRightDown"></event> <event name="OnRightDown" />
<event name="OnRightUp"></event> <event name="OnRightUp" />
<event name="OnSetFocus"></event> <event name="OnSetFocus" />
<event name="OnSize"></event> <event name="OnSize" />
<event name="OnUpdateUI"></event> <event name="OnUpdateUI" />
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
...@@ -616,14 +616,14 @@ ...@@ -616,14 +616,14 @@
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
<property name="TopDockable">1</property> <property name="TopDockable">1</property>
<property name="aui_name"></property> <property name="aui_name" />
<property name="best_size"></property> <property name="best_size" />
<property name="bg"></property> <property name="bg" />
<property name="caption"></property> <property name="caption" />
<property name="caption_visible">1</property> <property name="caption_visible">1</property>
<property name="center_pane">0</property> <property name="center_pane">0</property>
<property name="close_button">1</property> <property name="close_button">1</property>
<property name="context_help"></property> <property name="context_help" />
<property name="context_menu">1</property> <property name="context_menu">1</property>
<property name="default">0</property> <property name="default">0</property>
<property name="default_pane">0</property> <property name="default_pane">0</property>
...@@ -631,68 +631,68 @@ ...@@ -631,68 +631,68 @@
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg" />
<property name="floatable">1</property> <property name="floatable">1</property>
<property name="font"></property> <property name="font" />
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_CHANGE_ID_MODULES</property> <property name="id">ID_CHANGE_ID_MODULES</property>
<property name="label">Change Pads on Same Modules</property> <property name="label">Change Pads on Same Modules</property>
<property name="layer"></property> <property name="layer" />
<property name="max_size"></property> <property name="max_size" />
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size" />
<property name="min_size"></property> <property name="min_size" />
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size" />
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_buttonIdModules</property> <property name="name">m_buttonIdModules</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
<property name="pane_position"></property> <property name="pane_position" />
<property name="pane_size"></property> <property name="pane_size" />
<property name="permission">public</property> <property name="permission">public</property>
<property name="pin_button">1</property> <property name="pin_button">1</property>
<property name="pos"></property> <property name="pos" />
<property name="position"></property> <property name="position" />
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="row"></property> <property name="row" />
<property name="show">1</property> <property name="show">1</property>
<property name="size"></property> <property name="size" />
<property name="style"></property> <property name="style" />
<property name="subclass"></property> <property name="subclass" />
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip"></property> <property name="tooltip" />
<property name="validator_data_type"></property> <property name="validator_data_type" />
<property name="validator_style">wxFILTER_NONE</property> <property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property> <property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property> <property name="validator_variable" />
<property name="window_extra_style"></property> <property name="window_extra_style" />
<property name="window_name"></property> <property name="window_name" />
<property name="window_style"></property> <property name="window_style" />
<event name="OnButtonClick">PadPropertiesAccept</event> <event name="OnButtonClick">PadPropertiesAccept</event>
<event name="OnChar"></event> <event name="OnChar" />
<event name="OnEnterWindow"></event> <event name="OnEnterWindow" />
<event name="OnEraseBackground"></event> <event name="OnEraseBackground" />
<event name="OnKeyDown"></event> <event name="OnKeyDown" />
<event name="OnKeyUp"></event> <event name="OnKeyUp" />
<event name="OnKillFocus"></event> <event name="OnKillFocus" />
<event name="OnLeaveWindow"></event> <event name="OnLeaveWindow" />
<event name="OnLeftDClick"></event> <event name="OnLeftDClick" />
<event name="OnLeftDown"></event> <event name="OnLeftDown" />
<event name="OnLeftUp"></event> <event name="OnLeftUp" />
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick" />
<event name="OnMiddleDown"></event> <event name="OnMiddleDown" />
<event name="OnMiddleUp"></event> <event name="OnMiddleUp" />
<event name="OnMotion"></event> <event name="OnMotion" />
<event name="OnMouseEvents"></event> <event name="OnMouseEvents" />
<event name="OnMouseWheel"></event> <event name="OnMouseWheel" />
<event name="OnPaint"></event> <event name="OnPaint" />
<event name="OnRightDClick"></event> <event name="OnRightDClick" />
<event name="OnRightDown"></event> <event name="OnRightDown" />
<event name="OnRightUp"></event> <event name="OnRightUp" />
<event name="OnSetFocus"></event> <event name="OnSetFocus" />
<event name="OnSize"></event> <event name="OnSize" />
<event name="OnUpdateUI"></event> <event name="OnUpdateUI" />
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
...@@ -704,14 +704,14 @@ ...@@ -704,14 +704,14 @@
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
<property name="TopDockable">1</property> <property name="TopDockable">1</property>
<property name="aui_name"></property> <property name="aui_name" />
<property name="best_size"></property> <property name="best_size" />
<property name="bg"></property> <property name="bg" />
<property name="caption"></property> <property name="caption" />
<property name="caption_visible">1</property> <property name="caption_visible">1</property>
<property name="center_pane">0</property> <property name="center_pane">0</property>
<property name="close_button">1</property> <property name="close_button">1</property>
<property name="context_help"></property> <property name="context_help" />
<property name="context_menu">1</property> <property name="context_menu">1</property>
<property name="default">0</property> <property name="default">0</property>
<property name="default_pane">0</property> <property name="default_pane">0</property>
...@@ -719,68 +719,68 @@ ...@@ -719,68 +719,68 @@
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg" />
<property name="floatable">1</property> <property name="floatable">1</property>
<property name="font"></property> <property name="font" />
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Cancel</property> <property name="label">Cancel</property>
<property name="layer"></property> <property name="layer" />
<property name="max_size"></property> <property name="max_size" />
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size" />
<property name="min_size"></property> <property name="min_size" />
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size" />
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_buttonCancel</property> <property name="name">m_buttonCancel</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
<property name="pane_position"></property> <property name="pane_position" />
<property name="pane_size"></property> <property name="pane_size" />
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pin_button">1</property> <property name="pin_button">1</property>
<property name="pos"></property> <property name="pos" />
<property name="position"></property> <property name="position" />
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="row"></property> <property name="row" />
<property name="show">1</property> <property name="show">1</property>
<property name="size"></property> <property name="size" />
<property name="style"></property> <property name="style" />
<property name="subclass"></property> <property name="subclass" />
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip"></property> <property name="tooltip" />
<property name="validator_data_type"></property> <property name="validator_data_type" />
<property name="validator_style">wxFILTER_NONE</property> <property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property> <property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property> <property name="validator_variable" />
<property name="window_extra_style"></property> <property name="window_extra_style" />
<property name="window_name"></property> <property name="window_name" />
<property name="window_style"></property> <property name="window_style" />
<event name="OnButtonClick">OnCancelClick</event> <event name="OnButtonClick">OnCancelClick</event>
<event name="OnChar"></event> <event name="OnChar" />
<event name="OnEnterWindow"></event> <event name="OnEnterWindow" />
<event name="OnEraseBackground"></event> <event name="OnEraseBackground" />
<event name="OnKeyDown"></event> <event name="OnKeyDown" />
<event name="OnKeyUp"></event> <event name="OnKeyUp" />
<event name="OnKillFocus"></event> <event name="OnKillFocus" />
<event name="OnLeaveWindow"></event> <event name="OnLeaveWindow" />
<event name="OnLeftDClick"></event> <event name="OnLeftDClick" />
<event name="OnLeftDown"></event> <event name="OnLeftDown" />
<event name="OnLeftUp"></event> <event name="OnLeftUp" />
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick" />
<event name="OnMiddleDown"></event> <event name="OnMiddleDown" />
<event name="OnMiddleUp"></event> <event name="OnMiddleUp" />
<event name="OnMotion"></event> <event name="OnMotion" />
<event name="OnMouseEvents"></event> <event name="OnMouseEvents" />
<event name="OnMouseWheel"></event> <event name="OnMouseWheel" />
<event name="OnPaint"></event> <event name="OnPaint" />
<event name="OnRightDClick"></event> <event name="OnRightDClick" />
<event name="OnRightDown"></event> <event name="OnRightDown" />
<event name="OnRightUp"></event> <event name="OnRightUp" />
<event name="OnSetFocus"></event> <event name="OnSetFocus" />
<event name="OnSize"></event> <event name="OnSize" />
<event name="OnUpdateUI"></event> <event name="OnUpdateUI" />
</object> </object>
</object> </object>
</object> </object>
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Apr 11 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE( DialogNonCopperZonesPropertiesBase, wxDialog ) BEGIN_EVENT_TABLE( DialogNonCopperZonesPropertiesBase, DIALOG_SHIM )
EVT_BUTTON( wxID_OK, DialogNonCopperZonesPropertiesBase::_wxFB_OnOkClick ) EVT_BUTTON( wxID_OK, DialogNonCopperZonesPropertiesBase::_wxFB_OnOkClick )
EVT_BUTTON( wxID_CANCEL, DialogNonCopperZonesPropertiesBase::_wxFB_OnCancelClick ) EVT_BUTTON( wxID_CANCEL, DialogNonCopperZonesPropertiesBase::_wxFB_OnCancelClick )
END_EVENT_TABLE() END_EVENT_TABLE()
DialogNonCopperZonesPropertiesBase::DialogNonCopperZonesPropertiesBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) DialogNonCopperZonesPropertiesBase::DialogNonCopperZonesPropertiesBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{ {
this->SetSizeHints( wxDefaultSize, wxDefaultSize ); this->SetSizeHints( wxDefaultSize, wxDefaultSize );
...@@ -40,6 +40,7 @@ DialogNonCopperZonesPropertiesBase::DialogNonCopperZonesPropertiesBase( wxWindow ...@@ -40,6 +40,7 @@ DialogNonCopperZonesPropertiesBase::DialogNonCopperZonesPropertiesBase( wxWindow
m_ZoneMinThicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_ZoneMinThicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbLeftSizer_->Add( m_ZoneMinThicknessCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); sbLeftSizer_->Add( m_ZoneMinThicknessCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_UpperSizer->Add( sbLeftSizer_, 0, 0, 5 ); m_UpperSizer->Add( sbLeftSizer_, 0, 0, 5 );
wxStaticBoxSizer* m_OutilinesBoxOpt; wxStaticBoxSizer* m_OutilinesBoxOpt;
...@@ -57,6 +58,7 @@ DialogNonCopperZonesPropertiesBase::DialogNonCopperZonesPropertiesBase( wxWindow ...@@ -57,6 +58,7 @@ DialogNonCopperZonesPropertiesBase::DialogNonCopperZonesPropertiesBase( wxWindow
m_OutlineAppearanceCtrl->SetSelection( 1 ); m_OutlineAppearanceCtrl->SetSelection( 1 );
m_OutilinesBoxOpt->Add( m_OutlineAppearanceCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); m_OutilinesBoxOpt->Add( m_OutlineAppearanceCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_UpperSizer->Add( m_OutilinesBoxOpt, 0, 0, 5 ); m_UpperSizer->Add( m_OutilinesBoxOpt, 0, 0, 5 );
wxBoxSizer* m_ButtonsSizer; wxBoxSizer* m_ButtonsSizer;
...@@ -69,8 +71,10 @@ DialogNonCopperZonesPropertiesBase::DialogNonCopperZonesPropertiesBase( wxWindow ...@@ -69,8 +71,10 @@ DialogNonCopperZonesPropertiesBase::DialogNonCopperZonesPropertiesBase( wxWindow
m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
m_ButtonsSizer->Add( m_buttonCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_ButtonsSizer->Add( m_buttonCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_UpperSizer->Add( m_ButtonsSizer, 1, wxALIGN_CENTER_VERTICAL, 5 ); m_UpperSizer->Add( m_ButtonsSizer, 1, wxALIGN_CENTER_VERTICAL, 5 );
m_MainSizer->Add( m_UpperSizer, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); m_MainSizer->Add( m_UpperSizer, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 );
m_staticTextLayerSelection = new wxStaticText( this, wxID_ANY, _("Layer selection:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextLayerSelection = new wxStaticText( this, wxID_ANY, _("Layer selection:"), wxDefaultPosition, wxDefaultSize, 0 );
...@@ -80,6 +84,7 @@ DialogNonCopperZonesPropertiesBase::DialogNonCopperZonesPropertiesBase( wxWindow ...@@ -80,6 +84,7 @@ DialogNonCopperZonesPropertiesBase::DialogNonCopperZonesPropertiesBase( wxWindow
m_LayerSelectionCtrl = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); m_LayerSelectionCtrl = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_MainSizer->Add( m_LayerSelectionCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_MainSizer->Add( m_LayerSelectionCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
this->SetSizer( m_MainSizer ); this->SetSizer( m_MainSizer );
this->Layout(); this->Layout();
......
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project> <wxFormBuilder_Project>
<FileVersion major="1" minor="10" /> <FileVersion major="1" minor="11" />
<object class="Project" expanded="1"> <object class="Project" expanded="1">
<property name="class_decoration" /> <property name="class_decoration"></property>
<property name="code_generation">C++</property> <property name="code_generation">C++</property>
<property name="disconnect_events">1</property> <property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property> <property name="encoding">UTF-8</property>
<property name="event_generation">table</property> <property name="event_generation">table</property>
<property name="file">dialog_non_copper_zones_properties_base</property> <property name="file">dialog_non_copper_zones_properties_base</property>
...@@ -12,66 +16,78 @@ ...@@ -12,66 +16,78 @@
<property name="help_provider">none</property> <property name="help_provider">none</property>
<property name="internationalize">1</property> <property name="internationalize">1</property>
<property name="name">dialog_non_copper_zones_properties_base</property> <property name="name">dialog_non_copper_zones_properties_base</property>
<property name="namespace" /> <property name="namespace"></property>
<property name="path">.</property> <property name="path">.</property>
<property name="precompiled_header" /> <property name="precompiled_header"></property>
<property name="relative_path">1</property> <property name="relative_path">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="use_enum">1</property> <property name="use_enum">1</property>
<property name="use_microsoft_bom">0</property> <property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1"> <object class="Dialog" expanded="1">
<property name="bg" /> <property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="center">wxBOTH</property> <property name="center">wxBOTH</property>
<property name="context_help" /> <property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="extra_style" /> <property name="event_handler">impl_virtual</property>
<property name="fg" /> <property name="extra_style"></property>
<property name="font" /> <property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="maximum_size" /> <property name="maximum_size"></property>
<property name="minimum_size" /> <property name="minimum_size"></property>
<property name="name">DialogNonCopperZonesPropertiesBase</property> <property name="name">DialogNonCopperZonesPropertiesBase</property>
<property name="pos" /> <property name="pos"></property>
<property name="size">416,287</property> <property name="size">416,287</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property> <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass" /> <property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Non Copper Zones Properties</property> <property name="title">Non Copper Zones Properties</property>
<property name="tooltip" /> <property name="tooltip"></property>
<property name="window_extra_style" /> <property name="window_extra_style"></property>
<property name="window_name" /> <property name="window_name"></property>
<property name="window_style">wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER</property> <property name="window_style">wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER</property>
<event name="OnActivate" /> <event name="OnActivate"></event>
<event name="OnActivateApp" /> <event name="OnActivateApp"></event>
<event name="OnChar" /> <event name="OnAuiFindManager"></event>
<event name="OnClose" /> <event name="OnAuiPaneButton"></event>
<event name="OnEnterWindow" /> <event name="OnAuiPaneClose"></event>
<event name="OnEraseBackground" /> <event name="OnAuiPaneMaximize"></event>
<event name="OnHibernate" /> <event name="OnAuiPaneRestore"></event>
<event name="OnIconize" /> <event name="OnAuiRender"></event>
<event name="OnIdle" /> <event name="OnChar"></event>
<event name="OnInitDialog" /> <event name="OnClose"></event>
<event name="OnKeyDown" /> <event name="OnEnterWindow"></event>
<event name="OnKeyUp" /> <event name="OnEraseBackground"></event>
<event name="OnKillFocus" /> <event name="OnHibernate"></event>
<event name="OnLeaveWindow" /> <event name="OnIconize"></event>
<event name="OnLeftDClick" /> <event name="OnIdle"></event>
<event name="OnLeftDown" /> <event name="OnInitDialog"></event>
<event name="OnLeftUp" /> <event name="OnKeyDown"></event>
<event name="OnMiddleDClick" /> <event name="OnKeyUp"></event>
<event name="OnMiddleDown" /> <event name="OnKillFocus"></event>
<event name="OnMiddleUp" /> <event name="OnLeaveWindow"></event>
<event name="OnMotion" /> <event name="OnLeftDClick"></event>
<event name="OnMouseEvents" /> <event name="OnLeftDown"></event>
<event name="OnMouseWheel" /> <event name="OnLeftUp"></event>
<event name="OnPaint" /> <event name="OnMiddleDClick"></event>
<event name="OnRightDClick" /> <event name="OnMiddleDown"></event>
<event name="OnRightDown" /> <event name="OnMiddleUp"></event>
<event name="OnRightUp" /> <event name="OnMotion"></event>
<event name="OnSetFocus" /> <event name="OnMouseEvents"></event>
<event name="OnSize" /> <event name="OnMouseWheel"></event>
<event name="OnUpdateUI" /> <event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size" /> <property name="minimum_size"></property>
<property name="name">m_MainSizer</property> <property name="name">m_MainSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
...@@ -80,74 +96,110 @@ ...@@ -80,74 +96,110 @@
<property name="flag">wxEXPAND|wxALIGN_CENTER_HORIZONTAL</property> <property name="flag">wxEXPAND|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size" /> <property name="minimum_size"></property>
<property name="name">m_UpperSizer</property> <property name="name">m_UpperSizer</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag" /> <property name="flag"></property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Zone Fill Options:</property> <property name="label">Zone Fill Options:</property>
<property name="minimum_size" /> <property name="minimum_size"></property>
<property name="name">sbLeftSizer_</property> <property name="name">sbLeftSizer_</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<event name="OnUpdateUI" /> <event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxRadioBox" expanded="1"> <object class="wxRadioBox" expanded="1">
<property name="bg" /> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;Use polygons&quot; &quot;Use segments&quot;</property> <property name="choices">&quot;Use polygons&quot; &quot;Use segments&quot;</property>
<property name="context_help" /> <property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg" /> <property name="fg"></property>
<property name="font" /> <property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Filling Mode:</property> <property name="label">Filling Mode:</property>
<property name="majorDimension">1</property> <property name="majorDimension">1</property>
<property name="maximum_size" /> <property name="max_size"></property>
<property name="minimum_size" /> <property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_FillModeCtrl</property> <property name="name">m_FillModeCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos" /> <property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property> <property name="selection">0</property>
<property name="size" /> <property name="show">1</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property> <property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass" /> <property name="subclass"></property>
<property name="tooltip" /> <property name="toolbar_pane">0</property>
<property name="window_extra_style" /> <property name="tooltip"></property>
<property name="window_name" /> <property name="validator_data_type"></property>
<property name="window_style" /> <property name="validator_style">wxFILTER_NONE</property>
<event name="OnChar" /> <property name="validator_type">wxDefaultValidator</property>
<event name="OnEnterWindow" /> <property name="validator_variable"></property>
<event name="OnEraseBackground" /> <property name="window_extra_style"></property>
<event name="OnKeyDown" /> <property name="window_name"></property>
<event name="OnKeyUp" /> <property name="window_style"></property>
<event name="OnKillFocus" /> <event name="OnChar"></event>
<event name="OnLeaveWindow" /> <event name="OnEnterWindow"></event>
<event name="OnLeftDClick" /> <event name="OnEraseBackground"></event>
<event name="OnLeftDown" /> <event name="OnKeyDown"></event>
<event name="OnLeftUp" /> <event name="OnKeyUp"></event>
<event name="OnMiddleDClick" /> <event name="OnKillFocus"></event>
<event name="OnMiddleDown" /> <event name="OnLeaveWindow"></event>
<event name="OnMiddleUp" /> <event name="OnLeftDClick"></event>
<event name="OnMotion" /> <event name="OnLeftDown"></event>
<event name="OnMouseEvents" /> <event name="OnLeftUp"></event>
<event name="OnMouseWheel" /> <event name="OnMiddleDClick"></event>
<event name="OnPaint" /> <event name="OnMiddleDown"></event>
<event name="OnRadioBox" /> <event name="OnMiddleUp"></event>
<event name="OnRightDClick" /> <event name="OnMotion"></event>
<event name="OnRightDown" /> <event name="OnMouseEvents"></event>
<event name="OnRightUp" /> <event name="OnMouseWheel"></event>
<event name="OnSetFocus" /> <event name="OnPaint"></event>
<event name="OnSize" /> <event name="OnRadioBox"></event>
<event name="OnUpdateUI" /> <event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
...@@ -155,50 +207,82 @@ ...@@ -155,50 +207,82 @@
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property> <property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="1">
<property name="bg" /> <property name="BottomDockable">1</property>
<property name="context_help" /> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg" /> <property name="fg"></property>
<property name="font" /> <property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Zone min thickness value</property> <property name="label">Zone min thickness value</property>
<property name="maximum_size" /> <property name="max_size"></property>
<property name="minimum_size" /> <property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_MinThicknessValueTitle</property> <property name="name">m_MinThicknessValueTitle</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos" /> <property name="pin_button">1</property>
<property name="size" /> <property name="pos"></property>
<property name="style" /> <property name="resize">Resizable</property>
<property name="subclass" /> <property name="show">1</property>
<property name="tooltip" /> <property name="size"></property>
<property name="window_extra_style" /> <property name="style"></property>
<property name="window_name" /> <property name="subclass"></property>
<property name="window_style" /> <property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property> <property name="wrap">-1</property>
<event name="OnChar" /> <event name="OnChar"></event>
<event name="OnEnterWindow" /> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground" /> <event name="OnEraseBackground"></event>
<event name="OnKeyDown" /> <event name="OnKeyDown"></event>
<event name="OnKeyUp" /> <event name="OnKeyUp"></event>
<event name="OnKillFocus" /> <event name="OnKillFocus"></event>
<event name="OnLeaveWindow" /> <event name="OnLeaveWindow"></event>
<event name="OnLeftDClick" /> <event name="OnLeftDClick"></event>
<event name="OnLeftDown" /> <event name="OnLeftDown"></event>
<event name="OnLeftUp" /> <event name="OnLeftUp"></event>
<event name="OnMiddleDClick" /> <event name="OnMiddleDClick"></event>
<event name="OnMiddleDown" /> <event name="OnMiddleDown"></event>
<event name="OnMiddleUp" /> <event name="OnMiddleUp"></event>
<event name="OnMotion" /> <event name="OnMotion"></event>
<event name="OnMouseEvents" /> <event name="OnMouseEvents"></event>
<event name="OnMouseWheel" /> <event name="OnMouseWheel"></event>
<event name="OnPaint" /> <event name="OnPaint"></event>
<event name="OnRightDClick" /> <event name="OnRightDClick"></event>
<event name="OnRightDown" /> <event name="OnRightDown"></event>
<event name="OnRightUp" /> <event name="OnRightUp"></event>
<event name="OnSetFocus" /> <event name="OnSetFocus"></event>
<event name="OnSize" /> <event name="OnSize"></event>
<event name="OnUpdateUI" /> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
...@@ -206,122 +290,194 @@ ...@@ -206,122 +290,194 @@
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property> <property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1"> <object class="wxTextCtrl" expanded="1">
<property name="bg" /> <property name="BottomDockable">1</property>
<property name="context_help" /> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg" /> <property name="fg"></property>
<property name="font" /> <property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="maximum_size" /> <property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength">0</property>
<property name="minimum_size" /> <property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_ZoneMinThicknessCtrl</property> <property name="name">m_ZoneMinThicknessCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos" /> <property name="pin_button">1</property>
<property name="size" /> <property name="pos"></property>
<property name="style" /> <property name="resize">Resizable</property>
<property name="subclass" /> <property name="show">1</property>
<property name="tooltip" /> <property name="size"></property>
<property name="value" /> <property name="style"></property>
<property name="window_extra_style" /> <property name="subclass"></property>
<property name="window_name" /> <property name="toolbar_pane">0</property>
<property name="window_style" /> <property name="tooltip"></property>
<event name="OnChar" /> <property name="validator_data_type"></property>
<event name="OnEnterWindow" /> <property name="validator_style">wxFILTER_NONE</property>
<event name="OnEraseBackground" /> <property name="validator_type">wxDefaultValidator</property>
<event name="OnKeyDown" /> <property name="validator_variable"></property>
<event name="OnKeyUp" /> <property name="value"></property>
<event name="OnKillFocus" /> <property name="window_extra_style"></property>
<event name="OnLeaveWindow" /> <property name="window_name"></property>
<event name="OnLeftDClick" /> <property name="window_style"></property>
<event name="OnLeftDown" /> <event name="OnChar"></event>
<event name="OnLeftUp" /> <event name="OnEnterWindow"></event>
<event name="OnMiddleDClick" /> <event name="OnEraseBackground"></event>
<event name="OnMiddleDown" /> <event name="OnKeyDown"></event>
<event name="OnMiddleUp" /> <event name="OnKeyUp"></event>
<event name="OnMotion" /> <event name="OnKillFocus"></event>
<event name="OnMouseEvents" /> <event name="OnLeaveWindow"></event>
<event name="OnMouseWheel" /> <event name="OnLeftDClick"></event>
<event name="OnPaint" /> <event name="OnLeftDown"></event>
<event name="OnRightDClick" /> <event name="OnLeftUp"></event>
<event name="OnRightDown" /> <event name="OnMiddleDClick"></event>
<event name="OnRightUp" /> <event name="OnMiddleDown"></event>
<event name="OnSetFocus" /> <event name="OnMiddleUp"></event>
<event name="OnSize" /> <event name="OnMotion"></event>
<event name="OnText" /> <event name="OnMouseEvents"></event>
<event name="OnTextEnter" /> <event name="OnMouseWheel"></event>
<event name="OnTextMaxLen" /> <event name="OnPaint"></event>
<event name="OnTextURL" /> <event name="OnRightDClick"></event>
<event name="OnUpdateUI" /> <event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag" /> <property name="flag"></property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Outlines Options:</property> <property name="label">Outlines Options:</property>
<property name="minimum_size" /> <property name="minimum_size"></property>
<property name="name">m_OutilinesBoxOpt</property> <property name="name">m_OutilinesBoxOpt</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<event name="OnUpdateUI" /> <event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property> <property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxRadioBox" expanded="1"> <object class="wxRadioBox" expanded="1">
<property name="bg" /> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;Any&quot; &quot;H, V and 45 deg&quot;</property> <property name="choices">&quot;Any&quot; &quot;H, V and 45 deg&quot;</property>
<property name="context_help" /> <property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg" /> <property name="fg"></property>
<property name="font" /> <property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Zone Edges Orient</property> <property name="label">Zone Edges Orient</property>
<property name="majorDimension">1</property> <property name="majorDimension">1</property>
<property name="maximum_size" /> <property name="max_size"></property>
<property name="minimum_size" /> <property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_OrientEdgesOpt</property> <property name="name">m_OrientEdgesOpt</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos" /> <property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property> <property name="selection">0</property>
<property name="size" /> <property name="show">1</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property> <property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass" /> <property name="subclass"></property>
<property name="tooltip" /> <property name="toolbar_pane">0</property>
<property name="window_extra_style" /> <property name="tooltip"></property>
<property name="window_name" /> <property name="validator_data_type"></property>
<property name="window_style" /> <property name="validator_style">wxFILTER_NONE</property>
<event name="OnChar" /> <property name="validator_type">wxDefaultValidator</property>
<event name="OnEnterWindow" /> <property name="validator_variable"></property>
<event name="OnEraseBackground" /> <property name="window_extra_style"></property>
<event name="OnKeyDown" /> <property name="window_name"></property>
<event name="OnKeyUp" /> <property name="window_style"></property>
<event name="OnKillFocus" /> <event name="OnChar"></event>
<event name="OnLeaveWindow" /> <event name="OnEnterWindow"></event>
<event name="OnLeftDClick" /> <event name="OnEraseBackground"></event>
<event name="OnLeftDown" /> <event name="OnKeyDown"></event>
<event name="OnLeftUp" /> <event name="OnKeyUp"></event>
<event name="OnMiddleDClick" /> <event name="OnKillFocus"></event>
<event name="OnMiddleDown" /> <event name="OnLeaveWindow"></event>
<event name="OnMiddleUp" /> <event name="OnLeftDClick"></event>
<event name="OnMotion" /> <event name="OnLeftDown"></event>
<event name="OnMouseEvents" /> <event name="OnLeftUp"></event>
<event name="OnMouseWheel" /> <event name="OnMiddleDClick"></event>
<event name="OnPaint" /> <event name="OnMiddleDown"></event>
<event name="OnRadioBox" /> <event name="OnMiddleUp"></event>
<event name="OnRightDClick" /> <event name="OnMotion"></event>
<event name="OnRightDown" /> <event name="OnMouseEvents"></event>
<event name="OnRightUp" /> <event name="OnMouseWheel"></event>
<event name="OnSetFocus" /> <event name="OnPaint"></event>
<event name="OnSize" /> <event name="OnRadioBox"></event>
<event name="OnUpdateUI" /> <event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
...@@ -329,53 +485,89 @@ ...@@ -329,53 +485,89 @@
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property> <property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxRadioBox" expanded="1"> <object class="wxRadioBox" expanded="1">
<property name="bg" /> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;Line&quot; &quot;Hatched Outline&quot; &quot;Full Hatched&quot;</property> <property name="choices">&quot;Line&quot; &quot;Hatched Outline&quot; &quot;Full Hatched&quot;</property>
<property name="context_help" /> <property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg" /> <property name="fg"></property>
<property name="font" /> <property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Outlines Appearence</property> <property name="label">Outlines Appearence</property>
<property name="majorDimension">1</property> <property name="majorDimension">1</property>
<property name="maximum_size" /> <property name="max_size"></property>
<property name="minimum_size" /> <property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_OutlineAppearanceCtrl</property> <property name="name">m_OutlineAppearanceCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos" /> <property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">1</property> <property name="selection">1</property>
<property name="size" /> <property name="show">1</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property> <property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass" /> <property name="subclass"></property>
<property name="tooltip" /> <property name="toolbar_pane">0</property>
<property name="window_extra_style" /> <property name="tooltip"></property>
<property name="window_name" /> <property name="validator_data_type"></property>
<property name="window_style" /> <property name="validator_style">wxFILTER_NONE</property>
<event name="OnChar" /> <property name="validator_type">wxDefaultValidator</property>
<event name="OnEnterWindow" /> <property name="validator_variable"></property>
<event name="OnEraseBackground" /> <property name="window_extra_style"></property>
<event name="OnKeyDown" /> <property name="window_name"></property>
<event name="OnKeyUp" /> <property name="window_style"></property>
<event name="OnKillFocus" /> <event name="OnChar"></event>
<event name="OnLeaveWindow" /> <event name="OnEnterWindow"></event>
<event name="OnLeftDClick" /> <event name="OnEraseBackground"></event>
<event name="OnLeftDown" /> <event name="OnKeyDown"></event>
<event name="OnLeftUp" /> <event name="OnKeyUp"></event>
<event name="OnMiddleDClick" /> <event name="OnKillFocus"></event>
<event name="OnMiddleDown" /> <event name="OnLeaveWindow"></event>
<event name="OnMiddleUp" /> <event name="OnLeftDClick"></event>
<event name="OnMotion" /> <event name="OnLeftDown"></event>
<event name="OnMouseEvents" /> <event name="OnLeftUp"></event>
<event name="OnMouseWheel" /> <event name="OnMiddleDClick"></event>
<event name="OnPaint" /> <event name="OnMiddleDown"></event>
<event name="OnRadioBox" /> <event name="OnMiddleUp"></event>
<event name="OnRightDClick" /> <event name="OnMotion"></event>
<event name="OnRightDown" /> <event name="OnMouseEvents"></event>
<event name="OnRightUp" /> <event name="OnMouseWheel"></event>
<event name="OnSetFocus" /> <event name="OnPaint"></event>
<event name="OnSize" /> <event name="OnRadioBox"></event>
<event name="OnUpdateUI" /> <event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
</object> </object>
...@@ -385,7 +577,7 @@ ...@@ -385,7 +577,7 @@
<property name="flag">wxALIGN_CENTER_VERTICAL</property> <property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size" /> <property name="minimum_size"></property>
<property name="name">m_ButtonsSizer</property> <property name="name">m_ButtonsSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
...@@ -394,51 +586,87 @@ ...@@ -394,51 +586,87 @@
<property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property> <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg" /> <property name="BottomDockable">1</property>
<property name="context_help" /> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">1</property> <property name="default">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg" /> <property name="fg"></property>
<property name="font" /> <property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_OK</property> <property name="id">wxID_OK</property>
<property name="label">OK</property> <property name="label">OK</property>
<property name="maximum_size" /> <property name="max_size"></property>
<property name="minimum_size" /> <property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_buttonOk</property> <property name="name">m_buttonOk</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos" /> <property name="pin_button">1</property>
<property name="size" /> <property name="pos"></property>
<property name="style" /> <property name="resize">Resizable</property>
<property name="subclass" /> <property name="show">1</property>
<property name="tooltip" /> <property name="size"></property>
<property name="window_extra_style" /> <property name="style"></property>
<property name="window_name" /> <property name="subclass"></property>
<property name="window_style" /> <property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnOkClick</event> <event name="OnButtonClick">OnOkClick</event>
<event name="OnChar" /> <event name="OnChar"></event>
<event name="OnEnterWindow" /> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground" /> <event name="OnEraseBackground"></event>
<event name="OnKeyDown" /> <event name="OnKeyDown"></event>
<event name="OnKeyUp" /> <event name="OnKeyUp"></event>
<event name="OnKillFocus" /> <event name="OnKillFocus"></event>
<event name="OnLeaveWindow" /> <event name="OnLeaveWindow"></event>
<event name="OnLeftDClick" /> <event name="OnLeftDClick"></event>
<event name="OnLeftDown" /> <event name="OnLeftDown"></event>
<event name="OnLeftUp" /> <event name="OnLeftUp"></event>
<event name="OnMiddleDClick" /> <event name="OnMiddleDClick"></event>
<event name="OnMiddleDown" /> <event name="OnMiddleDown"></event>
<event name="OnMiddleUp" /> <event name="OnMiddleUp"></event>
<event name="OnMotion" /> <event name="OnMotion"></event>
<event name="OnMouseEvents" /> <event name="OnMouseEvents"></event>
<event name="OnMouseWheel" /> <event name="OnMouseWheel"></event>
<event name="OnPaint" /> <event name="OnPaint"></event>
<event name="OnRightDClick" /> <event name="OnRightDClick"></event>
<event name="OnRightDown" /> <event name="OnRightDown"></event>
<event name="OnRightUp" /> <event name="OnRightUp"></event>
<event name="OnSetFocus" /> <event name="OnSetFocus"></event>
<event name="OnSize" /> <event name="OnSize"></event>
<event name="OnUpdateUI" /> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
...@@ -446,51 +674,87 @@ ...@@ -446,51 +674,87 @@
<property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property> <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg" /> <property name="BottomDockable">1</property>
<property name="context_help" /> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property> <property name="default">0</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg" /> <property name="fg"></property>
<property name="font" /> <property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_CANCEL</property> <property name="id">wxID_CANCEL</property>
<property name="label">Cancel</property> <property name="label">Cancel</property>
<property name="maximum_size" /> <property name="max_size"></property>
<property name="minimum_size" /> <property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_buttonCancel</property> <property name="name">m_buttonCancel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos" /> <property name="pin_button">1</property>
<property name="size" /> <property name="pos"></property>
<property name="style" /> <property name="resize">Resizable</property>
<property name="subclass" /> <property name="show">1</property>
<property name="tooltip" /> <property name="size"></property>
<property name="window_extra_style" /> <property name="style"></property>
<property name="window_name" /> <property name="subclass"></property>
<property name="window_style" /> <property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnCancelClick</event> <event name="OnButtonClick">OnCancelClick</event>
<event name="OnChar" /> <event name="OnChar"></event>
<event name="OnEnterWindow" /> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground" /> <event name="OnEraseBackground"></event>
<event name="OnKeyDown" /> <event name="OnKeyDown"></event>
<event name="OnKeyUp" /> <event name="OnKeyUp"></event>
<event name="OnKillFocus" /> <event name="OnKillFocus"></event>
<event name="OnLeaveWindow" /> <event name="OnLeaveWindow"></event>
<event name="OnLeftDClick" /> <event name="OnLeftDClick"></event>
<event name="OnLeftDown" /> <event name="OnLeftDown"></event>
<event name="OnLeftUp" /> <event name="OnLeftUp"></event>
<event name="OnMiddleDClick" /> <event name="OnMiddleDClick"></event>
<event name="OnMiddleDown" /> <event name="OnMiddleDown"></event>
<event name="OnMiddleUp" /> <event name="OnMiddleUp"></event>
<event name="OnMotion" /> <event name="OnMotion"></event>
<event name="OnMouseEvents" /> <event name="OnMouseEvents"></event>
<event name="OnMouseWheel" /> <event name="OnMouseWheel"></event>
<event name="OnPaint" /> <event name="OnPaint"></event>
<event name="OnRightDClick" /> <event name="OnRightDClick"></event>
<event name="OnRightDown" /> <event name="OnRightDown"></event>
<event name="OnRightUp" /> <event name="OnRightUp"></event>
<event name="OnSetFocus" /> <event name="OnSetFocus"></event>
<event name="OnSize" /> <event name="OnSize"></event>
<event name="OnUpdateUI" /> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
</object> </object>
...@@ -502,50 +766,82 @@ ...@@ -502,50 +766,82 @@
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property> <property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="1">
<property name="bg" /> <property name="BottomDockable">1</property>
<property name="context_help" /> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg" /> <property name="fg"></property>
<property name="font" /> <property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Layer selection:</property> <property name="label">Layer selection:</property>
<property name="maximum_size" /> <property name="max_size"></property>
<property name="minimum_size" /> <property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticTextLayerSelection</property> <property name="name">m_staticTextLayerSelection</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos" /> <property name="pin_button">1</property>
<property name="size" /> <property name="pos"></property>
<property name="style" /> <property name="resize">Resizable</property>
<property name="subclass" /> <property name="show">1</property>
<property name="tooltip" /> <property name="size"></property>
<property name="window_extra_style" /> <property name="style"></property>
<property name="window_name" /> <property name="subclass"></property>
<property name="window_style" /> <property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property> <property name="wrap">-1</property>
<event name="OnChar" /> <event name="OnChar"></event>
<event name="OnEnterWindow" /> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground" /> <event name="OnEraseBackground"></event>
<event name="OnKeyDown" /> <event name="OnKeyDown"></event>
<event name="OnKeyUp" /> <event name="OnKeyUp"></event>
<event name="OnKillFocus" /> <event name="OnKillFocus"></event>
<event name="OnLeaveWindow" /> <event name="OnLeaveWindow"></event>
<event name="OnLeftDClick" /> <event name="OnLeftDClick"></event>
<event name="OnLeftDown" /> <event name="OnLeftDown"></event>
<event name="OnLeftUp" /> <event name="OnLeftUp"></event>
<event name="OnMiddleDClick" /> <event name="OnMiddleDClick"></event>
<event name="OnMiddleDown" /> <event name="OnMiddleDown"></event>
<event name="OnMiddleUp" /> <event name="OnMiddleUp"></event>
<event name="OnMotion" /> <event name="OnMotion"></event>
<event name="OnMouseEvents" /> <event name="OnMouseEvents"></event>
<event name="OnMouseWheel" /> <event name="OnMouseWheel"></event>
<event name="OnPaint" /> <event name="OnPaint"></event>
<event name="OnRightDClick" /> <event name="OnRightDClick"></event>
<event name="OnRightDown" /> <event name="OnRightDown"></event>
<event name="OnRightUp" /> <event name="OnRightUp"></event>
<event name="OnSetFocus" /> <event name="OnSetFocus"></event>
<event name="OnSize" /> <event name="OnSize"></event>
<event name="OnUpdateUI" /> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
...@@ -553,51 +849,87 @@ ...@@ -553,51 +849,87 @@
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property> <property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxListBox" expanded="1"> <object class="wxListBox" expanded="1">
<property name="bg" /> <property name="BottomDockable">1</property>
<property name="choices" /> <property name="LeftDockable">1</property>
<property name="context_help" /> <property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices"></property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg" /> <property name="fg"></property>
<property name="font" /> <property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="maximum_size" /> <property name="max_size"></property>
<property name="minimum_size" /> <property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_LayerSelectionCtrl</property> <property name="name">m_LayerSelectionCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos" /> <property name="pin_button">1</property>
<property name="size" /> <property name="pos"></property>
<property name="style" /> <property name="resize">Resizable</property>
<property name="subclass" /> <property name="show">1</property>
<property name="tooltip" /> <property name="size"></property>
<property name="window_extra_style" /> <property name="style"></property>
<property name="window_name" /> <property name="subclass"></property>
<property name="window_style" /> <property name="toolbar_pane">0</property>
<event name="OnChar" /> <property name="tooltip"></property>
<event name="OnEnterWindow" /> <property name="validator_data_type"></property>
<event name="OnEraseBackground" /> <property name="validator_style">wxFILTER_NONE</property>
<event name="OnKeyDown" /> <property name="validator_type">wxDefaultValidator</property>
<event name="OnKeyUp" /> <property name="validator_variable"></property>
<event name="OnKillFocus" /> <property name="window_extra_style"></property>
<event name="OnLeaveWindow" /> <property name="window_name"></property>
<event name="OnLeftDClick" /> <property name="window_style"></property>
<event name="OnLeftDown" /> <event name="OnChar"></event>
<event name="OnLeftUp" /> <event name="OnEnterWindow"></event>
<event name="OnListBox" /> <event name="OnEraseBackground"></event>
<event name="OnListBoxDClick" /> <event name="OnKeyDown"></event>
<event name="OnMiddleDClick" /> <event name="OnKeyUp"></event>
<event name="OnMiddleDown" /> <event name="OnKillFocus"></event>
<event name="OnMiddleUp" /> <event name="OnLeaveWindow"></event>
<event name="OnMotion" /> <event name="OnLeftDClick"></event>
<event name="OnMouseEvents" /> <event name="OnLeftDown"></event>
<event name="OnMouseWheel" /> <event name="OnLeftUp"></event>
<event name="OnPaint" /> <event name="OnListBox"></event>
<event name="OnRightDClick" /> <event name="OnListBoxDClick"></event>
<event name="OnRightDown" /> <event name="OnMiddleDClick"></event>
<event name="OnRightUp" /> <event name="OnMiddleDown"></event>
<event name="OnSetFocus" /> <event name="OnMiddleUp"></event>
<event name="OnSize" /> <event name="OnMotion"></event>
<event name="OnUpdateUI" /> <event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
</object> </object>
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Apr 11 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_non_copper_zones_properties_base__ #ifndef __DIALOG_NON_COPPER_ZONES_PROPERTIES_BASE_H__
#define __dialog_non_copper_zones_properties_base__ #define __DIALOG_NON_COPPER_ZONES_PROPERTIES_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h> #include <wx/intl.h>
#include "dialog_shim.h"
#include <wx/string.h> #include <wx/string.h>
#include <wx/radiobox.h> #include <wx/radiobox.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
...@@ -29,7 +31,7 @@ ...@@ -29,7 +31,7 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DialogNonCopperZonesPropertiesBase /// Class DialogNonCopperZonesPropertiesBase
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DialogNonCopperZonesPropertiesBase : public wxDialog class DialogNonCopperZonesPropertiesBase : public DIALOG_SHIM
{ {
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
private: private:
...@@ -51,14 +53,15 @@ class DialogNonCopperZonesPropertiesBase : public wxDialog ...@@ -51,14 +53,15 @@ class DialogNonCopperZonesPropertiesBase : public wxDialog
wxListBox* m_LayerSelectionCtrl; wxListBox* m_LayerSelectionCtrl;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
public: public:
DialogNonCopperZonesPropertiesBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Non Copper Zones Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 416,287 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER ); DialogNonCopperZonesPropertiesBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Non Copper Zones Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 416,287 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER );
~DialogNonCopperZonesPropertiesBase(); ~DialogNonCopperZonesPropertiesBase();
}; };
#endif //__dialog_non_copper_zones_properties_base__ #endif //__DIALOG_NON_COPPER_ZONES_PROPERTIES_BASE_H__
...@@ -48,13 +48,10 @@ our error message. ...@@ -48,13 +48,10 @@ our error message.
Load() TODO's Load() TODO's
*) finish xpath support *) test footprint placement on board back
*) set layer counts, types and names into BOARD
*) footprint placement on board back
*) eagle "mirroring" does not mean put on board back
*) fix text twisting and final location issues.
*) netclass info? *) netclass info?
*) code factoring, for polygon at least *) verify zone fill clearances are correct
*) write BOARD::Move() and reposition to center of page from centerBoard()
*/ */
...@@ -80,6 +77,88 @@ Load() TODO's ...@@ -80,6 +77,88 @@ Load() TODO's
using namespace boost::property_tree; using namespace boost::property_tree;
/// segment (element) of our XPATH into the Eagle XML document tree in PTREE form.
struct TRIPLET
{
const char* element;
const char* attribute;
const char* value;
TRIPLET( const char* aElement, const char* aAttribute = "", const char* aValue = "" ) :
element( aElement ),
attribute( aAttribute ),
value( aValue )
{}
};
/**
* Class XPATH
* keeps track of what we are working on within a PTREE.
* Then if an exception is thrown, the place within the tree that gave us
* grief can be reported almost accurately. To minimally impact
* speed, merely assign const char* pointers during the tree walking
* expedition. The const char* pointers must be to C strings residing either in
* the data or code segment (i.e. "compiled in") or within the XML document, but
* not on the stack, since the stack is unwound during the throwing of the
* exception. The XML document will not immediately vanish since we capture
* the xpath (using function Contents()) before the XML document tree (PTREE)
* is destroyed.
*/
class XPATH
{
std::vector<TRIPLET> p;
public:
void push( const char* aPathSegment, const char* aAttribute="" )
{
p.push_back( TRIPLET( aPathSegment, aAttribute ) );
}
void clear() { p.clear(); }
void pop() { p.pop_back(); }
/// modify the last path node's value
void Value( const char* aValue )
{
p.back().value = aValue;
}
/// modify the last path node's attribute
void Attribute( const char* aAttribute )
{
p.back().attribute = aAttribute;
}
/// return the contents of the XPATH as a single string
std::string Contents()
{
typedef std::vector<TRIPLET>::const_iterator CITER;
std::string ret;
for( CITER it = p.begin(); it != p.end(); ++it )
{
if( it != p.begin() )
ret += '.';
ret += it->element;
if( it->attribute[0] && it->value[0] )
{
ret += '[';
ret += it->attribute;
ret += '=';
ret += it->value;
ret += ']';
}
}
return ret;
}
};
typedef EAGLE_PLUGIN::BIU BIU; typedef EAGLE_PLUGIN::BIU BIU;
typedef PTREE::const_assoc_iterator CA_ITER; typedef PTREE::const_assoc_iterator CA_ITER;
...@@ -92,7 +171,70 @@ typedef MODULE_MAP::const_iterator MODULE_CITER; ...@@ -92,7 +171,70 @@ typedef MODULE_MAP::const_iterator MODULE_CITER;
typedef boost::optional<std::string> opt_string; typedef boost::optional<std::string> opt_string;
typedef boost::optional<int> opt_int; typedef boost::optional<int> opt_int;
typedef boost::optional<double> opt_double; typedef boost::optional<double> opt_double;
typedef boost::optional<CPTREE&> opt_cptree; typedef boost::optional<bool> opt_bool;
/**
* Function parseOptionalBool
* returns an opt_bool and sets it true or false according to the presence
* and value of an attribute within the CPTREE element.
*/
static opt_bool parseOptionalBool( CPTREE& attribs, const char* aName )
{
opt_bool ret;
opt_string stemp = attribs.get_optional<std::string>( aName );
if( stemp )
ret = !stemp->compare( "yes" );
return ret;
}
// All of the 'E'STRUCTS below merely hold Eagle XML information verbatim, in binary.
// For maintenance and troubleshooting purposes, it was thought that we'd need to
// separate the conversion process into distinct steps. There is no intent to have KiCad
// forms of information in these 'E'STRUCTS. They are only binary forms
// of the Eagle information in the corresponding Eagle XML nodes.
/// Eagle rotation
struct EROT
{
bool mirror;
bool spin;
double degrees;
EROT() : mirror( false ), spin( false ), degrees( 0 ) {}
};
typedef boost::optional<EROT> opt_erot;
/// parse an Eagle XML "rot" field. Unfortunately the DTD seems not to explain
/// this format very well. R[S][M]<degrees>. Examples: "R90", "MR180", "SR180"
static EROT erot( const std::string& aRot )
{
EROT rot;
rot.spin = aRot.find( 'S' ) != aRot.npos;
rot.mirror = aRot.find( 'M' ) != aRot.npos;
rot.degrees = strtod( aRot.c_str()
+ 1 // skip leading 'R'
+ int( rot.spin ) // skip optional leading 'S'
+ int( rot.mirror ), // skip optional leading 'M'
NULL );
return rot;
}
/// Eagle "rot" fields are optional, handle that by returning opt_erot.
static opt_erot parseOptionalEROT( CPTREE& attribs )
{
opt_erot ret;
opt_string stemp = attribs.get_optional<std::string>( "rot" );
if( stemp )
ret = erot( *stemp );
return ret;
}
/// Eagle wire /// Eagle wire
struct EWIRE struct EWIRE
...@@ -103,20 +245,88 @@ struct EWIRE ...@@ -103,20 +245,88 @@ struct EWIRE
double y2; double y2;
double width; double width;
int layer; int layer;
EWIRE( CPTREE& aWire );
}; };
/**
* Constructor EWIRE
* converts a <wire>'s xml attributes to binary without additional conversion.
* This result is an EWIRE with the <wire> textual data merely converted to binary.
*/
EWIRE::EWIRE( CPTREE& aWire )
{
CPTREE& attribs = aWire.get_child( "<xmlattr>" );
/*
<!ELEMENT wire EMPTY>
<!ATTLIST wire
x1 %Coord; #REQUIRED
y1 %Coord; #REQUIRED
x2 %Coord; #REQUIRED
y2 %Coord; #REQUIRED
width %Dimension; #REQUIRED
layer %Layer; #REQUIRED
extent %Extent; #IMPLIED -- only applicable for airwires --
style %WireStyle; "continuous"
curve %WireCurve; "0"
cap %WireCap; "round" -- only applicable if 'curve' is not zero --
>
*/
x1 = attribs.get<double>( "x1" );
y1 = attribs.get<double>( "y1" );
x2 = attribs.get<double>( "x2" );
y2 = attribs.get<double>( "y2" );
width = attribs.get<double>( "width" );
layer = attribs.get<int>( "layer" );
// ignoring extent, style, curve and cap
}
/// Eagle via /// Eagle via
struct EVIA struct EVIA
{ {
double x; double x;
double y; double y;
int layer_start; /// < extent int layer_front_most; /// < extent
int layer_end; /// < inclusive int layer_back_most; /// < inclusive
double drill; double drill;
opt_double diam; opt_double diam;
opt_string shape; opt_string shape;
EVIA( CPTREE& aVia );
}; };
EVIA::EVIA( CPTREE& aVia )
{
CPTREE& attribs = aVia.get_child( "<xmlattr>" );
/*
<!ELEMENT via EMPTY>
<!ATTLIST via
x %Coord; #REQUIRED
y %Coord; #REQUIRED
extent %Extent; #REQUIRED
drill %Dimension; #REQUIRED
diameter %Dimension; "0"
shape %ViaShape; "round"
alwaysstop %Bool; "no"
>
*/
x = attribs.get<double>( "x" );
y = attribs.get<double>( "y" );
std::string ext = attribs.get<std::string>( "extent" );
sscanf( ext.c_str(), "%u-%u", &layer_front_most, &layer_back_most );
drill = attribs.get<double>( "drill" );
diam = attribs.get_optional<double>( "diameter" );
shape = attribs.get_optional<std::string>( "shape" );
}
/// Eagle circle /// Eagle circle
struct ECIRCLE struct ECIRCLE
{ {
...@@ -125,8 +335,33 @@ struct ECIRCLE ...@@ -125,8 +335,33 @@ struct ECIRCLE
double radius; double radius;
double width; double width;
int layer; int layer;
ECIRCLE( CPTREE& aCircle );
}; };
ECIRCLE::ECIRCLE( CPTREE& aCircle )
{
CPTREE& attribs = aCircle.get_child( "<xmlattr>" );
/*
<!ELEMENT circle EMPTY>
<!ATTLIST circle
x %Coord; #REQUIRED
y %Coord; #REQUIRED
radius %Coord; #REQUIRED
width %Dimension; #REQUIRED
layer %Layer; #REQUIRED
>
*/
x = attribs.get<double>( "x" );
y = attribs.get<double>( "y" );
radius = attribs.get<double>( "radius" );
width = attribs.get<double>( "width" );
layer = attribs.get<int>( "layer" );
}
/// Eagle XML rectangle in binary /// Eagle XML rectangle in binary
struct ERECT struct ERECT
{ {
...@@ -135,17 +370,35 @@ struct ERECT ...@@ -135,17 +370,35 @@ struct ERECT
double x2; double x2;
double y2; double y2;
int layer; int layer;
opt_erot rot;
ERECT( CPTREE& aRect );
}; };
/// Eagle rotation ERECT::ERECT( CPTREE& aRect )
struct EROT
{ {
bool mirror; CPTREE& attribs = aRect.get_child( "<xmlattr>" );
bool spin;
double degrees; /*
}; <!ELEMENT rectangle EMPTY>
<!ATTLIST rectangle
x1 %Coord; #REQUIRED
y1 %Coord; #REQUIRED
x2 %Coord; #REQUIRED
y2 %Coord; #REQUIRED
layer %Layer; #REQUIRED
rot %Rotation; "R0"
>
*/
x1 = attribs.get<double>( "x1" );
y1 = attribs.get<double>( "y1" );
x2 = attribs.get<double>( "x2" );
y2 = attribs.get<double>( "y2" );
layer = attribs.get<int>( "layer" );
rot = parseOptionalEROT( attribs );
}
typedef boost::optional<EROT> opt_erot;
/// Eagle "attribute" XML element, no foolin'. /// Eagle "attribute" XML element, no foolin'.
struct EATTR struct EATTR
...@@ -155,9 +408,9 @@ struct EATTR ...@@ -155,9 +408,9 @@ struct EATTR
opt_double x; opt_double x;
opt_double y; opt_double y;
opt_double size; opt_double size;
// opt_int layer; opt_int layer;
opt_double ratio; opt_double ratio;
opt_erot erot; opt_erot rot;
opt_int display; opt_int display;
enum { // for 'display' field above enum { // for 'display' field above
...@@ -166,8 +419,67 @@ struct EATTR ...@@ -166,8 +419,67 @@ struct EATTR
NAME, NAME,
BOTH, BOTH,
}; };
EATTR( CPTREE& aTree );
}; };
/**
* Constructor EATTR
* parses an Eagle "attribute" XML element. Note that an attribute element
* is different than an XML element attribute. The attribute element is a
* full XML node in and of itself, and has attributes of its own. Blame Eagle.
*/
EATTR::EATTR( CPTREE& aAttribute )
{
CPTREE& attribs = aAttribute.get_child( "<xmlattr>" );
/*
<!ELEMENT attribute EMPTY>
<!ATTLIST attribute
name %String; #REQUIRED
value %String; #IMPLIED
x %Coord; #IMPLIED
y %Coord; #IMPLIED
size %Dimension; #IMPLIED
layer %Layer; #IMPLIED
font %TextFont; #IMPLIED
ratio %Int; #IMPLIED
rot %Rotation; "R0"
display %AttributeDisplay; "value" -- only in <element> or <instance> context --
constant %Bool; "no" -- only in <device> context --
>
*/
name = attribs.get<std::string>( "name" ); // #REQUIRED
value = attribs.get_optional<std::string>( "value" );
x = attribs.get_optional<double>( "x" );
y = attribs.get_optional<double>( "y" );
size = attribs.get_optional<double>( "size" );
// KiCad cannot currently put a TEXTE_MODULE on a different layer than the MODULE
// Eagle can it seems.
layer = attribs.get_optional<int>( "layer" );
ratio = attribs.get_optional<double>( "ratio" );
rot = parseOptionalEROT( attribs );
opt_string stemp = attribs.get_optional<std::string>( "display" );
if( stemp )
{
// (off | value | name | both)
if( !stemp->compare( "off" ) )
display = EATTR::Off;
else if( !stemp->compare( "value" ) )
display = EATTR::VALUE;
else if( !stemp->compare( "name" ) )
display = EATTR::NAME;
else if( !stemp->compare( "both" ) )
display = EATTR::BOTH;
}
}
/// Eagle text element /// Eagle text element
struct ETEXT struct ETEXT
{ {
...@@ -178,41 +490,435 @@ struct ETEXT ...@@ -178,41 +490,435 @@ struct ETEXT
int layer; int layer;
opt_string font; opt_string font;
opt_double ratio; opt_double ratio;
opt_erot erot; opt_erot rot;
opt_int align;
enum { enum { // for align
CENTER, CENTER,
CENTER_LEFT, CENTER_LEFT,
TOP_CENTER, TOP_CENTER,
TOP_LEFT, TOP_LEFT,
TOP_RIGHT, TOP_RIGHT,
// opposites are -1 x above, used by code tricks in here // opposites are -1 x above, used by code tricks in here
CENTER_RIGHT = -CENTER_LEFT, CENTER_RIGHT = -CENTER_LEFT,
BOTTOM_CENTER = -TOP_CENTER, BOTTOM_CENTER = -TOP_CENTER,
BOTTOM_LEFT = -TOP_RIGHT, BOTTOM_LEFT = -TOP_RIGHT,
BOTTOM_RIGHT = -TOP_LEFT, BOTTOM_RIGHT = -TOP_LEFT,
}; };
opt_int align;
ETEXT( CPTREE& aText );
};
ETEXT::ETEXT( CPTREE& aText )
{
CPTREE& attribs = aText.get_child( "<xmlattr>" );
/*
<!ELEMENT text (#PCDATA)>
<!ATTLIST text
x %Coord; #REQUIRED
y %Coord; #REQUIRED
size %Dimension; #REQUIRED
layer %Layer; #REQUIRED
font %TextFont; "proportional"
ratio %Int; "8"
rot %Rotation; "R0"
align %Align; "bottom-left"
>
*/
text = aText.data();
x = attribs.get<double>( "x" );
y = attribs.get<double>( "y" );
size = attribs.get<double>( "size" );
layer = attribs.get<int>( "layer" );
font = attribs.get_optional<std::string>( "font" );
ratio = attribs.get_optional<double>( "ratio" );
rot = parseOptionalEROT( attribs );
opt_string stemp = attribs.get_optional<std::string>( "align" );
if( stemp )
{
// (bottom-left | bottom-center | bottom-right | center-left |
// center | center-right | top-left | top-center | top-right)
if( !stemp->compare( "center" ) )
align = ETEXT::CENTER;
else if( !stemp->compare( "center-right" ) )
align = ETEXT::CENTER_RIGHT;
else if( !stemp->compare( "top-left" ) )
align = ETEXT::TOP_LEFT;
else if( !stemp->compare( "top-center" ) )
align = ETEXT::TOP_CENTER;
else if( !stemp->compare( "top-right" ) )
align = ETEXT::TOP_RIGHT;
else if( !stemp->compare( "bottom-left" ) )
align = ETEXT::BOTTOM_LEFT;
else if( !stemp->compare( "bottom-center" ) )
align = ETEXT::BOTTOM_CENTER;
else if( !stemp->compare( "bottom-right" ) )
align = ETEXT::BOTTOM_RIGHT;
else if( !stemp->compare( "center-left" ) )
align = ETEXT::CENTER_LEFT;
}
}
/// Eagle thru hol pad
struct EPAD
{
std::string name;
double x;
double y;
double drill;
opt_double diameter;
// for shape: (square | round | octagon | long | offset)
enum {
SQUARE,
ROUND,
OCTAGON,
LONG,
OFFSET,
};
opt_int shape;
opt_erot rot;
opt_bool stop;
opt_bool thermals;
opt_bool first;
EPAD( CPTREE& aPad );
};
EPAD::EPAD( CPTREE& aPad )
{
CPTREE& attribs = aPad.get_child( "<xmlattr>" );
/*
<!ELEMENT pad EMPTY>
<!ATTLIST pad
name %String; #REQUIRED
x %Coord; #REQUIRED
y %Coord; #REQUIRED
drill %Dimension; #REQUIRED
diameter %Dimension; "0"
shape %PadShape; "round"
rot %Rotation; "R0"
stop %Bool; "yes"
thermals %Bool; "yes"
first %Bool; "no"
>
*/
// #REQUIRED says DTD, throw exception if not found
name = attribs.get<std::string>( "name" );
x = attribs.get<double>( "x" );
y = attribs.get<double>( "y" );
drill = attribs.get<double>( "drill" );
diameter = attribs.get_optional<double>( "diameter" );
opt_string s = attribs.get_optional<std::string>( "shape" );
if( s )
{
// (square | round | octagon | long | offset)
if( !s->compare( "square" ) )
shape = EPAD::SQUARE;
else if( !s->compare( "round" ) )
shape = EPAD::ROUND;
else if( !s->compare( "octagon" ) )
shape = EPAD::OCTAGON;
else if( !s->compare( "long" ) )
shape = EPAD::LONG;
else if( !s->compare( "offset" ) )
shape = EPAD::OFFSET;
}
rot = parseOptionalEROT( attribs );
stop = parseOptionalBool( attribs, "stop" );
thermals = parseOptionalBool( attribs, "thermals" );
first = parseOptionalBool( attribs, "first" );
}
/// Eagle SMD pad
struct ESMD
{
std::string name;
double x;
double y;
double dx;
double dy;
int layer;
opt_int roundness;
opt_erot rot;
opt_bool stop;
opt_bool thermals;
opt_bool cream;
ESMD( CPTREE& aSMD );
};
ESMD::ESMD( CPTREE& aSMD )
{
CPTREE& attribs = aSMD.get_child( "<xmlattr>" );
/*
<!ATTLIST smd
name %String; #REQUIRED
x %Coord; #REQUIRED
y %Coord; #REQUIRED
dx %Dimension; #REQUIRED
dy %Dimension; #REQUIRED
layer %Layer; #REQUIRED
roundness %Int; "0"
rot %Rotation; "R0"
stop %Bool; "yes"
thermals %Bool; "yes"
cream %Bool; "yes"
>
*/
// DTD #REQUIRED, throw exception if not found
name = attribs.get<std::string>( "name" );
x = attribs.get<double>( "x" );
y = attribs.get<double>( "y" );
dx = attribs.get<double>( "dx" );
dy = attribs.get<double>( "dy" );
layer = attribs.get<int>( "layer" );
rot = parseOptionalEROT( attribs );
roundness = attribs.get_optional<int>( "roundness" );
thermals = parseOptionalBool( attribs, "thermals" );
stop = parseOptionalBool( attribs, "stop" );
thermals = parseOptionalBool( attribs, "thermals" );
cream = parseOptionalBool( attribs, "cream" );
}
struct EVERTEX
{
double x;
double y;
EVERTEX( CPTREE& aVertex );
};
EVERTEX::EVERTEX( CPTREE& aVertex )
{
CPTREE& attribs = aVertex.get_child( "<xmlattr>" );
/*
<!ELEMENT vertex EMPTY>
<!ATTLIST vertex
x %Coord; #REQUIRED
y %Coord; #REQUIRED
curve %WireCurve; "0" -- the curvature from this vertex to the next one --
>
*/
x = attribs.get<double>( "x" );
y = attribs.get<double>( "y" );
}
/// Eagle polygon, without vertices which are parsed as needed
struct EPOLYGON
{
double width;
int layer;
opt_double spacing;
enum { // for pour
SOLID,
HATCH,
CUTOUT,
};
opt_int pour;
opt_double isolate;
opt_bool orphans;
opt_bool thermals;
opt_int rank;
EPOLYGON( CPTREE& aPolygon );
};
EPOLYGON::EPOLYGON( CPTREE& aPolygon )
{
CPTREE& attribs = aPolygon.get_child( "<xmlattr>" );
/*
<!ATTLIST polygon
width %Dimension; #REQUIRED
layer %Layer; #REQUIRED
spacing %Dimension; #IMPLIED
pour %PolygonPour; "solid"
isolate %Dimension; #IMPLIED -- only in <signal> or <package> context --
orphans %Bool; "no" -- only in <signal> context --
thermals %Bool; "yes" -- only in <signal> context --
rank %Int; "0" -- 1..6 in <signal> context, 0 or 7 in <package> context --
>
*/
width = attribs.get<double>( "width" );
layer = attribs.get<int>( "layer" );
spacing = attribs.get_optional<double>( "spacing" );
opt_string s = attribs.get_optional<std::string>( "pour" );
if( s )
{
// (solid | hatch | cutout)
if( !s->compare( "hatch" ) )
pour = EPOLYGON::HATCH;
else if( !s->compare( "cutout" ) )
pour = EPOLYGON::CUTOUT;
else
pour = EPOLYGON::SOLID;
}
orphans = parseOptionalBool( attribs, "orphans" );
thermals = parseOptionalBool( attribs, "thermals" );
rank = attribs.get_optional<int>( "rank" );
}
/// Eagle hole element
struct EHOLE
{
double x;
double y;
double drill;
EHOLE( CPTREE& aHole );
};
EHOLE::EHOLE( CPTREE& aHole )
{
CPTREE& attribs = aHole.get_child( "<xmlattr>" );
/*
<!ELEMENT hole EMPTY>
<!ATTLIST hole
x %Coord; #REQUIRED
y %Coord; #REQUIRED
drill %Dimension; #REQUIRED
>
*/
// #REQUIRED:
x = attribs.get<double>( "x" );
y = attribs.get<double>( "y" );
drill = attribs.get<double>( "drill" );
}
/// Eagle element element
struct EELEMENT
{
std::string name;
std::string library;
std::string package;
std::string value;
double x;
double y;
opt_bool locked;
// opt_bool smashed;
opt_erot rot;
EELEMENT( CPTREE& aElement );
};
EELEMENT::EELEMENT( CPTREE& aElement )
{
CPTREE& attribs = aElement.get_child( "<xmlattr>" );
/*
<!ELEMENT element (attribute*, variant*)>
<!ATTLIST element
name %String; #REQUIRED
library %String; #REQUIRED
package %String; #REQUIRED
value %String; #REQUIRED
x %Coord; #REQUIRED
y %Coord; #REQUIRED
locked %Bool; "no"
smashed %Bool; "no"
rot %Rotation; "R0"
>
*/
// #REQUIRED
name = attribs.get<std::string>( "name" );
library = attribs.get<std::string>( "library" );
package = attribs.get<std::string>( "package" );
value = attribs.get<std::string>( "value" );
x = attribs.get<double>( "x" );
y = attribs.get<double>( "y" );
// optional
locked = parseOptionalBool( attribs, "locked" );
// smashed = pasreOptionalBool( attribs, "smashed" );
rot = parseOptionalEROT( attribs );
}
struct ELAYER
{
int number;
std::string name;
int color;
int fill;
opt_bool visible;
opt_bool active;
ELAYER( CPTREE& aLayer );
}; };
ELAYER::ELAYER( CPTREE& aLayer )
{
CPTREE& attribs = aLayer.get_child( "<xmlattr>" );
/*
<!ELEMENT layer EMPTY>
<!ATTLIST layer
number %Layer; #REQUIRED
name %String; #REQUIRED
color %Int; #REQUIRED
fill %Int; #REQUIRED
visible %Bool; "yes"
active %Bool; "yes"
>
*/
number = attribs.get<int>( "number" );
name = attribs.get<std::string>( "name" );
color = attribs.get<int>( "color" );
visible = parseOptionalBool( attribs, "visible" );
active = parseOptionalBool( attribs, "active" );
}
/// Assemble a two part key as a simple concatonation of aFirst and aSecond parts, /// Assemble a two part key as a simple concatonation of aFirst and aSecond parts,
/// using '\x02' as a separator. /// using a separator.
static inline std::string makeKey( const std::string& aFirst, const std::string& aSecond ) static inline std::string makeKey( const std::string& aFirst, const std::string& aSecond )
{ {
std::string key = aFirst + '\x02' + aSecond; std::string key = aFirst + '\x02' + aSecond;
return key; return key;
} }
/// Make a unique time stamp, in this case from a unique tree memory location
/// Make a unique time stamp
static inline unsigned long timeStamp( CPTREE& aTree ) static inline unsigned long timeStamp( CPTREE& aTree )
{ {
// in this case from a unique tree memory location
return (unsigned long)(void*) &aTree; return (unsigned long)(void*) &aTree;
} }
EAGLE_PLUGIN::EAGLE_PLUGIN() EAGLE_PLUGIN::EAGLE_PLUGIN() :
m_xpath( new XPATH() )
{ {
init( NULL ); init( NULL );
} }
...@@ -220,6 +926,7 @@ EAGLE_PLUGIN::EAGLE_PLUGIN() ...@@ -220,6 +926,7 @@ EAGLE_PLUGIN::EAGLE_PLUGIN()
EAGLE_PLUGIN::~EAGLE_PLUGIN() EAGLE_PLUGIN::~EAGLE_PLUGIN()
{ {
delete m_xpath;
} }
...@@ -265,28 +972,42 @@ BOARD* EAGLE_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, PROPE ...@@ -265,28 +972,42 @@ BOARD* EAGLE_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, PROPE
try try
{ {
// 8 bit filename should be encoded in current locale, not necessarily utf8. // 8 bit "filename" should be encoded according to disk filename encoding,
std::string filename = (const char*) aFileName.fn_str(); // (maybe this is current locale, maybe not, its a filesystem issue),
// and is not necessarily utf8.
std::string filename = (const char*) aFileName.char_str( wxConvFile );
read_xml( filename, doc, xml_parser::trim_whitespace | xml_parser::no_comments ); read_xml( filename, doc, xml_parser::trim_whitespace | xml_parser::no_comments );
std::string xpath = "eagle.drawing.board"; loadAllSections( doc );
CPTREE& brd = doc.get_child( xpath );
// should be empty, else missing m_xpath->pop()
wxASSERT( m_xpath->Contents().size() == 0 );
}
loadAllSections( brd, xpath, bool( aAppendToMe ) ); catch( file_parser_error fpe )
{
// for xml_parser_error, what() has the line number in it,
// but no byte offset. That should be an adequate error message.
THROW_IO_ERROR( fpe.what() );
} }
// Class ptree_error is a base class for xml_parser_error & file_parser_error, // Class ptree_error is a base class for xml_parser_error & file_parser_error,
// so one catch should be OK for all errors. // so one catch should be OK for all errors.
catch( ptree_error pte ) catch( ptree_error pte )
{ {
// for xml_parser_error, what() has the line number in it, std::string errmsg = pte.what();
// but no byte offset. That should be an adequate error message.
THROW_IO_ERROR( pte.what() ); errmsg += " @\n";
errmsg += m_xpath->Contents();
THROW_IO_ERROR( errmsg );
} }
// IO_ERROR exceptions are left uncaught, they pass upwards from here. // IO_ERROR exceptions are left uncaught, they pass upwards from here.
centerBoard();
deleter.release(); deleter.release();
return m_board; return m_board;
} }
...@@ -294,6 +1015,9 @@ BOARD* EAGLE_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, PROPE ...@@ -294,6 +1015,9 @@ BOARD* EAGLE_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, PROPE
void EAGLE_PLUGIN::init( PROPERTIES* aProperties ) void EAGLE_PLUGIN::init( PROPERTIES* aProperties )
{ {
m_hole_count = 0;
m_xpath->clear();
m_pads_to_nets.clear(); m_pads_to_nets.clear();
m_templates.clear(); m_templates.clear();
...@@ -305,44 +1029,86 @@ void EAGLE_PLUGIN::init( PROPERTIES* aProperties ) ...@@ -305,44 +1029,86 @@ void EAGLE_PLUGIN::init( PROPERTIES* aProperties )
} }
void EAGLE_PLUGIN::loadAllSections( CPTREE& aEagleBoard, const std::string& aXpath, bool aAppendToMe ) void EAGLE_PLUGIN::loadAllSections( CPTREE& aDoc )
{ {
std::string xpath; CPTREE& drawing = aDoc.get_child( "eagle.drawing" );
m_xpath->push( "eagle.drawing" );
{ {
xpath = aXpath + '.' + "plain"; CPTREE& layers = drawing.get_child( "layers" );
CPTREE& plain = aEagleBoard.get_child( "plain" ); loadLayerDefs( layers );
loadPlain( plain, xpath );
} }
{ {
xpath = aXpath + '.' + "signals"; CPTREE& board = drawing.get_child( "board" );
CPTREE& signals = aEagleBoard.get_child( "signals" ); m_xpath->push( "board" );
loadSignals( signals, xpath );
CPTREE& plain = board.get_child( "plain" );
loadPlain( plain );
CPTREE& signals = board.get_child( "signals" );
loadSignals( signals );
CPTREE& libs = board.get_child( "libraries" );
loadLibraries( libs );
CPTREE& elems = board.get_child( "elements" );
loadElements( elems );
m_xpath->pop(); // "board"
} }
m_xpath->pop(); // "eagle.drawing"
}
void EAGLE_PLUGIN::loadLayerDefs( CPTREE& aLayers )
{
m_xpath->push( "layers.layer" );
typedef std::vector<ELAYER> ELAYERS;
typedef ELAYERS::const_iterator EITER;
ELAYERS cu; // copper layers
// find the subset of layers that are copper, and active
for( CITER layer = aLayers.begin(); layer != aLayers.end(); ++layer )
{ {
xpath = aXpath + '.' + "libraries"; ELAYER elayer( layer->second );
CPTREE& libs = aEagleBoard.get_child( "libraries" );
loadLibraries( libs, xpath ); if( elayer.number >= 1 && elayer.number <= 16 && ( !elayer.active || *elayer.active ) )
{
cu.push_back( elayer );
} }
}
m_board->SetCopperLayerCount( cu.size() );
for( EITER it = cu.begin(); it != cu.end(); ++it )
{ {
xpath = aXpath + '.' + "elements"; int layer = kicad_layer( it->number );
CPTREE& elems = aEagleBoard.get_child( "elements" );
loadElements( elems, xpath ); m_board->SetLayerName( layer, FROM_UTF8( it->name.c_str() ) );
m_board->SetLayerType( layer, LT_SIGNAL );
// could map the colors here
} }
m_xpath->pop();
} }
void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics, const std::string& aXpath ) void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics )
{ {
m_xpath->push( "plain" );
// (polygon | wire | text | circle | rectangle | frame | hole)* // (polygon | wire | text | circle | rectangle | frame | hole)*
for( CITER gr = aGraphics.begin(); gr != aGraphics.end(); ++gr ) for( CITER gr = aGraphics.begin(); gr != aGraphics.end(); ++gr )
{ {
if( !gr->first.compare( "wire" ) ) if( !gr->first.compare( "wire" ) )
{ {
EWIRE w = ewire( gr->second ); m_xpath->push( "wire" );
EWIRE w( gr->second );
DRAWSEGMENT* dseg = new DRAWSEGMENT( m_board ); DRAWSEGMENT* dseg = new DRAWSEGMENT( m_board );
m_board->Add( dseg, ADD_APPEND ); m_board->Add( dseg, ADD_APPEND );
...@@ -352,47 +1118,61 @@ void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics, const std::string& aXpath ) ...@@ -352,47 +1118,61 @@ void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics, const std::string& aXpath )
dseg->SetStart( wxPoint( kicad_x( w.x1 ), kicad_y( w.y1 ) ) ); dseg->SetStart( wxPoint( kicad_x( w.x1 ), kicad_y( w.y1 ) ) );
dseg->SetEnd( wxPoint( kicad_x( w.x2 ), kicad_y( w.y2 ) ) ); dseg->SetEnd( wxPoint( kicad_x( w.x2 ), kicad_y( w.y2 ) ) );
dseg->SetWidth( kicad( w.width ) ); dseg->SetWidth( kicad( w.width ) );
m_xpath->pop();
} }
else if( !gr->first.compare( "text" ) ) else if( !gr->first.compare( "text" ) )
{ {
double ratio = 6;
int sign = 1;
#if defined(DEBUG) #if defined(DEBUG)
if( !gr->second.data().compare( "designed by" ) ) if( !gr->second.data().compare( "ATMEGA328" ) )
{ {
int breakhere = 1; int breakhere = 1;
(void) breakhere; (void) breakhere;
} }
#endif #endif
m_xpath->push( "text" );
ETEXT t( gr->second );
int layer = kicad_layer( t.layer );
ETEXT t = etext( gr->second ); int sign = 1;
TEXTE_PCB* pcbtxt = new TEXTE_PCB( m_board ); TEXTE_PCB* pcbtxt = new TEXTE_PCB( m_board );
m_board->Add( pcbtxt, ADD_APPEND ); m_board->Add( pcbtxt, ADD_APPEND );
pcbtxt->SetLayer( layer );
pcbtxt->SetTimeStamp( timeStamp( gr->second ) ); pcbtxt->SetTimeStamp( timeStamp( gr->second ) );
pcbtxt->SetText( FROM_UTF8( t.text.c_str() ) ); pcbtxt->SetText( FROM_UTF8( t.text.c_str() ) );
pcbtxt->SetPosition( wxPoint( kicad_x( t.x ), kicad_y( t.y ) ) ); pcbtxt->SetPosition( wxPoint( kicad_x( t.x ), kicad_y( t.y ) ) );
pcbtxt->SetLayer( kicad_layer( t.layer ) );
pcbtxt->SetSize( kicad_fontz( t.size ) ); pcbtxt->SetSize( kicad_fontz( t.size ) );
if( t.ratio ) double ratio = t.ratio ? *t.ratio : 8; // DTD says 8 is default
ratio = *t.ratio;
pcbtxt->SetThickness( kicad( t.size * ratio / 100 ) ); pcbtxt->SetThickness( kicad( t.size * ratio / 100 ) );
if( t.erot ) if( t.rot )
{ {
#if 0
if( t.rot->spin || ( t.rot->degrees != 180 && t.rot->degrees != 270 ) )
pcbtxt->SetOrientation( t.rot->degrees * 10 );
else
// flip the justification to opposite
sign = -1;
#else
// eagles does not rotate text spun to 180 degrees unless spin is set. // eagles does not rotate text spun to 180 degrees unless spin is set.
if( t.erot->spin || t.erot->degrees != 180 ) if( t.rot->spin || t.rot->degrees != 180 )
pcbtxt->SetOrientation( t.erot->degrees * 10 ); pcbtxt->SetOrientation( t.rot->degrees * 10 );
else // 180 degree no spin text, flip the justification to opposite else
// flip the justification to opposite
sign = -1;
if( t.rot->degrees == 270 )
sign = -1; sign = -1;
#endif
pcbtxt->SetMirrored( t.rot->mirror );
pcbtxt->SetMirrored( t.erot->mirror );
} }
int align = t.align ? *t.align : ETEXT::BOTTOM_LEFT; int align = t.align ? *t.align : ETEXT::BOTTOM_LEFT;
...@@ -439,10 +1219,13 @@ void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics, const std::string& aXpath ) ...@@ -439,10 +1219,13 @@ void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics, const std::string& aXpath )
pcbtxt->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM ); pcbtxt->SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM );
break; break;
} }
m_xpath->pop();
} }
else if( !gr->first.compare( "circle" ) ) else if( !gr->first.compare( "circle" ) )
{ {
ECIRCLE c = ecircle( gr->second ); m_xpath->push( "circle" );
ECIRCLE c( gr->second );
DRAWSEGMENT* dseg = new DRAWSEGMENT( m_board ); DRAWSEGMENT* dseg = new DRAWSEGMENT( m_board );
m_board->Add( dseg, ADD_APPEND ); m_board->Add( dseg, ADD_APPEND );
...@@ -453,70 +1236,113 @@ void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics, const std::string& aXpath ) ...@@ -453,70 +1236,113 @@ void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics, const std::string& aXpath )
dseg->SetStart( wxPoint( kicad_x( c.x ), kicad_y( c.y ) ) ); dseg->SetStart( wxPoint( kicad_x( c.x ), kicad_y( c.y ) ) );
dseg->SetEnd( wxPoint( kicad_x( c.x + c.radius ), kicad_y( c.y ) ) ); dseg->SetEnd( wxPoint( kicad_x( c.x + c.radius ), kicad_y( c.y ) ) );
dseg->SetWidth( kicad( c.width ) ); dseg->SetWidth( kicad( c.width ) );
m_xpath->pop();
} }
// This seems to be a simplified rectangular [copper] zone, cannot find any // This seems to be a simplified rectangular [copper] zone, cannot find any
// net related info on it from the DTD. // net related info on it from the DTD.
else if( !gr->first.compare( "rectangle" ) ) else if( !gr->first.compare( "rectangle" ) )
{ {
#if 0 m_xpath->push( "rectangle" );
ERECT r = erect( gr->second ); ERECT r( gr->second );
int layer = kicad_layer( r.layer ); int layer = kicad_layer( r.layer );
// hope the angle of rotation is zero.
// might be better off making this into a ZONE:
if( IsValidCopperLayerIndex( layer ) ) if( IsValidCopperLayerIndex( layer ) )
{ {
auto_ptr<DRAWSEGMENT> dseg = new DRAWSEGMENT( m_board ); // use a "netcode = 0" type ZONE:
ZONE_CONTAINER* zone = new ZONE_CONTAINER( m_board );
m_board->Add( zone, ADD_APPEND );
dseg->SetTimeStamp( timeStamp( gr->second ) ); zone->SetTimeStamp( timeStamp( gr->second ) );
dseg->SetLayer( layer ); zone->SetLayer( layer );
dseg->SetShape( S_POLYGON ); zone->SetNet( 0 );
dseg->SetWidth( Mils2iu( 12 ) );
std::vector<wxPoint> pts; int outline_hatch = CPolyLine::DIAGONAL_EDGE;
pts.push_back( wxPoint( kicad_x( r.x1 ), kicad_y( r.y1 ) ) ); zone->m_Poly->Start( layer, kicad_x( r.x1 ), kicad_y( r.y1 ), outline_hatch );
pts.push_back( wxPoint( kicad_x( r.x2 ), kicad_y( r.y1 ) ) ); zone->AppendCorner( wxPoint( kicad_x( r.x2 ), kicad_y( r.y1 ) ) );
pts.push_back( wxPoint( kicad_x( r.x2 ), kicad_y( r.y2 ) ) ); zone->AppendCorner( wxPoint( kicad_x( r.x2 ), kicad_y( r.y2 ) ) );
pts.push_back( wxPoint( kicad_x( r.x1 ), kicad_y( r.y2 ) ) ); zone->AppendCorner( wxPoint( kicad_x( r.x1 ), kicad_y( r.y2 ) ) );
dseg->SetPolyPoints( pts ); zone->m_Poly->Close();
m_board->Add( dseg.release(), ADD_APPEND ); // this is not my fault:
zone->m_Poly->SetHatch( outline_hatch,
Mils2iu( zone->m_Poly->GetDefaultHatchPitchMils() ) );
} }
#elif 0 m_xpath->pop();
// use a "netcode = 0" type ZONE:
auto_ptr<ZONE_CONTAINER> zone = new ZONE_CONTAINER( m_board );
;
m_board->Add( zone.release(), ADD_APPEND );
#endif
} }
else if( !gr->first.compare( "hole" ) ) else if( !gr->first.compare( "hole" ) )
{ {
// there's a hole here m_xpath->push( "hole" );
EHOLE e( gr->second );
// Fabricate a MODULE with a single PAD_HOLE_NOT_PLATED pad.
// Use m_hole_count to gen up a unique name.
MODULE* module = new MODULE( m_board );
m_board->Add( module, ADD_APPEND );
char temp[40];
sprintf( temp, "@HOLE%d", m_hole_count++ );
module->SetReference( FROM_UTF8( temp ) );
module->Reference().SetVisible( false );
wxPoint pos( kicad_x( e.x ), kicad_y( e.y ) );
module->SetPosition( pos );
// Add a PAD_HOLE_NOT_PLATED pad to this module.
D_PAD* pad = new D_PAD( module );
module->m_Pads.PushBack( pad );
pad->SetShape( PAD_ROUND );
pad->SetAttribute( PAD_HOLE_NOT_PLATED );
/* pad's position is already centered on module at relative (0, 0)
wxPoint padpos( kicad_x( e.x ), kicad_y( e.y ) );
pad->SetPos0( padpos );
pad->SetPosition( padpos + module->GetPosition() );
*/
wxSize sz( kicad( e.drill ), kicad( e.drill ) );
pad->SetDrillSize( sz );
pad->SetSize( sz );
pad->SetLayerMask( ALL_CU_LAYERS /* | SOLDERMASK_LAYER_BACK | SOLDERMASK_LAYER_FRONT */ );
m_xpath->pop();
} }
else if( !gr->first.compare( "frame" ) ) else if( !gr->first.compare( "frame" ) )
{ {
// picture this // picture this
} }
else if( !gr->first.compare( "polygon" ) ) else if( !gr->first.compare( "polygon" ) )
{ {
// step up, be a man // could be on a copper layer, could be on another layer.
// copper layer would be done using netCode=0 type of ZONE_CONTAINER.
} }
} }
m_xpath->pop();
} }
void EAGLE_PLUGIN::loadLibraries( CPTREE& aLibs, const std::string& aXpath ) void EAGLE_PLUGIN::loadLibraries( CPTREE& aLibs )
{ {
m_xpath->push( "libraries.library", "name" );
for( CITER library = aLibs.begin(); library != aLibs.end(); ++library ) for( CITER library = aLibs.begin(); library != aLibs.end(); ++library )
{ {
const std::string& lib_name = library->second.get<std::string>( "<xmlattr>.name" ); const std::string& lib_name = library->second.get<std::string>( "<xmlattr>.name" );
// library will have <xmlattr> node, skip that and get the packages node m_xpath->Value( lib_name.c_str() );
{
m_xpath->push( "packages" );
// library will have <xmlattr> node, skip that and get the single packages node
CPTREE& packages = library->second.get_child( "packages" ); CPTREE& packages = library->second.get_child( "packages" );
// Create a MODULE for all the eagle packages, for use later via a copy constructor // Create a MODULE for all the eagle packages, for use later via a copy constructor
...@@ -525,15 +1351,17 @@ void EAGLE_PLUGIN::loadLibraries( CPTREE& aLibs, const std::string& aXpath ) ...@@ -525,15 +1351,17 @@ void EAGLE_PLUGIN::loadLibraries( CPTREE& aLibs, const std::string& aXpath )
for( CITER package = packages.begin(); package != packages.end(); ++package ) for( CITER package = packages.begin(); package != packages.end(); ++package )
{ {
m_xpath->push( "package", "name" );
const std::string& pack_name = package->second.get<std::string>( "<xmlattr>.name" ); const std::string& pack_name = package->second.get<std::string>( "<xmlattr>.name" );
#if defined(DEBUG) #if defined(DEBUG)
if( !pack_name.compare( "TO220H" ) ) if( !pack_name.compare( "TO220H" ) )
{ {
int breakhere = 1; int breakhere = 1;
(void) breakhere; (void) breakhere;
} }
#endif #endif
m_xpath->Value( pack_name.c_str() );
std::string key = makeKey( lib_name, pack_name ); std::string key = makeKey( lib_name, pack_name );
...@@ -554,70 +1382,53 @@ void EAGLE_PLUGIN::loadLibraries( CPTREE& aLibs, const std::string& aXpath ) ...@@ -554,70 +1382,53 @@ void EAGLE_PLUGIN::loadLibraries( CPTREE& aLibs, const std::string& aXpath )
); );
THROW_IO_ERROR( emsg ); THROW_IO_ERROR( emsg );
} }
m_xpath->pop();
}
m_xpath->pop(); // "packages"
} }
} }
m_xpath->pop();
} }
void EAGLE_PLUGIN::loadElements( CPTREE& aElements, const std::string& aXpath ) void EAGLE_PLUGIN::loadElements( CPTREE& aElements )
{ {
m_xpath->push( "elements.element", "name" );
for( CITER it = aElements.begin(); it != aElements.end(); ++it ) for( CITER it = aElements.begin(); it != aElements.end(); ++it )
{ {
if( it->first.compare( "element" ) ) if( it->first.compare( "element" ) )
continue; continue;
CPTREE& attrs = it->second.get_child( "<xmlattr>" ); EELEMENT e( it->second );
/*
a '*' means zero or more times
<!ELEMENT element (attribute*, variant*)>
<!ATTLIST element
name %String; #REQUIRED
library %String; #REQUIRED
package %String; #REQUIRED
value %String; #REQUIRED
x %Coord; #REQUIRED
y %Coord; #REQUIRED
locked %Bool; "no"
smashed %Bool; "no"
rot %Rotation; "R0"
>
*/
std::string name = attrs.get<std::string>( "name" ); m_xpath->Value( e.name.c_str() );
std::string library = attrs.get<std::string>( "library" );
std::string package = attrs.get<std::string>( "package" );
std::string value = attrs.get<std::string>( "value" );
#if 1 && defined(DEBUG) #if 1 && defined(DEBUG)
if( !name.compare( "GROUND" ) ) if( !e.value.compare( "LP2985-33DBVR" ) )
{ {
int breakhere = 1; int breakhere = 1;
(void) breakhere; (void) breakhere;
} }
#endif #endif
double x = attrs.get<double>( "x" ); std::string key = makeKey( e.library, e.package );
double y = attrs.get<double>( "y" );
opt_string rot = attrs.get_optional<std::string>( "rot" );
std::string key = makeKey( library, package );
MODULE_CITER mi = m_templates.find( key ); MODULE_CITER mi = m_templates.find( key );
if( mi == m_templates.end() ) if( mi == m_templates.end() )
{ {
wxString emsg = wxString::Format( _( "No '%s' package in library '%s'" ), wxString emsg = wxString::Format( _( "No '%s' package in library '%s'" ),
GetChars( FROM_UTF8( package.c_str() ) ), GetChars( FROM_UTF8( e.package.c_str() ) ),
GetChars( FROM_UTF8( library.c_str() ) ) ); GetChars( FROM_UTF8( e.library.c_str() ) ) );
THROW_IO_ERROR( emsg ); THROW_IO_ERROR( emsg );
} }
#if defined(DEBUG) #if defined(DEBUG)
if( !name.compare( "IC3" ) ) if( !e.name.compare( "ATMEGA328" ) )
{ {
int breakhere = 1; int breakhere = 1;
(void) breakhere; (void) breakhere;
...@@ -628,322 +1439,123 @@ void EAGLE_PLUGIN::loadElements( CPTREE& aElements, const std::string& aXpath ) ...@@ -628,322 +1439,123 @@ void EAGLE_PLUGIN::loadElements( CPTREE& aElements, const std::string& aXpath )
MODULE* m = new MODULE( *mi->second ); MODULE* m = new MODULE( *mi->second );
m_board->Add( m, ADD_APPEND ); m_board->Add( m, ADD_APPEND );
// update the nets within the pads of the clone
for( D_PAD* pad = m->m_Pads; pad; pad = pad->Next() ) for( D_PAD* pad = m->m_Pads; pad; pad = pad->Next() )
{ {
const ENET& enet = m_pads_to_nets[ makeKey( name, TO_UTF8( pad->GetPadName())) ]; std::string key = makeKey( e.name, TO_UTF8( pad->GetPadName() ) );
D(printf( "refname:'%s' pad:'%s' netcode:%d netname:'%s'\n",
name.c_str(), TO_UTF8( pad->GetPadName() ),
enet.netcode,
enet.netname.c_str()
);)
if( enet.netname.size() ) NET_MAP_CITER ni = m_pads_to_nets.find( key );
if( ni != m_pads_to_nets.end() )
{ {
pad->SetNetname( FROM_UTF8( enet.netname.c_str() ) ); const ENET* enet = &ni->second;
pad->SetNet( enet.netcode ); pad->SetNetname( FROM_UTF8( enet->netname.c_str() ) );
pad->SetNet( enet->netcode );
} }
} }
m->SetPosition( wxPoint( kicad_x( x ), kicad_y( y ) ) ); m->SetPosition( wxPoint( kicad_x( e.x ), kicad_y( e.y ) ) );
m->SetReference( FROM_UTF8( name.c_str() ) ); m->SetReference( FROM_UTF8( e.name.c_str() ) );
m->SetValue( FROM_UTF8( value.c_str() ) ); m->SetValue( FROM_UTF8( e.value.c_str() ) );
// m->Value().SetVisible( false ); // m->Value().SetVisible( false );
if( rot ) if( e.rot )
{ {
EROT r = erot( *rot ); m->SetOrientation( e.rot->degrees * 10 );
m->SetOrientation( r.degrees * 10 ); if( e.rot->mirror )
if( r.mirror )
{ {
m->Flip( m->GetPosition() ); m->Flip( m->GetPosition() );
} }
} }
m_xpath->push( "attribute", "name" );
// VALUE and NAME can have something like our text "effects" overrides // VALUE and NAME can have something like our text "effects" overrides
// in SWEET and new schematic. Eagle calls these XML elements "attribute". // in SWEET and new schematic. Eagle calls these XML elements "attribute".
// There can be one for NAME and/or VALUE both. // There can be one for NAME and/or VALUE both. Features present in the
CA_ITER_RANGE attributes = it->second.equal_range( "attribute" ); // EATTR override the ones established in the package only if they are
for( CA_ITER ait = attributes.first; ait != attributes.second; ++ait ) // present here (except for rot, which if not present means angle zero).
// So the logic is a bit different than in packageText() and in plain text.
for( CITER ait = it->second.begin(); ait != it->second.end(); ++ait )
{ {
double ratio = 6; if( ait->first.compare( "attribute" ) )
EATTR a = eattr( ait->second ); continue;
EATTR a( ait->second );
TEXTE_MODULE* txt; TEXTE_MODULE* txt;
if( !a.name.compare( "NAME" ) ) if( !a.name.compare( "NAME" ) )
txt = &m->Reference(); txt = &m->Reference();
else // "VALUE" or else our understanding of file format is incomplete. else if( !a.name.compare( "VALUE" ) )
txt = &m->Value(); txt = &m->Value();
if( a.value )
{
txt->SetText( FROM_UTF8( a.value->c_str() ) );
}
if( a.x && a.y ) // boost::optional
{
wxPoint pos( kicad_x( *a.x ), kicad_y( *a.y ) );
wxPoint pos0 = pos - m->GetPosition();
txt->SetPosition( pos );
txt->SetPos0( pos0 );
}
if( a.ratio )
ratio = *a.ratio;
if( a.size )
{
wxSize fontz = kicad_fontz( *a.size );
txt->SetSize( fontz );
int lw = int( fontz.y * ratio / 100.0 );
txt->SetThickness( lw );
}
if( a.erot )
{
double angle = a.erot->degrees * 10;
if( angle != 1800 )
{
angle -= m->GetOrientation(); // subtract module's angle
txt->SetOrientation( angle );
}
else else
{ {
txt->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT ); // our understanding of file format is incomplete?
txt->SetVertJustify( GR_TEXT_VJUSTIFY_TOP ); continue;
}
}
}
}
}
EWIRE EAGLE_PLUGIN::ewire( CPTREE& aWire ) const
{
EWIRE w;
CPTREE& attribs = aWire.get_child( "<xmlattr>" );
w.x1 = attribs.get<double>( "x1" );
w.y1 = attribs.get<double>( "y1" );
w.x2 = attribs.get<double>( "x2" );
w.y2 = attribs.get<double>( "y2" );
w.width = attribs.get<double>( "width" );
w.layer = attribs.get<int>( "layer" );
return w;
}
EVIA EAGLE_PLUGIN::evia( CPTREE& aVia ) const
{
EVIA v;
CPTREE& attribs = aVia.get_child( "<xmlattr>" );
/*
<!ELEMENT via EMPTY>
<!ATTLIST via
x %Coord; #REQUIRED
y %Coord; #REQUIRED
extent %Extent; #REQUIRED
drill %Dimension; #REQUIRED
diameter %Dimension; "0"
shape %ViaShape; "round"
alwaysstop %Bool; "no"
>
*/
v.x = attribs.get<double>( "x" );
v.y = attribs.get<double>( "y" );
std::string ext = attribs.get<std::string>( "extent" );
sscanf( ext.c_str(), "%u-%u", &v.layer_start, &v.layer_end );
v.drill = attribs.get<double>( "drill" );
v.diam = attribs.get_optional<double>( "diameter" );
v.shape = attribs.get_optional<std::string>( "shape" );
return v;
}
ECIRCLE EAGLE_PLUGIN::ecircle( CPTREE& aCircle ) const
{
ECIRCLE c;
CPTREE& attribs = aCircle.get_child( "<xmlattr>" );
c.x = attribs.get<double>( "x" );
c.y = attribs.get<double>( "y" );
c.radius = attribs.get<double>( "radius" );
c.width = attribs.get<double>( "width" );
c.layer = attribs.get<int>( "layer" );
return c;
}
ERECT EAGLE_PLUGIN::erect( CPTREE& aRect ) const
{
ERECT r;
CPTREE& attribs = aRect.get_child( "<xmlattr>" );
/*
<!ELEMENT rectangle EMPTY>
<!ATTLIST rectangle
x1 %Coord; #REQUIRED
y1 %Coord; #REQUIRED
x2 %Coord; #REQUIRED
y2 %Coord; #REQUIRED
layer %Layer; #REQUIRED
rot %Rotation; "R0"
>
*/
r.x1 = attribs.get<double>( "x1" );
r.y1 = attribs.get<double>( "y1" );
r.x2 = attribs.get<double>( "x2" );
r.y2 = attribs.get<double>( "y2" );
r.layer = attribs.get<int>( "layer" );
// @todo: hoping that rot is not used
return r;
}
ETEXT EAGLE_PLUGIN::etext( CPTREE& aText ) const
{
ETEXT t;
CPTREE& attribs = aText.get_child( "<xmlattr>" );
/*
<!ELEMENT text (#PCDATA)>
<!ATTLIST text
x %Coord; #REQUIRED
y %Coord; #REQUIRED
size %Dimension; #REQUIRED
layer %Layer; #REQUIRED
font %TextFont; "proportional"
ratio %Int; "8"
rot %Rotation; "R0"
align %Align; "bottom-left"
>
*/
t.text = aText.data();
t.x = attribs.get<double>( "x" );
t.y = attribs.get<double>( "y" );
t.size = attribs.get<double>( "size" );
t.layer = attribs.get<int>( "layer" );
t.font = attribs.get_optional<std::string>( "font" );
t.ratio = attribs.get_optional<double>( "ratio" );
opt_string rot = attribs.get_optional<std::string>( "rot" );
if( rot )
{
t.erot = erot( *rot );
} }
opt_string align = attribs.get_optional<std::string>( "align" ); m_xpath->Value( a.name.c_str() );
if( align )
{
// (bottom-left | bottom-center | bottom-right | center-left |
// center | center-right | top-left | top-center | top-right)
if( !align->compare( "center" ) )
*t.align = ETEXT::CENTER;
else if( !align->compare( "center-right" ) )
*t.align = ETEXT::CENTER_RIGHT;
else if( !align->compare( "top-left" ) )
*t.align = ETEXT::TOP_LEFT;
else if( !align->compare( "top-center" ) )
*t.align = ETEXT::TOP_CENTER;
else if( !align->compare( "top-right" ) )
*t.align = ETEXT::TOP_RIGHT;
else if( !align->compare( "bottom-left" ) )
*t.align = ETEXT::BOTTOM_LEFT;
else if( !align->compare( "bottom-center" ) )
*t.align = ETEXT::BOTTOM_CENTER;
else if( !align->compare( "bottom-right" ) )
*t.align = ETEXT::BOTTOM_RIGHT;
else if( !align->compare( "center-left" ) )
*t.align = ETEXT::CENTER_LEFT;
}
return t;
}
EROT EAGLE_PLUGIN::erot( const std::string& aRot ) const
{
EROT rot;
rot.spin = aRot.find( 'S' ) != aRot.npos;
rot.mirror = aRot.find( 'M' ) != aRot.npos;
rot.degrees = strtod( aRot.c_str() + 1 + int( rot.spin || rot.mirror ), NULL );
return rot; if( a.value )
} {
txt->SetText( FROM_UTF8( a.value->c_str() ) );
}
if( a.x && a.y ) // boost::optional
{
wxPoint pos( kicad_x( *a.x ), kicad_y( *a.y ) );
wxPoint pos0 = pos - m->GetPosition();
EATTR EAGLE_PLUGIN::eattr( CPTREE& aAttribute ) const txt->SetPosition( pos );
{ txt->SetPos0( pos0 );
EATTR a; }
CPTREE& attribs = aAttribute.get_child( "<xmlattr>" );
/* // Even though size and ratio are both optional, I am not seeing
<!ELEMENT attribute EMPTY> // a case where ratio is present but size is not.
<!ATTLIST attribute
name %String; #REQUIRED
value %String; #IMPLIED
x %Coord; #IMPLIED
y %Coord; #IMPLIED
size %Dimension; #IMPLIED
layer %Layer; #IMPLIED
font %TextFont; #IMPLIED
ratio %Int; #IMPLIED
rot %Rotation; "R0"
display %AttributeDisplay; "value" -- only in <element> or <instance> context --
constant %Bool; "no" -- only in <device> context --
>
*/
a.name = attribs.get<std::string>( "name" ); // #REQUIRED if( a.size )
a.value = attribs.get_optional<std::string>( "value" ); {
wxSize fontz = kicad_fontz( *a.size );
txt->SetSize( fontz );
a.x = attribs.get_optional<double>( "x" ); if( a.ratio )
a.y = attribs.get_optional<double>( "y" ); {
double ratio = *a.ratio;
int lw = int( fontz.y * ratio / 100.0 );
txt->SetThickness( lw );
}
}
// KiCad cannot currently put a TEXTE_MODULE on a different layer than the MODULE // The "rot" in a EATTR seems to be assumed to be zero if it is not
// Eagle can it seems. Skip layer. // present, and this zero rotation becomes an override to the
// package's text field. If they did not want zero, they specify
// what they want explicitly.
EROT rot;
a.size = attribs.get_optional<double>( "size" ); if( a.rot )
a.ratio = attribs.get_optional<double>( "ratio" ); rot = *a.rot;
opt_string rot = attribs.get_optional<std::string>( "rot" ); if( rot.spin || (rot.degrees != 180 && rot.degrees != 270) )
if( rot )
{ {
a.erot = erot( *rot ); double angle = rot.degrees * 10;
angle -= m->GetOrientation(); // subtract module's angle
txt->SetOrientation( angle );
} }
else
opt_string display = attribs.get_optional<std::string>( "display" );
if( display )
{ {
// (off | value | name | both) // ETEXT::TOP_RIGHT:
if( !display->compare( "off" ) ) txt->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT );
a.display = EATTR::Off; txt->SetVertJustify( GR_TEXT_VJUSTIFY_TOP );
else if( !display->compare( "value" ) ) }
a.display = EATTR::VALUE;
else if( !display->compare( "name" ) ) txt->SetMirrored( rot.mirror );
a.display = EATTR::NAME;
else if( !display->compare( "both" ) )
a.display = EATTR::BOTH;
} }
return a; m_xpath->pop(); // "attribute"
}
m_xpath->pop(); // "elements.element"
} }
...@@ -992,7 +1604,7 @@ MODULE* EAGLE_PLUGIN::makeModule( CPTREE& aPackage, const std::string& aPkgName ...@@ -992,7 +1604,7 @@ MODULE* EAGLE_PLUGIN::makeModule( CPTREE& aPackage, const std::string& aPkgName
void EAGLE_PLUGIN::packageWire( MODULE* aModule, CPTREE& aTree ) const void EAGLE_PLUGIN::packageWire( MODULE* aModule, CPTREE& aTree ) const
{ {
EWIRE w = ewire( aTree ); EWIRE w( aTree );
int layer = kicad_layer( w.layer ); int layer = kicad_layer( w.layer );
if( IsValidNonCopperLayerIndex( layer ) ) // skip copper package wires if( IsValidNonCopperLayerIndex( layer ) ) // skip copper package wires
...@@ -1006,6 +1618,7 @@ void EAGLE_PLUGIN::packageWire( MODULE* aModule, CPTREE& aTree ) const ...@@ -1006,6 +1618,7 @@ void EAGLE_PLUGIN::packageWire( MODULE* aModule, CPTREE& aTree ) const
dwg->SetStart0( start ); dwg->SetStart0( start );
dwg->SetEnd0( end ); dwg->SetEnd0( end );
dwg->SetLayer( layer ); dwg->SetLayer( layer );
dwg->SetWidth( width ); dwg->SetWidth( width );
} }
...@@ -1014,42 +1627,18 @@ void EAGLE_PLUGIN::packageWire( MODULE* aModule, CPTREE& aTree ) const ...@@ -1014,42 +1627,18 @@ void EAGLE_PLUGIN::packageWire( MODULE* aModule, CPTREE& aTree ) const
void EAGLE_PLUGIN::packagePad( MODULE* aModule, CPTREE& aTree ) const void EAGLE_PLUGIN::packagePad( MODULE* aModule, CPTREE& aTree ) const
{ {
// pay for this tree traversal only once // this is thru hole technology here, no SMDs
CPTREE& attrs = aTree.get_child( "<xmlattr>" ); EPAD e( aTree );
/* from <ealge>/doc/eagle.dtd
<!ELEMENT pad EMPTY>
<!ATTLIST pad
name %String; #REQUIRED
x %Coord; #REQUIRED
y %Coord; #REQUIRED
drill %Dimension; #REQUIRED
diameter %Dimension; "0"
shape %PadShape; "round"
rot %Rotation; "R0"
stop %Bool; "yes"
thermals %Bool; "yes"
first %Bool; "no"
>
*/
D_PAD* pad = new D_PAD( aModule ); D_PAD* pad = new D_PAD( aModule );
aModule->m_Pads.PushBack( pad ); aModule->m_Pads.PushBack( pad );
// the DTD says these must be present, throw exception if not found pad->SetPadName( FROM_UTF8( e.name.c_str() ) );
const std::string& name = attrs.get<std::string>( "name" );
double x = attrs.get<double>( "x" );
double y = attrs.get<double>( "y" );
double drill = attrs.get<double>( "drill" );
// pad's "Position" is not relative to the module's, // pad's "Position" is not relative to the module's,
// whereas Pos0 is relative to the module's but is the unrotated coordinate. // whereas Pos0 is relative to the module's but is the unrotated coordinate.
pad->SetPadName( FROM_UTF8( name.c_str() ) ); wxPoint padpos( kicad_x( e.x ), kicad_y( e.y ) );
wxPoint padpos( kicad_x( x ), kicad_y( y ) );
pad->SetPos0( padpos ); pad->SetPos0( padpos );
...@@ -1057,79 +1646,97 @@ void EAGLE_PLUGIN::packagePad( MODULE* aModule, CPTREE& aTree ) const ...@@ -1057,79 +1646,97 @@ void EAGLE_PLUGIN::packagePad( MODULE* aModule, CPTREE& aTree ) const
pad->SetPosition( padpos + aModule->GetPosition() ); pad->SetPosition( padpos + aModule->GetPosition() );
pad->SetDrillSize( wxSize( kicad( drill ), kicad( drill ) ) ); pad->SetDrillSize( wxSize( kicad( e.drill ), kicad( e.drill ) ) );
pad->SetLayerMask( 0x00C0FFFF ); // should tell it to go through all layers
// Optional according to DTD.
opt_double diameter = attrs.get_optional<double>( "diameter" );
opt_string shape = attrs.get_optional<std::string>( "shape" );
opt_string rot = attrs.get_optional<std::string>( "rot" );
/*
opt_string stop = attrs.get_optional<std::string>( "stop" );
opt_string thermals = attrs.get_optional<std::string>( "thermals" );
opt_string first = attrs.get_optional<std::string>( "first" );
*/
if( diameter ) pad->SetLayerMask( ALL_CU_LAYERS | SOLDERMASK_LAYER_BACK | SOLDERMASK_LAYER_FRONT );
{
int kidiam = kicad( *diameter );
pad->SetSize( wxSize( kidiam, kidiam ) );
}
if( shape ) // if not shape, our default is circle and that matches their default "round" if( e.shape )
{ {
// <!ENTITY % PadShape "(square | round | octagon | long | offset)"> switch( *e.shape )
if( !shape->compare( "round" ) )
wxASSERT( pad->GetShape()==PAD_CIRCLE ); // verify set in D_PAD constructor
else if( !shape->compare( "octagon" ) )
{ {
case EPAD::ROUND:
wxASSERT( pad->GetShape()==PAD_CIRCLE ); // verify set in D_PAD constructor wxASSERT( pad->GetShape()==PAD_CIRCLE ); // verify set in D_PAD constructor
break;
// @todo no KiCad octagonal pad shape, use PAD_CIRCLE for now. case EPAD::OCTAGON:
// no KiCad octagonal pad shape, use PAD_CIRCLE for now.
// pad->SetShape( PAD_OCTAGON ); // pad->SetShape( PAD_OCTAGON );
wxASSERT( pad->GetShape()==PAD_CIRCLE ); // verify set in D_PAD constructor
break;
case EPAD::LONG:
pad->SetShape( PAD_OVAL );
break;
case EPAD::SQUARE:
pad->SetShape( PAD_RECT );
break;
case EPAD::OFFSET:
; // don't know what to do here.
} }
}
else if( !shape->compare( "long" ) ) else
{ {
pad->SetShape( PAD_OVAL ); // if shape is not present, our default is circle and that matches their default "round"
}
wxSize z = pad->GetSize(); if( e.diameter )
z.x *= 2; {
pad->SetSize( z ); int diameter = kicad( *e.diameter );
pad->SetSize( wxSize( diameter, diameter ) );
} }
else if( !shape->compare( "square" ) ) else
{ {
pad->SetShape( PAD_RECT ); // The pad size is optional in the eagle DTD, so we must guess.
// Supply something here that is a minimum copper surround, or otherwise
// 120% of drillz whichever is greater. But for PAD_OVAL, we can use
// a smaller minimum than for a round pad, since there is a larger copper
// body on the elongated ends.
int min_copper;
if( pad->GetShape() == PAD_OVAL )
min_copper = Mils2iu( 4 );
else
min_copper = Mils2iu( 6 );
// minz copper surround as a minimum, otherwise 110% of drillz.
int drillz = pad->GetDrillSize().x;
int diameter = std::max( drillz + 2 * min_copper, int( drillz * 1.2 ) );
pad->SetSize( wxSize( diameter, diameter ) );
} }
if( pad->GetShape() == PAD_OVAL )
{
// The Eagle "long" pad seems to be tall, "width = height x 4/3" apparently.
wxSize sz = pad->GetSize();
sz.x = (sz.x * 4)/3;
pad->SetSize( sz );
} }
if( rot ) if( e.rot )
{ {
EROT r = erot( *rot ); pad->SetOrientation( e.rot->degrees * 10 );
pad->SetOrientation( r.degrees * 10 );
} }
// don't know what stop and thermals should look like now. // @todo: handle stop and thermal
} }
void EAGLE_PLUGIN::packageText( MODULE* aModule, CPTREE& aTree ) const void EAGLE_PLUGIN::packageText( MODULE* aModule, CPTREE& aTree ) const
{ {
int sign = 1; ETEXT t( aTree );
double ratio = 6; int layer = kicad_layer( t.layer );
ETEXT t = etext( aTree );
TEXTE_MODULE* txt; TEXTE_MODULE* txt;
if( !t.text.compare( ">NAME" ) ) if( !t.text.compare( ">NAME" ) || !t.text.compare( ">name" ) )
txt = &aModule->Reference(); txt = &aModule->Reference();
else if( !t.text.compare( ">VALUE" ) ) else if( !t.text.compare( ">VALUE" ) || !t.text.compare( ">value" ) )
txt = &aModule->Value(); txt = &aModule->Value();
else else
return; {
txt = new TEXTE_MODULE( aModule );
aModule->m_Drawings.PushBack( txt );
}
txt->SetTimeStamp( timeStamp( aTree ) ); txt->SetTimeStamp( timeStamp( aTree ) );
txt->SetText( FROM_UTF8( t.text.c_str() ) ); txt->SetText( FROM_UTF8( t.text.c_str() ) );
...@@ -1139,26 +1746,36 @@ void EAGLE_PLUGIN::packageText( MODULE* aModule, CPTREE& aTree ) const ...@@ -1139,26 +1746,36 @@ void EAGLE_PLUGIN::packageText( MODULE* aModule, CPTREE& aTree ) const
txt->SetPosition( pos ); txt->SetPosition( pos );
txt->SetPos0( pos - aModule->GetPosition() ); txt->SetPos0( pos - aModule->GetPosition() );
txt->SetLayer( kicad_layer( t.layer ) ); /*
switch( layer )
{
case COMMENT_N: layer = SILKSCREEN_N_FRONT; break;
}
*/
txt->SetLayer( layer );
txt->SetSize( kicad_fontz( t.size ) ); txt->SetSize( kicad_fontz( t.size ) );
if( t.ratio ) double ratio = t.ratio ? *t.ratio : 8; // DTD says 8 is default
ratio = *t.ratio;
txt->SetThickness( kicad( t.size * ratio / 100 ) ); txt->SetThickness( kicad( t.size * ratio / 100 ) );
if( t.erot ) double angle = t.rot ? t.rot->degrees * 10 : 0;
{
if( t.erot->spin || t.erot->degrees != 180 ) // An eagle package is never rotated, the DTD does not allow it.
txt->SetOrientation( t.erot->degrees * 10 ); // angle -= aModule->GetOrienation();
else // 180 degrees, reverse justification below, don't spin int sign = 1;
if( t.rot )
{ {
if( t.rot->spin || (angle != 1800 && angle != 2700) )
txt->SetOrientation( angle );
else // 180 or 270 degrees, reverse justification below, don't spin
sign = -1; sign = -1;
}
txt->SetMirrored( t.erot->mirror ); txt->SetMirrored( t.rot->mirror );
} }
int align = t.align ? *t.align : ETEXT::BOTTOM_LEFT; // bottom-left is eagle default int align = t.align ? *t.align : ETEXT::BOTTOM_LEFT; // bottom-left is eagle default
...@@ -1210,58 +1827,147 @@ void EAGLE_PLUGIN::packageText( MODULE* aModule, CPTREE& aTree ) const ...@@ -1210,58 +1827,147 @@ void EAGLE_PLUGIN::packageText( MODULE* aModule, CPTREE& aTree ) const
void EAGLE_PLUGIN::packageRectangle( MODULE* aModule, CPTREE& aTree ) const void EAGLE_PLUGIN::packageRectangle( MODULE* aModule, CPTREE& aTree ) const
{ {
/* ERECT r( aTree );
ERECT r = erect( aTree ); int layer = kicad_layer( r.layer );
*/
if( IsValidNonCopperLayerIndex( layer ) ) // skip copper "package.rectangle"s
{
EDGE_MODULE* dwg = new EDGE_MODULE( aModule, S_POLYGON );
aModule->m_Drawings.PushBack( dwg );
dwg->SetLayer( layer );
dwg->SetWidth( 0 );
dwg->SetTimeStamp( timeStamp( aTree ) );
std::vector<wxPoint> pts;
wxPoint start( wxPoint( kicad_x( r.x1 ), kicad_y( r.y1 ) ) );
wxPoint end( wxPoint( kicad_x( r.x1 ), kicad_y( r.y2 ) ) );
pts.push_back( start );
pts.push_back( wxPoint( kicad_x( r.x2 ), kicad_y( r.y1 ) ) );
pts.push_back( wxPoint( kicad_x( r.x2 ), kicad_y( r.y2 ) ) );
pts.push_back( end );
dwg->SetPolyPoints( pts );
dwg->SetStart0( start );
dwg->SetEnd0( end );
}
} }
void EAGLE_PLUGIN::packagePolygon( MODULE* aModule, CPTREE& aTree ) const void EAGLE_PLUGIN::packagePolygon( MODULE* aModule, CPTREE& aTree ) const
{ {
// CPTREE& attrs = aTree.get_child( "<xmlattr>" ); EPOLYGON p( aTree );
int layer = kicad_layer( p.layer );
if( IsValidNonCopperLayerIndex( layer ) ) // skip copper "package.rectangle"s
{
EDGE_MODULE* dwg = new EDGE_MODULE( aModule, S_POLYGON );
aModule->m_Drawings.PushBack( dwg );
dwg->SetWidth( 0 ); // it's filled, no need for boundary width
/*
switch( layer )
{
case ECO1_N: layer = SILKSCREEN_N_FRONT; break;
case ECO2_N: layer = SILKSCREEN_N_BACK; break;
// all MODULE templates (created from eagle packages) are on front layer
// until cloned.
case COMMENT_N: layer = SILKSCREEN_N_FRONT; break;
}
*/
dwg->SetLayer( layer );
dwg->SetTimeStamp( timeStamp( aTree ) );
std::vector<wxPoint> pts;
pts.reserve( aTree.size() );
for( CITER vi = aTree.begin(); vi != aTree.end(); ++vi )
{
if( vi->first.compare( "vertex" ) ) // skip <xmlattr> node
continue;
EVERTEX v( vi->second );
pts.push_back( wxPoint( kicad_x( v.x ), kicad_y( v.y ) ) );
}
dwg->SetPolyPoints( pts );
dwg->SetStart0( *pts.begin() );
dwg->SetEnd0( pts.back() );
}
} }
void EAGLE_PLUGIN::packageCircle( MODULE* aModule, CPTREE& aTree ) const void EAGLE_PLUGIN::packageCircle( MODULE* aModule, CPTREE& aTree ) const
{ {
// CPTREE& attrs = aTree.get_child( "<xmlattr>" ); ECIRCLE e( aTree );
int layer = kicad_layer( e.layer );
EDGE_MODULE* gr = new EDGE_MODULE( aModule, S_CIRCLE );
aModule->m_Drawings.PushBack( gr );
gr->SetWidth( kicad( e.width ) );
/*
switch( layer )
{
case ECO1_N: layer = SILKSCREEN_N_FRONT; break;
case ECO2_N: layer = SILKSCREEN_N_BACK; break;
}
*/
gr->SetLayer( layer );
gr->SetTimeStamp( timeStamp( aTree ) );
gr->SetStart0( wxPoint( kicad_x( e.x ), kicad_y( e.y ) ) );
gr->SetEnd0( wxPoint( kicad_x( e.x + e.radius ), kicad_y( e.y ) ) );
} }
void EAGLE_PLUGIN::packageHole( MODULE* aModule, CPTREE& aTree ) const void EAGLE_PLUGIN::packageHole( MODULE* aModule, CPTREE& aTree ) const
{ {
// CPTREE& attrs = aTree.get_child( "<xmlattr>" ); EHOLE e( aTree );
// we add a PAD_HOLE_NOT_PLATED pad to this module.
D_PAD* pad = new D_PAD( aModule );
aModule->m_Pads.PushBack( pad );
pad->SetShape( PAD_ROUND );
pad->SetAttribute( PAD_HOLE_NOT_PLATED );
// Mechanical purpose only:
// no offset, no net name, no pad name allowed
// pad->SetOffset( wxPoint( 0, 0 ) );
// pad->SetPadName( wxEmptyString );
// pad->SetNetname( wxEmptyString );
wxPoint padpos( kicad_x( e.x ), kicad_y( e.y ) );
pad->SetPos0( padpos );
pad->SetPosition( padpos + aModule->GetPosition() );
wxSize sz( kicad( e.drill ), kicad( e.drill ) );
pad->SetDrillSize( sz );
pad->SetSize( sz );
pad->SetLayerMask( ALL_CU_LAYERS /* | SOLDERMASK_LAYER_BACK | SOLDERMASK_LAYER_FRONT */ );
} }
void EAGLE_PLUGIN::packageSMD( MODULE* aModule, CPTREE& aTree ) const void EAGLE_PLUGIN::packageSMD( MODULE* aModule, CPTREE& aTree ) const
{ {
// pay for this tree traversal only once ESMD e( aTree );
CPTREE& attrs = aTree.get_child( "<xmlattr>" ); int layer = kicad_layer( e.layer );
/*
<!ATTLIST smd
name %String; #REQUIRED
x %Coord; #REQUIRED
y %Coord; #REQUIRED
dx %Dimension; #REQUIRED
dy %Dimension; #REQUIRED
layer %Layer; #REQUIRED
roundness %Int; "0"
rot %Rotation; "R0"
stop %Bool; "yes"
thermals %Bool; "yes"
cream %Bool; "yes"
>
*/
// the DTD says these must be present, throw exception if not found
const std::string& name = attrs.get<std::string>( "name" );
double x = attrs.get<double>( "x" );
double y = attrs.get<double>( "y" );
double dx = attrs.get<double>( "dx" );
double dy = attrs.get<double>( "dy" );
int layer = attrs.get<int>( "layer" );
if( !IsValidCopperLayerIndex( layer ) ) if( !IsValidCopperLayerIndex( layer ) )
{ {
...@@ -1271,15 +1977,14 @@ void EAGLE_PLUGIN::packageSMD( MODULE* aModule, CPTREE& aTree ) const ...@@ -1271,15 +1977,14 @@ void EAGLE_PLUGIN::packageSMD( MODULE* aModule, CPTREE& aTree ) const
D_PAD* pad = new D_PAD( aModule ); D_PAD* pad = new D_PAD( aModule );
aModule->m_Pads.PushBack( pad ); aModule->m_Pads.PushBack( pad );
pad->SetPadName( FROM_UTF8( e.name.c_str() ) );
pad->SetPadName( FROM_UTF8( name.c_str() ) );
pad->SetShape( PAD_RECT ); pad->SetShape( PAD_RECT );
pad->SetAttribute( PAD_SMD ); pad->SetAttribute( PAD_SMD );
// pad's "Position" is not relative to the module's, // pad's "Position" is not relative to the module's,
// whereas Pos0 is relative to the module's but is the unrotated coordinate. // whereas Pos0 is relative to the module's but is the unrotated coordinate.
wxPoint padpos( kicad_x( x ), kicad_y( y ) ); wxPoint padpos( kicad_x( e.x ), kicad_y( e.y ) );
pad->SetPos0( padpos ); pad->SetPos0( padpos );
...@@ -1287,41 +1992,36 @@ void EAGLE_PLUGIN::packageSMD( MODULE* aModule, CPTREE& aTree ) const ...@@ -1287,41 +1992,36 @@ void EAGLE_PLUGIN::packageSMD( MODULE* aModule, CPTREE& aTree ) const
pad->SetPosition( padpos + aModule->GetPosition() ); pad->SetPosition( padpos + aModule->GetPosition() );
pad->SetSize( wxSize( kicad( dx ), kicad( dy ) ) ); pad->SetSize( wxSize( kicad( e.dx ), kicad( e.dy ) ) );
pad->SetLayer( kicad_layer( layer ) ); pad->SetLayer( layer );
pad->SetLayerMask( 0x00888000 ); pad->SetLayerMask( LAYER_FRONT | SOLDERPASTE_LAYER_FRONT | SOLDERMASK_LAYER_FRONT );
// Optional according to DTD // Optional according to DTD
opt_double roundness = attrs.get_optional<double>( "roundness" ); if( e.roundness ) // set set shape to PAD_RECT above, in case roundness is not present
opt_string rot = attrs.get_optional<std::string>( "rot" );
opt_string stop = attrs.get_optional<std::string>( "stop" );
opt_string thermals = attrs.get_optional<std::string>( "thermals" );
opt_string cream = attrs.get_optional<std::string>( "cream" );
if( roundness ) // set set shape to PAD_RECT above, in case roundness is not present
{ {
if( *roundness >= 75 ) // roundness goes from 0-100% if( *e.roundness >= 75 ) // roundness goes from 0-100% as integer
{ {
if( dy == dx ) if( e.dy == e.dx )
pad->SetShape( PAD_ROUND ); pad->SetShape( PAD_ROUND );
else else
pad->SetShape( PAD_OVAL ); pad->SetShape( PAD_OVAL );
} }
} }
if( rot ) if( e.rot )
{ {
EROT r = erot( *rot ); pad->SetOrientation( e.rot->degrees * 10 );
pad->SetOrientation( r.degrees * 10 );
} }
// don't know what stop, thermals, and cream should look like now. // don't know what stop, thermals, and cream should look like now.
} }
void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals, const std::string& aXpath ) void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals )
{ {
m_xpath->push( "signals.signal", "name" );
int netCode = 1; int netCode = 1;
for( CITER net = aSignals.begin(); net != aSignals.end(); ++net, ++netCode ) for( CITER net = aSignals.begin(); net != aSignals.end(); ++net, ++netCode )
...@@ -1329,6 +2029,8 @@ void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals, const std::string& aXpath ) ...@@ -1329,6 +2029,8 @@ void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals, const std::string& aXpath )
const std::string& nname = net->second.get<std::string>( "<xmlattr>.name" ); const std::string& nname = net->second.get<std::string>( "<xmlattr>.name" );
wxString netName = FROM_UTF8( nname.c_str() ); wxString netName = FROM_UTF8( nname.c_str() );
m_xpath->Value( nname.c_str() );
m_board->AppendNet( new NETINFO_ITEM( m_board, netName, netCode ) ); m_board->AppendNet( new NETINFO_ITEM( m_board, netName, netCode ) );
// (contactref | polygon | wire | via)* // (contactref | polygon | wire | via)*
...@@ -1336,7 +2038,8 @@ void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals, const std::string& aXpath ) ...@@ -1336,7 +2038,8 @@ void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals, const std::string& aXpath )
{ {
if( !it->first.compare( "wire" ) ) if( !it->first.compare( "wire" ) )
{ {
EWIRE w = ewire( it->second ); m_xpath->push( "wire" );
EWIRE w( it->second );
int layer = kicad_layer( w.layer ); int layer = kicad_layer( w.layer );
if( IsValidCopperLayerIndex( layer ) ) if( IsValidCopperLayerIndex( layer ) )
...@@ -1358,23 +2061,26 @@ void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals, const std::string& aXpath ) ...@@ -1358,23 +2061,26 @@ void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals, const std::string& aXpath )
{ {
// put non copper wires where the sun don't shine. // put non copper wires where the sun don't shine.
} }
m_xpath->pop();
} }
else if( !it->first.compare( "via" ) ) else if( !it->first.compare( "via" ) )
{ {
EVIA v = evia( it->second ); m_xpath->push( "via" );
EVIA v( it->second );
int layer_start = kicad_layer( v.layer_start ); int layer_front_most = kicad_layer( v.layer_front_most );
int layer_end = kicad_layer( v.layer_end ); int layer_back_most = kicad_layer( v.layer_back_most );
if( IsValidCopperLayerIndex( layer_start ) && if( IsValidCopperLayerIndex( layer_front_most ) &&
IsValidCopperLayerIndex( layer_end ) ) IsValidCopperLayerIndex( layer_back_most ) )
{ {
int drill = kicad( v.drill ); int drillz = kicad( v.drill );
SEGVIA* via = new SEGVIA( m_board ); SEGVIA* via = new SEGVIA( m_board );
m_board->m_Track.Insert( via, NULL );
via->SetLayerPair( layer_start, layer_end ); via->SetLayerPair( layer_front_most, layer_back_most );
// via diameters are externally controllable, not usually in a board: // via diameters are externally controllable, not usually in a board:
// http://www.eaglecentral.ca/forums/index.php/mv/msg/34704/119478/ // http://www.eaglecentral.ca/forums/index.php/mv/msg/34704/119478/
...@@ -1384,9 +2090,19 @@ void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals, const std::string& aXpath ) ...@@ -1384,9 +2090,19 @@ void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals, const std::string& aXpath )
via->SetWidth( kidiam ); via->SetWidth( kidiam );
} }
else else
via->SetWidth( drill * 3 ); {
int diameter = std::max( drillz + 2 * Mils2iu( 6 ), int( drillz * 2.0 ) );
via->SetWidth( diameter );
}
via->SetDrill( drill ); via->SetDrill( drillz );
if( layer_front_most == LAYER_N_FRONT && layer_back_most == LAYER_N_BACK )
via->SetShape( VIA_THROUGH );
else if( layer_front_most == LAYER_N_FRONT || layer_back_most == LAYER_N_BACK )
via->SetShape( VIA_MICROVIA );
else
via->SetShape( VIA_BLIND_BURIED );
via->SetTimeStamp( timeStamp( it->second ) ); via->SetTimeStamp( timeStamp( it->second ) );
...@@ -1398,13 +2114,13 @@ void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals, const std::string& aXpath ) ...@@ -1398,13 +2114,13 @@ void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals, const std::string& aXpath )
via->SetNet( netCode ); via->SetNet( netCode );
via->SetShape( S_CIRCLE ); // @todo should be in SEGVIA constructor via->SetShape( S_CIRCLE ); // @todo should be in SEGVIA constructor
m_board->m_Track.Insert( via, NULL );
} }
m_xpath->pop();
} }
else if( !it->first.compare( "contactref" ) ) else if( !it->first.compare( "contactref" ) )
{ {
m_xpath->push( "contactref" );
// <contactref element="RN1" pad="7"/> // <contactref element="RN1" pad="7"/>
CPTREE& attribs = it->second.get_child( "<xmlattr>" ); CPTREE& attribs = it->second.get_child( "<xmlattr>" );
...@@ -1413,17 +2129,79 @@ void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals, const std::string& aXpath ) ...@@ -1413,17 +2129,79 @@ void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals, const std::string& aXpath )
std::string key = makeKey( reference, pad ) ; std::string key = makeKey( reference, pad ) ;
D(printf( "adding refname:'%s' pad:'%s' netcode:%d netname:'%s'\n", // D(printf( "adding refname:'%s' pad:'%s' netcode:%d netname:'%s'\n", reference.c_str(), pad.c_str(), netCode, nname.c_str() );)
reference.c_str(), pad.c_str(), netCode, nname.c_str() );)
m_pads_to_nets[ key ] = ENET( netCode, nname ); m_pads_to_nets[ key ] = ENET( netCode, nname );
m_xpath->pop();
} }
else if( !it->first.compare( "polygon" ) ) else if( !it->first.compare( "polygon" ) )
{ {
m_xpath->push( "polygon" );
EPOLYGON p( it->second );
int layer = kicad_layer( p.layer );
if( IsValidCopperLayerIndex( layer ) )
{
// use a "netcode = 0" type ZONE:
ZONE_CONTAINER* zone = new ZONE_CONTAINER( m_board );
m_board->Add( zone, ADD_APPEND );
zone->SetTimeStamp( timeStamp( it->second ) );
zone->SetLayer( layer );
zone->SetNet( netCode );
zone->SetNetName( netName );
int outline_hatch = CPolyLine::DIAGONAL_EDGE;
bool first = true;
for( CITER vi = it->second.begin(); vi != it->second.end(); ++vi )
{
if( vi->first.compare( "vertex" ) ) // skip <xmlattr> node
continue;
EVERTEX v( vi->second );
// the ZONE_CONTAINER API needs work, as you can see:
if( first )
{
zone->m_Poly->Start( layer, kicad_x( v.x ), kicad_y( v.y ), outline_hatch );
first = false;
}
else
zone->AppendCorner( wxPoint( kicad_x( v.x ), kicad_y( v.y ) ) );
}
zone->m_Poly->Close();
zone->m_Poly->SetHatch( outline_hatch,
Mils2iu( zone->m_Poly->GetDefaultHatchPitchMils() ) );
// clearances, etc.
zone->SetArcSegCount( 32 ); // @todo: should be a constructor default?
zone->SetMinThickness( kicad( p.width ) );
if( p.spacing )
zone->SetZoneClearance( kicad( *p.spacing ) );
if( p.rank )
zone->SetPriority( *p.rank );
// missing == yes per DTD.
bool thermals = !p.thermals || *p.thermals;
zone->SetPadConnection( thermals ? THERMAL_PAD : PAD_IN_ZONE );
int rank = p.rank ? *p.rank : 0;
zone->SetPriority( rank );
}
m_xpath->pop(); // "polygon"
} }
} }
} }
m_xpath->pop(); // "signals.signal"
} }
...@@ -1547,13 +2325,18 @@ int EAGLE_PLUGIN::kicad_layer( int aEagleLayer ) ...@@ -1547,13 +2325,18 @@ int EAGLE_PLUGIN::kicad_layer( int aEagleLayer )
case 36: kiLayer = ADHESIVE_N_BACK; break; case 36: kiLayer = ADHESIVE_N_BACK; break;
case 49: kiLayer = COMMENT_N; break; case 49: kiLayer = COMMENT_N; break;
case 50: kiLayer = COMMENT_N; break; case 50: kiLayer = COMMENT_N; break;
case 51: kiLayer = ECO1_N; break;
case 52: kiLayer = ECO2_N; break; // Packages show the future chip pins on SMD parts using layer 51.
// This is an area slightly smaller than the PAD/SMD copper area.
// Carry those visual aids into the MODULE on the drawing layer, not silkscreen.
case 51: kiLayer = DRAW_N; break;
case 52: kiLayer = DRAW_N; break;
case 95: kiLayer = ECO1_N; break; case 95: kiLayer = ECO1_N; break;
case 96: kiLayer = ECO2_N; break; case 96: kiLayer = ECO2_N; break;
default: default:
D( printf( "unexpected eagle layer: %d\n", aEagleLayer );) D( printf( "unsupported eagle layer: %d\n", aEagleLayer );)
kiLayer = -1; break; // our eagle understanding is incomplete kiLayer = -1; break; // some layers do not map to KiCad
} }
} }
...@@ -1561,6 +2344,27 @@ int EAGLE_PLUGIN::kicad_layer( int aEagleLayer ) ...@@ -1561,6 +2344,27 @@ int EAGLE_PLUGIN::kicad_layer( int aEagleLayer )
} }
void EAGLE_PLUGIN::centerBoard()
{
/*
if( m_props )
{
const wxString& pageWidth = (*m_props)["page_width"];
const wxString& pageHeight = (*m_props)["page_height"];
if( pageWidth.size() && pageHeight.size() )
{
EDA_RECT bbbox = m_board->GetBoundingBox();
int w = wxAtoi( pageWidth );
int h = wxAtoi( pageHeight );
m_board->Move( );
}
}
*/
}
/* /*
void EAGLE_PLUGIN::Save( const wxString& aFileName, BOARD* aBoard, PROPERTIES* aProperties ) void EAGLE_PLUGIN::Save( const wxString& aFileName, BOARD* aBoard, PROPERTIES* aProperties )
{ {
......
...@@ -57,35 +57,17 @@ struct ENET ...@@ -57,35 +57,17 @@ struct ENET
}; };
typedef std::map< std::string, ENET > NET_MAP; typedef std::map< std::string, ENET > NET_MAP;
typedef NET_MAP::const_iterator NET_MAP_CITER;
/*
#include
namespace boost {
namespace property_tree
{
template < class Key, class Data, class KeyCompare = std::less<Key> >
class basic_ptree;
typedef basic_ptree< std::string, std::string > ptree;
}
}
*/
typedef boost::property_tree::ptree PTREE; typedef boost::property_tree::ptree PTREE;
typedef const PTREE CPTREE; typedef const PTREE CPTREE;
struct EWIRE; class XPATH;
struct EVIA;
struct EROT;
struct EATTR;
struct ECIRCLE;
struct ETEXT;
struct ERECT;
/** /**
* Class EAGLE_PLUGIN * Class EAGLE_PLUGIN
* works with Eagle 6.x XML board files and footprints. * works with Eagle 6.x XML board files and footprints to implement the
* Pcbnew PLUGIN API, or a portion of it.
*/ */
class EAGLE_PLUGIN : public PLUGIN class EAGLE_PLUGIN : public PLUGIN
{ {
...@@ -125,29 +107,39 @@ public: ...@@ -125,29 +107,39 @@ public:
private: private:
NET_MAP m_pads_to_nets; XPATH* m_xpath; ///< keeps track of what we are working on within
///< XML document during a Load().
std::string m_err_path; ///< snapshot m_xpath contentx into here on exception
int m_hole_count; ///< generates unique module names from eagle "hole"s.
NET_MAP m_pads_to_nets; ///< net list
MODULE_MAP m_templates; ///< is part of a MODULE factory that operates MODULE_MAP m_templates; ///< is part of a MODULE factory that operates
///< using copy construction. ///< using copy construction.
///< lookup key is libname.packagename ///< lookup key is libname.packagename
PROPERTIES* m_props; ///< passed via Save() or Load(), no ownership, may be NULL. PROPERTIES* m_props; ///< passed via Save() or Load(), no ownership, may be NULL.
BOARD* m_board; ///< which BOARD is being worked on, no ownership here
BOARD* m_board; ///< which BOARD, no ownership here
double mm_per_biu; ///< how many mm in each BIU double mm_per_biu; ///< how many mm in each BIU
double biu_per_mm; ///< how many bius in a mm double biu_per_mm; ///< how many bius in a mm
/// initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed. /// initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed.
void init( PROPERTIES* aProperties ); void init( PROPERTIES* aProperties );
/// Convert an Eagle distance to a KiCad distance.
int kicad( double d ) const; int kicad( double d ) const;
int kicad_y( double y ) const { return -kicad( y ); } int kicad_y( double y ) const { return -kicad( y ); }
int kicad_x( double x ) const { return kicad( x ); } int kicad_x( double x ) const { return kicad( x ); }
wxSize kicad_fontz( double d ) const;
/// create a font size (fontz) from an eagle font size scalar
wxSize kicad_fontz( double d ) const;
/// Convert an Eagle layer to a KiCad layer.
static int kicad_layer( int aLayer ); static int kicad_layer( int aLayer );
/// Convert a KiCad distance to an Eagle distance.
double eagle( BIU d ) const { return mm_per_biu * d; } double eagle( BIU d ) const { return mm_per_biu * d; }
double eagle_x( BIU x ) const { return eagle( x ); } double eagle_x( BIU x ) const { return eagle( x ); }
double eagle_y( BIU y ) const { return eagle( y ); } double eagle_y( BIU y ) const { return eagle( y ); }
...@@ -180,38 +172,15 @@ private: ...@@ -180,38 +172,15 @@ private:
// all these loadXXX() throw IO_ERROR or ptree_error exceptions: // all these loadXXX() throw IO_ERROR or ptree_error exceptions:
void loadAllSections( CPTREE& aEagleBoard, const std::string& aXpath, bool aAppendToMe ); void loadAllSections( CPTREE& aDocument );
void loadLayerDefs( CPTREE& aLayers );
void loadPlain( CPTREE& aPlain );
void loadSignals( CPTREE& aSignals );
void loadLibraries( CPTREE& aLibs );
void loadElements( CPTREE& aElements );
void loadPlain( CPTREE& aPlain, const std::string& aXpath ); /// move the BOARD into the center of the page
void centerBoard();
void loadSignals( CPTREE& aSignals, const std::string& aXpath );
void loadLibraries( CPTREE& aLibs, const std::string& aXpath );
void loadElements( CPTREE& aElements, const std::string& aXpath );
/**
* Function ewire
* converts a <wire>'s xml attributes to binary without additional conversion.
* @param aResult is an EWIRE to fill in with the <wire> data converted to binary.
*/
EWIRE ewire( CPTREE& aWire ) const;
EVIA evia( CPTREE& aVia ) const;
ECIRCLE ecircle( CPTREE& aCircle ) const;
ETEXT etext( CPTREE& aText ) const;
ERECT erect( CPTREE& aRect ) const;
EROT erot( const std::string& aRot ) const;
/**
* Function eattr
* parses an Eagle "attribute" element. Note that an attribute element
* is different than an XML element attribute. The attribute element is a
* full XML node in and of itself, and has attributes of its own. Blame Eagle.
*/
EATTR eattr( CPTREE& aAttribute ) const;
/** /**
* Function fmtDEG * Function fmtDEG
...@@ -235,7 +204,6 @@ private: ...@@ -235,7 +204,6 @@ private:
void packageCircle( MODULE* aModule, CPTREE& aTree ) const; void packageCircle( MODULE* aModule, CPTREE& aTree ) const;
void packageHole( MODULE* aModule, CPTREE& aTree ) const; void packageHole( MODULE* aModule, CPTREE& aTree ) const;
void packageSMD( MODULE* aModule, CPTREE& aTree ) const; void packageSMD( MODULE* aModule, CPTREE& aTree ) const;
}; };
#endif // EAGLE_PLUGIN_H_ #endif // EAGLE_PLUGIN_H_
...@@ -81,6 +81,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -81,6 +81,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_TOOLBARH_PCB_SELECT_LAYER: case ID_TOOLBARH_PCB_SELECT_LAYER:
case ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR: case ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR:
case ID_POPUP_PCB_ROTATE_TEXTEPCB: case ID_POPUP_PCB_ROTATE_TEXTEPCB:
case ID_POPUP_PCB_FLIP_TEXTEPCB:
case ID_POPUP_PCB_EDIT_TEXTEPCB: case ID_POPUP_PCB_EDIT_TEXTEPCB:
case ID_POPUP_PCB_EDIT_MIRE: case ID_POPUP_PCB_EDIT_MIRE:
case ID_POPUP_PCB_ROTATE_TEXTMODULE: case ID_POPUP_PCB_ROTATE_TEXTMODULE:
...@@ -286,7 +287,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -286,7 +287,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_FIND_ITEMS: case ID_FIND_ITEMS:
InstallFindFrame( pos, &dc ); InstallFindFrame();
break; break;
case ID_POPUP_CLOSE_CURRENT_TOOL: case ID_POPUP_CLOSE_CURRENT_TOOL:
...@@ -578,7 +579,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -578,7 +579,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
{ {
// Remove filled areas in zone // Remove filled areas in zone
ZONE_CONTAINER* zone_container = GetBoard()->GetArea( ii ); ZONE_CONTAINER* zone_container = GetBoard()->GetArea( ii );
zone_container->m_FilledPolysList.clear(); zone_container->ClearFilledPolysList();
} }
SetCurItem( NULL ); // CurItem might be deleted by this command, clear the pointer SetCurItem( NULL ); // CurItem might be deleted by this command, clear the pointer
...@@ -930,6 +931,11 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -930,6 +931,11 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
break; break;
case ID_POPUP_PCB_FLIP_TEXTEPCB:
FlipTextePcb( (TEXTE_PCB*) GetCurItem(), &dc );
m_canvas->MoveCursorToCrossHair();
break;
case ID_POPUP_PCB_DELETE_TEXTEPCB: case ID_POPUP_PCB_DELETE_TEXTEPCB:
Delete_Texte_Pcb( (TEXTE_PCB*) GetCurItem(), &dc ); Delete_Texte_Pcb( (TEXTE_PCB*) GetCurItem(), &dc );
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
...@@ -1078,14 +1084,6 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -1078,14 +1084,6 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
Swap_Layers( event ); Swap_Layers( event );
break; break;
case ID_MENU_PCB_RESET_TEXTMODULE_REFERENCE_SIZES:
ResetModuleTextSizes( TEXT_is_REFERENCE, &dc );
break;
case ID_MENU_PCB_RESET_TEXTMODULE_VALUE_SIZES:
ResetModuleTextSizes( TEXT_is_VALUE, &dc );
break;
case ID_PCB_USER_GRID_SETUP: case ID_PCB_USER_GRID_SETUP:
InstallGridFrame( pos ); InstallGridFrame( pos );
break; break;
......
...@@ -216,7 +216,6 @@ TEXTE_PCB* PCB_EDIT_FRAME::Create_Texte_Pcb( wxDC* DC ) ...@@ -216,7 +216,6 @@ TEXTE_PCB* PCB_EDIT_FRAME::Create_Texte_Pcb( wxDC* DC )
void PCB_EDIT_FRAME::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ) void PCB_EDIT_FRAME::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
{ {
int angle = 900; int angle = 900;
int drawmode = GR_XOR;
if( TextePcb == NULL ) if( TextePcb == NULL )
return; return;
...@@ -228,13 +227,34 @@ void PCB_EDIT_FRAME::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC ) ...@@ -228,13 +227,34 @@ void PCB_EDIT_FRAME::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
NORMALIZE_ANGLE_POS( TextePcb->m_Orient ); NORMALIZE_ANGLE_POS( TextePcb->m_Orient );
/* Redraw text in new position. */ /* Redraw text in new position. */
TextePcb->Draw( m_canvas, DC, drawmode ); TextePcb->Draw( m_canvas, DC, GR_XOR );
TextePcb->DisplayInfo( this ); TextePcb->DisplayInfo( this );
if( TextePcb->GetFlags() == 0 ) // i.e. not edited, or moved if( TextePcb->GetFlags() == 0 ) // i.e. not edited, or moved
SaveCopyInUndoList( TextePcb, UR_ROTATED, TextePcb->m_Pos ); SaveCopyInUndoList( TextePcb, UR_ROTATED, TextePcb->GetPosition() );
else // set flag edit, to show it was a complex command else // set flag edit, to show it was a complex command
TextePcb->SetFlags( IN_EDIT ); TextePcb->SetFlags( IN_EDIT );
OnModify(); OnModify();
} }
void PCB_EDIT_FRAME::FlipTextePcb( TEXTE_PCB* aTextePcb, wxDC* aDC )
{
if( aTextePcb == NULL )
return;
aTextePcb->Draw( m_canvas, aDC, GR_XOR );
aTextePcb->Flip( aTextePcb->GetPosition() );
aTextePcb->Draw( m_canvas, aDC, GR_XOR );
aTextePcb->DisplayInfo( this );
if( aTextePcb->GetFlags() == 0 ) // i.e. not edited, or moved
SaveCopyInUndoList( aTextePcb, UR_FLIPPED, aTextePcb->GetPosition() );
else // set flag edit, to show it was a complex command
aTextePcb->SetFlags( IN_EDIT );
OnModify();
}
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include <macros.h> #include <macros.h>
#include <pcbnew.h> #include <pcbnew.h>
#include <protos.h> #include <wxPcbStruct.h>
#include <class_board.h> #include <class_board.h>
#include <class_module.h> #include <class_module.h>
...@@ -356,107 +356,3 @@ void PCB_BASE_FRAME::ResetTextSize( BOARD_ITEM* aItem, wxDC* aDC ) ...@@ -356,107 +356,3 @@ void PCB_BASE_FRAME::ResetTextSize( BOARD_ITEM* aItem, wxDC* aDC )
OnModify(); OnModify();
} }
void PCB_BASE_FRAME::ResetModuleTextSizes( int aType, wxDC* aDC )
{
MODULE* module;
BOARD_ITEM* boardItem;
TEXTE_MODULE* item;
ITEM_PICKER itemWrapper( NULL, UR_CHANGED );
PICKED_ITEMS_LIST undoItemList;
unsigned int ii;
module = GetBoard()->m_Modules;
// Prepare undo list
while( module )
{
itemWrapper.SetItem( module );
switch( aType )
{
case TEXT_is_REFERENCE:
item = module->m_Reference;
if( item->GetSize() != GetDesignSettings().m_ModuleTextSize || item->GetThickness() != GetDesignSettings().m_ModuleTextWidth )
undoItemList.PushItem( itemWrapper );
break;
case TEXT_is_VALUE:
item = module->m_Value;
if( item->GetSize() != GetDesignSettings().m_ModuleTextSize ||
item->GetThickness() != GetDesignSettings().m_ModuleTextWidth )
undoItemList.PushItem( itemWrapper );
break;
case TEXT_is_DIVERS:
// Go through all other module text fields
for( boardItem = module->m_Drawings; boardItem; boardItem = boardItem->Next() )
{
if( boardItem->Type() == PCB_MODULE_TEXT_T )
{
item = (TEXTE_MODULE*) boardItem;
if( item->GetSize() != GetDesignSettings().m_ModuleTextSize
|| item->GetThickness() != GetDesignSettings().m_ModuleTextWidth )
{
undoItemList.PushItem( itemWrapper );
break;
}
}
}
break;
default:
break;
}
module = module->Next();
}
// Exit if there's nothing to do
if( !undoItemList.GetCount() )
return;
SaveCopyInUndoList( undoItemList, UR_CHANGED );
// Apply changes to modules in the undo list
for( ii = 0; ii < undoItemList.GetCount(); ii++ )
{
module = (MODULE*) undoItemList.GetPickedItem( ii );
switch( aType )
{
case TEXT_is_REFERENCE:
module->m_Reference->SetThickness( GetDesignSettings().m_ModuleTextWidth );
module->m_Reference->SetSize( GetDesignSettings().m_ModuleTextSize );
break;
case TEXT_is_VALUE:
module->m_Value->SetThickness( GetDesignSettings().m_ModuleTextWidth );
module->m_Value->SetSize( GetDesignSettings().m_ModuleTextSize );
break;
case TEXT_is_DIVERS:
for( boardItem = module->m_Drawings; boardItem; boardItem = boardItem->Next() )
{
if( boardItem->Type() == PCB_MODULE_TEXT_T )
{
item = (TEXTE_MODULE*) boardItem;
item->SetThickness( GetDesignSettings().m_ModuleTextWidth );
item->SetSize( GetDesignSettings().m_ModuleTextSize );
}
}
break;
}
}
if( aDC )
m_canvas->Refresh();
OnModify();
}
...@@ -121,8 +121,8 @@ void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event ) ...@@ -121,8 +121,8 @@ void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event )
fn.SetExt( PcbFileExtension ); fn.SetExt( PcbFileExtension );
GetScreen()->SetFileName( fn.GetFullPath() ); GetScreen()->SetFileName( fn.GetFullPath() );
UpdateTitle(); UpdateTitle();
break;
} }
break;
case ID_APPEND_FILE: case ID_APPEND_FILE:
LoadOnePcbFile( wxEmptyString, true ); LoadOnePcbFile( wxEmptyString, true );
...@@ -154,8 +154,6 @@ void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event ) ...@@ -154,8 +154,6 @@ void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event )
bool PCB_EDIT_FRAME::LoadOnePcbFile( const wxString& aFileName, bool aAppend, bool PCB_EDIT_FRAME::LoadOnePcbFile( const wxString& aFileName, bool aAppend,
bool aForceFileDialog ) bool aForceFileDialog )
{ {
wxString msg;
if( GetScreen()->IsModify() && !aAppend ) if( GetScreen()->IsModify() && !aAppend )
{ {
if( !IsOK( this, _( "The current board has been modified. Do you wish to discard \ if( !IsOK( this, _( "The current board has been modified. Do you wish to discard \
...@@ -172,10 +170,34 @@ the changes?" ) ) ) ...@@ -172,10 +170,34 @@ the changes?" ) ) )
wxFileName fileName = aFileName; wxFileName fileName = aFileName;
IO_MGR::PCB_FILE_T pluginType = IO_MGR::LEGACY;
// This is a subset of all PLUGINs which are trusted to be able to
// load a BOARD. Order is subject to change as KICAD plugin matures.
// User may occasionally use the wrong plugin to load a *.brd file,
// but eventually *.kicad_pcb will be more common than legacy *.brd files.
static const struct {
const wxString& filter;
IO_MGR::PCB_FILE_T pluginType;
} loaders[] = {
{ LegacyPcbFileWildcard, IO_MGR::LEGACY },
{ PcbFileWildcard, IO_MGR::KICAD },
{ EaglePcbFileWildcard, IO_MGR::EAGLE },
};
if( !fileName.IsOk() || !fileName.FileExists() || aForceFileDialog ) if( !fileName.IsOk() || !fileName.FileExists() || aForceFileDialog )
{ {
wxString name; wxString name;
wxString path = wxGetCwd(); wxString path = wxGetCwd();
wxString fileFilters;
for( unsigned i=0; i<DIM( loaders ); ++i )
{
if( i > 0 )
fileFilters += wxChar( '|' );
fileFilters += wxGetTranslation( loaders[i].filter );
}
if( aForceFileDialog && fileName.FileExists() ) if( aForceFileDialog && fileName.FileExists() )
{ {
...@@ -183,7 +205,7 @@ the changes?" ) ) ) ...@@ -183,7 +205,7 @@ the changes?" ) ) )
name = fileName.GetFullName(); name = fileName.GetFullName();
} }
wxFileDialog dlg( this, _( "Open Board File" ), path, name, LegacyPcbFileWildcard, wxFileDialog dlg( this, _( "Open Board File" ), path, name, fileFilters,
wxFD_OPEN | wxFD_FILE_MUST_EXIST ); wxFD_OPEN | wxFD_FILE_MUST_EXIST );
if( dlg.ShowModal() == wxID_CANCEL ) if( dlg.ShowModal() == wxID_CANCEL )
...@@ -191,10 +213,15 @@ the changes?" ) ) ) ...@@ -191,10 +213,15 @@ the changes?" ) ) )
fileName = dlg.GetPath(); fileName = dlg.GetPath();
if( !fileName.HasExt() ) int chosenFilter = dlg.GetFilterIndex();
fileName.SetExt( PcbFileExtension ); pluginType = loaders[chosenFilter].pluginType;
} }
PLUGIN::RELEASER pi( IO_MGR::PluginFind( pluginType ) );
if( !fileName.HasExt() )
fileName.SetExt( pi->GetFileExtension() );
if( !aAppend ) if( !aAppend )
Clear_Pcb( false ); // pass false since we prompted above for a modified board Clear_Pcb( false ); // pass false since we prompted above for a modified board
...@@ -223,14 +250,18 @@ the changes?" ) ) ) ...@@ -223,14 +250,18 @@ the changes?" ) ) )
try try
{ {
PROPERTIES props;
props["page_width"] = wxString::Format( wxT( "%d" ), GetPageSizeIU().x );
props["page_height"] = wxString::Format( wxT( "%d" ), GetPageSizeIU().y );
// load or append either: // load or append either:
loadedBoard = IO_MGR::Load( IO_MGR::LEGACY, GetScreen()->GetFileName(), loadedBoard = pi->Load( GetScreen()->GetFileName(), aAppend ? GetBoard() : NULL, &props );
aAppend ? GetBoard() : NULL,
NULL );
if( !aAppend ) if( !aAppend )
{ {
if( loadedBoard->GetFileFormatVersionAtLoad() < LEGACY_BOARD_FILE_VERSION ) if( pluginType == IO_MGR::LEGACY &&
loadedBoard->GetFileFormatVersionAtLoad() < LEGACY_BOARD_FILE_VERSION )
{ {
DisplayInfoMessage( this, _( "This file was created by an older \ DisplayInfoMessage( this, _( "This file was created by an older \
version of Pcbnew. It will be stored in the new file format when you save \ version of Pcbnew. It will be stored in the new file format when you save \
......
/**
* @file pcbnew/find.cpp
* @brief Pcbnew find dialog box implementation.
*/
#include <fctsys.h>
#include <gr_basic.h>
#include <class_drawpanel.h>
#include <confirm.h>
#include <kicad_string.h>
#include <wxPcbStruct.h>
#include <class_board.h>
#include <class_module.h>
#include <class_marker_pcb.h>
#include <pcbnew.h>
#include <pcbnew_id.h>
#include <protos.h>
#include <find.h>
static wxString s_OldStringFound;
static int s_ItemCount, s_MarkerCount;
void PCB_EDIT_FRAME::InstallFindFrame( const wxPoint& pos, wxDC* DC )
{
WinEDA_PcbFindFrame* frame = new WinEDA_PcbFindFrame( this, DC, pos );
frame->ShowModal();
frame->Destroy();
}
void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event )
{
PCB_SCREEN* screen = (PCB_SCREEN*) ( m_Parent->GetScreen() );
wxPoint locate_pos;
wxString msg;
bool FindMarker = false;
BOARD_ITEM* foundItem = 0;
switch( event.GetId() )
{
case ID_FIND_ITEM:
s_ItemCount = 0;
break;
case ID_FIND_MARKER:
s_MarkerCount = 0;
// fall thru
case ID_FIND_NEXT_MARKER:
FindMarker = true;
break;
}
s_OldStringFound = m_NewText->GetValue();
m_Parent->GetCanvas()->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y );
if( FindMarker )
{
MARKER_PCB* marker = m_Parent->GetBoard()->GetMARKER( s_MarkerCount++ );
if( marker )
{
foundItem = marker;
locate_pos = marker->GetPosition();
}
}
else
{
int StartCount = 0;
for( MODULE* module = m_Parent->GetBoard()->m_Modules; module; module = module->Next() )
{
if( WildCompareString( s_OldStringFound, module->GetReference().GetData(), false ) )
{
StartCount++;
if( StartCount > s_ItemCount )
{
foundItem = module;
locate_pos = module->GetPosition();
s_ItemCount++;
break;
}
}
if( WildCompareString( s_OldStringFound, module->m_Value->m_Text.GetData(), false ) )
{
StartCount++;
if( StartCount > s_ItemCount )
{
foundItem = module;
locate_pos = module->m_Pos;
s_ItemCount++;
break;
}
}
}
}
if( foundItem )
{
m_Parent->SetCurItem( foundItem );
if( FindMarker )
msg = _( "Marker found" );
else
msg.Printf( _( "<%s> Found" ), GetChars( s_OldStringFound ) );
m_Parent->SetStatusText( msg );
m_Parent->CursorGoto( locate_pos );
EndModal( 1 );
}
else
{
m_Parent->SetStatusText( wxEmptyString );
if( FindMarker )
msg = _( "Marker not found" );
else
msg.Printf( _( "<%s> Not Found" ), GetChars( s_OldStringFound ) );
DisplayError( this, msg, 10 );
EndModal( 0 );
}
}
/*!
* WinEDA_PcbFindFrame type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WinEDA_PcbFindFrame, wxDialog )
/*!
* WinEDA_PcbFindFrame event table definition
*/
BEGIN_EVENT_TABLE( WinEDA_PcbFindFrame, wxDialog )
////@begin WinEDA_PcbFindFrame event table entries
EVT_BUTTON( ID_FIND_ITEM, WinEDA_PcbFindFrame::OnFindItemClick )
EVT_BUTTON( ID_FIND_NEXT_ITEM, WinEDA_PcbFindFrame::OnFindNextItemClick )
EVT_BUTTON( ID_FIND_MARKER, WinEDA_PcbFindFrame::OnFindMarkerClick )
EVT_BUTTON( ID_FIND_NEXT_MARKER, WinEDA_PcbFindFrame::OnFindNextMarkerClick )
////@end WinEDA_PcbFindFrame event table entries
END_EVENT_TABLE()
/*!
* WinEDA_PcbFindFrame constructors
*/
WinEDA_PcbFindFrame::WinEDA_PcbFindFrame()
{
}
WinEDA_PcbFindFrame::WinEDA_PcbFindFrame( PCB_BASE_FRAME* parent,
wxDC* DC,
const wxPoint& pos,
wxWindowID id,
const wxString& caption,
const wxSize& size,
long style )
{
m_Parent = parent;
m_DC = DC;
Create( parent, id, caption, pos, size, style );
m_NewText->SetFocus();
}
/*!
* WinEDA_PcbFindFrame creator
*/
bool WinEDA_PcbFindFrame::Create( wxWindow* parent,
wxWindowID id,
const wxString& caption,
const wxPoint& pos,
const wxSize& size,
long style )
{
////@begin WinEDA_PcbFindFrame member initialisation
m_NewText = NULL;
////@end WinEDA_PcbFindFrame member initialisation
////@begin WinEDA_PcbFindFrame creation
SetExtraStyle( wxWS_EX_BLOCK_EVENTS );
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
if( GetSizer() )
{
GetSizer()->SetSizeHints( this );
}
Centre();
////@end WinEDA_PcbFindFrame creation
return true;
}
/*!
* Control creation for WinEDA_PcbFindFrame
*/
void WinEDA_PcbFindFrame::CreateControls()
{
////@begin WinEDA_PcbFindFrame content construction
// Generated by DialogBlocks, 29/04/2009 15:15:49 (unregistered)
WinEDA_PcbFindFrame* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxVERTICAL );
itemDialog1->SetSizer( itemBoxSizer2 );
wxStaticText* itemStaticText3 = new wxStaticText( itemDialog1,
wxID_STATIC,
_( "Item to find:" ),
wxDefaultPosition,
wxDefaultSize,
0 );
itemBoxSizer2->Add( itemStaticText3,
0,
wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 );
m_NewText = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T( "" ),
wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer2->Add( m_NewText, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
wxBoxSizer* itemBoxSizer5 = new wxBoxSizer( wxHORIZONTAL );
itemBoxSizer2->Add( itemBoxSizer5,
0,
wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT |
wxBOTTOM,
5 );
wxBoxSizer* itemBoxSizer6 = new wxBoxSizer( wxVERTICAL );
itemBoxSizer5->Add( itemBoxSizer6,
0,
wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT,
5 );
wxButton* itemButton7 =
new wxButton( itemDialog1, ID_FIND_ITEM, _( "Find Item" ),
wxDefaultPosition, wxDefaultSize, 0 );
itemButton7->SetDefault();
itemBoxSizer6->Add( itemButton7, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 );
wxButton* itemButton8 =
new wxButton( itemDialog1, ID_FIND_NEXT_ITEM, _( "Find Next Item" ),
wxDefaultPosition, wxDefaultSize,
0 );
itemBoxSizer6->Add( itemButton8,
0,
wxGROW | wxLEFT | wxRIGHT | wxBOTTOM,
5 );
wxBoxSizer* itemBoxSizer9 = new wxBoxSizer( wxVERTICAL );
itemBoxSizer5->Add( itemBoxSizer9,
0,
wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT,
5 );
wxButton* itemButton10 =
new wxButton( itemDialog1, ID_FIND_MARKER, _( "Find Marker" ),
wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add( itemButton10, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 );
wxButton* itemButton11 = new wxButton( itemDialog1,
ID_FIND_NEXT_MARKER,
_( "Find Next Marker" ),
wxDefaultPosition,
wxDefaultSize,
0 );
itemBoxSizer9->Add( itemButton11,
0,
wxGROW | wxLEFT | wxRIGHT | wxBOTTOM,
5 );
////@end WinEDA_PcbFindFrame content construction
}
/*!
* Should we show tooltips?
*/
bool WinEDA_PcbFindFrame::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WinEDA_PcbFindFrame::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WinEDA_PcbFindFrame bitmap retrieval
wxUnusedVar( name );
return wxNullBitmap;
////@end WinEDA_PcbFindFrame bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon WinEDA_PcbFindFrame::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WinEDA_PcbFindFrame icon retrieval
wxUnusedVar( name );
return wxNullIcon;
////@end WinEDA_PcbFindFrame icon retrieval
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_FIND_ITEM
*/
void WinEDA_PcbFindFrame::OnFindItemClick( wxCommandEvent& event )
{
FindItem( event );
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_FIND_NEXT_ITEM
*/
void WinEDA_PcbFindFrame::OnFindNextItemClick( wxCommandEvent& event )
{
FindItem( event );
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_FIND_MARKER
*/
void WinEDA_PcbFindFrame::OnFindMarkerClick( wxCommandEvent& event )
{
FindItem( event );
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_FIND_NEXT_MARKER
*/
void WinEDA_PcbFindFrame::OnFindNextMarkerClick( wxCommandEvent& event )
{
FindItem( event );
}
/////////////////////////////////////////////////////////////////////////////
// Name: find.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 04/03/2006 13:58:04
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 04/03/2006 13:58:04
#ifndef _FIND_H_
#define _FIND_H_
/*!
* Includes
*/
////@begin includes
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10000
#define ID_TEXTCTRL 10001
#define ID_FIND_ITEM 10002
#define ID_FIND_NEXT_ITEM 10003
#define ID_FIND_MARKER 10004
#define ID_FIND_NEXT_MARKER 10005
#define SYMBOL_WINEDA_PCBFINDFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER
#define SYMBOL_WINEDA_PCBFINDFRAME_TITLE _("Find")
#define SYMBOL_WINEDA_PCBFINDFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_PCBFINDFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_PCBFINDFRAME_POSITION wxDefaultPosition
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*!
* WinEDA_PcbFindFrame class declaration
*/
class WinEDA_PcbFindFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( WinEDA_PcbFindFrame )
DECLARE_EVENT_TABLE()
public:
/// Constructors
WinEDA_PcbFindFrame( );
WinEDA_PcbFindFrame( PCB_BASE_FRAME* parent,
wxDC * DC, const wxPoint& pos = SYMBOL_WINEDA_PCBFINDFRAME_POSITION,
wxWindowID id = SYMBOL_WINEDA_PCBFINDFRAME_IDNAME,
const wxString& caption = SYMBOL_WINEDA_PCBFINDFRAME_TITLE,
const wxSize& size = SYMBOL_WINEDA_PCBFINDFRAME_SIZE,
long style = SYMBOL_WINEDA_PCBFINDFRAME_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_PCBFINDFRAME_IDNAME,
const wxString& caption = SYMBOL_WINEDA_PCBFINDFRAME_TITLE,
const wxPoint& pos = SYMBOL_WINEDA_PCBFINDFRAME_POSITION,
const wxSize& size = SYMBOL_WINEDA_PCBFINDFRAME_SIZE,
long style = SYMBOL_WINEDA_PCBFINDFRAME_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin WinEDA_PcbFindFrame event handler declarations
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_FIND_ITEM
void OnFindItemClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_FIND_NEXT_ITEM
void OnFindNextItemClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_FIND_MARKER
void OnFindMarkerClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_FIND_NEXT_MARKER
void OnFindNextMarkerClick( wxCommandEvent& event );
////@end WinEDA_PcbFindFrame event handler declarations
////@begin WinEDA_PcbFindFrame member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end WinEDA_PcbFindFrame member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
void FindItem(wxCommandEvent& event);
void FindMarker(wxCommandEvent& event);
////@begin WinEDA_PcbFindFrame member variables
wxTextCtrl* m_NewText;
////@end WinEDA_PcbFindFrame member variables
PCB_BASE_FRAME * m_Parent;
wxDC * m_DC;
};
#endif
// _FIND_H_
...@@ -67,7 +67,7 @@ static EDA_HOTKEY HkPlaceItem( wxT( "Place Item" ), HK_PLACE_ITEM, 'P' ); ...@@ -67,7 +67,7 @@ static EDA_HOTKEY HkPlaceItem( wxT( "Place Item" ), HK_PLACE_ITEM, 'P' );
static EDA_HOTKEY HkAddMicroVia( wxT( "Add MicroVia" ), HK_ADD_MICROVIA, 'V' + GR_KB_CTRL ); static EDA_HOTKEY HkAddMicroVia( wxT( "Add MicroVia" ), HK_ADD_MICROVIA, 'V' + GR_KB_CTRL );
static EDA_HOTKEY HkEndTrack( wxT( "End Track" ), HK_END_TRACK, WXK_END ); static EDA_HOTKEY HkEndTrack( wxT( "End Track" ), HK_END_TRACK, WXK_END );
static EDA_HOTKEY HkEditBoardItem( wxT( "Edit Item" ), HK_EDIT_ITEM, 'E' ); static EDA_HOTKEY HkEditBoardItem( wxT( "Edit Item" ), HK_EDIT_ITEM, 'E' );
static EDA_HOTKEY HkFlipFootprint( wxT( "Flip Footprint" ), HK_FLIP_FOOTPRINT, 'F' ); static EDA_HOTKEY HkFlipItem( wxT( "Flip Item" ), HK_FLIP_ITEM, 'F' );
static EDA_HOTKEY HkRotateItem( wxT( "Rotate Item" ), HK_ROTATE_ITEM, 'R' ); static EDA_HOTKEY HkRotateItem( wxT( "Rotate Item" ), HK_ROTATE_ITEM, 'R' );
static EDA_HOTKEY HkMoveItem( wxT( "Move Item" ), HK_MOVE_ITEM, 'M' ); static EDA_HOTKEY HkMoveItem( wxT( "Move Item" ), HK_MOVE_ITEM, 'M' );
static EDA_HOTKEY HkDragFootprint( wxT( "Drag Footprint" ), HK_DRAG_ITEM, 'G' ); static EDA_HOTKEY HkDragFootprint( wxT( "Drag Footprint" ), HK_DRAG_ITEM, 'G' );
...@@ -210,8 +210,8 @@ EDA_HOTKEY* board_edit_Hotkey_List[] = ...@@ -210,8 +210,8 @@ EDA_HOTKEY* board_edit_Hotkey_List[] =
&HkSwitchTrackPosture, &HkSwitchTrackPosture,
&HkDragTrackKeepSlope, &HkDragTrackKeepSlope,
&HkPlaceItem, &HkPlaceItem,
&HkEndTrack, &HkMoveItem, &HkEndTrack, &HkMoveItem, &HkFlipItem,
&HkFlipFootprint, &HkRotateItem, &HkDragFootprint, &HkRotateItem, &HkDragFootprint,
&HkGetAndMoveFootprint, &HkLock_Unlock_Footprint, &HkSavefile, &HkGetAndMoveFootprint, &HkLock_Unlock_Footprint, &HkSavefile,
&HkLoadfile, &HkFindItem, &HkEditBoardItem, &HkLoadfile, &HkFindItem, &HkEditBoardItem,
&HkSwitch2CopperLayer, &HkSwitch2InnerLayer1, &HkSwitch2CopperLayer, &HkSwitch2InnerLayer1,
......
...@@ -14,9 +14,9 @@ enum hotkey_id_commnand { ...@@ -14,9 +14,9 @@ enum hotkey_id_commnand {
HK_DELETE = HK_COMMON_END, HK_DELETE = HK_COMMON_END,
HK_BACK_SPACE, HK_BACK_SPACE,
HK_ROTATE_ITEM, HK_ROTATE_ITEM,
HK_FLIP_ITEM,
HK_MOVE_ITEM, HK_MOVE_ITEM,
HK_DRAG_ITEM, HK_DRAG_ITEM,
HK_FLIP_FOOTPRINT,
HK_GET_AND_MOVE_FOOTPRINT, HK_GET_AND_MOVE_FOOTPRINT,
HK_LOCK_UNLOCK_FOOTPRINT, HK_LOCK_UNLOCK_FOOTPRINT,
HK_ADD_NEW_TRACK, HK_ADD_NEW_TRACK,
......
...@@ -624,9 +624,10 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit ...@@ -624,9 +624,10 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
OnHotkeyRotateItem( HK_ROTATE_ITEM ); OnHotkeyRotateItem( HK_ROTATE_ITEM );
break; break;
case HK_FLIP_FOOTPRINT: // move to other side case HK_FLIP_ITEM:
OnHotkeyRotateItem( HK_FLIP_FOOTPRINT ); OnHotkeyRotateItem( HK_FLIP_ITEM );
break; break;
case HK_SWITCH_HIGHCONTRAST_MODE: // switch to high contrast mode and refresh the canvas case HK_SWITCH_HIGHCONTRAST_MODE: // switch to high contrast mode and refresh the canvas
DisplayOpt.ContrastModeDisplay = !DisplayOpt.ContrastModeDisplay; DisplayOpt.ContrastModeDisplay = !DisplayOpt.ContrastModeDisplay;
m_canvas->Refresh(); m_canvas->Refresh();
...@@ -1002,7 +1003,7 @@ bool PCB_EDIT_FRAME::OnHotkeyRotateItem( int aIdCommand ) ...@@ -1002,7 +1003,7 @@ bool PCB_EDIT_FRAME::OnHotkeyRotateItem( int aIdCommand )
if( aIdCommand == HK_ROTATE_ITEM ) // Rotation if( aIdCommand == HK_ROTATE_ITEM ) // Rotation
evt_type = ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE; evt_type = ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE;
if( aIdCommand == HK_FLIP_FOOTPRINT ) // move to other side if( aIdCommand == HK_FLIP_ITEM ) // move to other side
evt_type = ID_POPUP_PCB_CHANGE_SIDE_MODULE; evt_type = ID_POPUP_PCB_CHANGE_SIDE_MODULE;
} }
break; break;
...@@ -1010,6 +1011,8 @@ bool PCB_EDIT_FRAME::OnHotkeyRotateItem( int aIdCommand ) ...@@ -1010,6 +1011,8 @@ bool PCB_EDIT_FRAME::OnHotkeyRotateItem( int aIdCommand )
case PCB_TEXT_T: case PCB_TEXT_T:
if( aIdCommand == HK_ROTATE_ITEM ) // Rotation if( aIdCommand == HK_ROTATE_ITEM ) // Rotation
evt_type = ID_POPUP_PCB_ROTATE_TEXTEPCB; evt_type = ID_POPUP_PCB_ROTATE_TEXTEPCB;
else if( aIdCommand == HK_FLIP_ITEM )
evt_type = ID_POPUP_PCB_FLIP_TEXTEPCB;
break; break;
......
...@@ -970,7 +970,7 @@ void PCB_IO::format( ZONE_CONTAINER* aZone, OUTPUTFORMATTER* aFormatter, int aNe ...@@ -970,7 +970,7 @@ void PCB_IO::format( ZONE_CONTAINER* aZone, OUTPUTFORMATTER* aFormatter, int aNe
} }
// Save the PolysList // Save the PolysList
const std::vector< CPolyPt >& fv = aZone->m_FilledPolysList; const std::vector< CPolyPt >& fv = aZone->GetFilledPolysList();
if( fv.size() ) if( fv.size() )
{ {
......
...@@ -2258,6 +2258,7 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER() ...@@ -2258,6 +2258,7 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER()
else if( TESTLINE( "$POLYSCORNERS" ) ) else if( TESTLINE( "$POLYSCORNERS" ) )
{ {
// Read the PolysList (polygons used for fill areas in the zone) // Read the PolysList (polygons used for fill areas in the zone)
std::vector<CPolyPt> polysList;
while( READLINE( m_reader ) ) while( READLINE( m_reader ) )
{ {
...@@ -2273,8 +2274,9 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER() ...@@ -2273,8 +2274,9 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER()
bool end_contour = intParse( data, &data ); // end_countour was a bool when file saved, so '0' or '1' here bool end_contour = intParse( data, &data ); // end_countour was a bool when file saved, so '0' or '1' here
int utility = intParse( data ); int utility = intParse( data );
zc->m_FilledPolysList.push_back( CPolyPt( x, y, end_contour, utility ) ); polysList.push_back( CPolyPt( x, y, end_contour, utility ) );
} }
zc->AddFilledPolysList( polysList );
} }
else if( TESTLINE( "$FILLSEGMENTS" ) ) else if( TESTLINE( "$FILLSEGMENTS" ) )
...@@ -3569,7 +3571,7 @@ void LEGACY_PLUGIN::saveZONE_CONTAINER( const ZONE_CONTAINER* me ) const ...@@ -3569,7 +3571,7 @@ void LEGACY_PLUGIN::saveZONE_CONTAINER( const ZONE_CONTAINER* me ) const
} }
// Save the PolysList // Save the PolysList
const CPOLY_PTS& fv = me->m_FilledPolysList; const CPOLY_PTS& fv = me->GetFilledPolysList();
if( fv.size() ) if( fv.size() )
{ {
fprintf( m_fp, "$POLYSCORNERS\n" ); fprintf( m_fp, "$POLYSCORNERS\n" );
......
...@@ -295,15 +295,9 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -295,15 +295,9 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
KiBitmap( swap_layer_xpm ) ); KiBitmap( swap_layer_xpm ) );
// Reset module reference sizes // Reset module reference sizes
AddMenuItem( editMenu, ID_MENU_PCB_RESET_TEXTMODULE_REFERENCE_SIZES, AddMenuItem( editMenu, ID_MENU_PCB_RESET_TEXTMODULE_FIELDS_SIZES,
_( "Reset Module &Reference Sizes" ), _( "&Reset Module Field Sizes" ),
_( "Reset text size and width of all module references to current defaults" ), _( "Reset text size and width of all module fields to current defaults" ),
KiBitmap( reset_text_xpm ) );
// Reset module value sizes
AddMenuItem( editMenu, ID_MENU_PCB_RESET_TEXTMODULE_VALUE_SIZES,
_( "Reset Module &Value Sizes" ),
_( "Reset text size and width of all module values to current defaults" ),
KiBitmap( reset_text_xpm ) ); KiBitmap( reset_text_xpm ) );
/** Create View menu **/ /** Create View menu **/
......
...@@ -631,7 +631,7 @@ void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* ...@@ -631,7 +631,7 @@ void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu*
AddMenuItem( zones_menu, ID_POPUP_PCB_FILL_ZONE, _( "Fill Zone" ), AddMenuItem( zones_menu, ID_POPUP_PCB_FILL_ZONE, _( "Fill Zone" ),
KiBitmap( fill_zone_xpm ) ); KiBitmap( fill_zone_xpm ) );
if( edge_zone->m_FilledPolysList.size() > 0 ) if( edge_zone->GetFilledPolysList().size() > 0 )
{ {
AddMenuItem( zones_menu, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_CURRENT_ZONE, AddMenuItem( zones_menu, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_CURRENT_ZONE,
_( "Remove Filled Areas in Zone" ), KiBitmap( zone_unfill_xpm ) ); _( "Remove Filled Areas in Zone" ), KiBitmap( zone_unfill_xpm ) );
...@@ -685,7 +685,7 @@ void PCB_EDIT_FRAME::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* menu ...@@ -685,7 +685,7 @@ void PCB_EDIT_FRAME::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* menu
msg, KiBitmap( rotate_module_pos_xpm ) ); msg, KiBitmap( rotate_module_pos_xpm ) );
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE, AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE,
_( "Rotate -" ), KiBitmap( rotate_module_neg_xpm ) ); _( "Rotate -" ), KiBitmap( rotate_module_neg_xpm ) );
msg = AddHotkeyName( _( "Flip" ), g_Board_Editor_Hokeys_Descr, HK_FLIP_FOOTPRINT ); msg = AddHotkeyName( _( "Flip" ), g_Board_Editor_Hokeys_Descr, HK_FLIP_ITEM );
AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_CHANGE_SIDE_MODULE, AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_CHANGE_SIDE_MODULE,
msg, KiBitmap( invert_module_xpm ) ); msg, KiBitmap( invert_module_xpm ) );
...@@ -839,6 +839,8 @@ void PCB_EDIT_FRAME::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu ) ...@@ -839,6 +839,8 @@ void PCB_EDIT_FRAME::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu )
msg = AddHotkeyName( _( "Rotate" ), g_Board_Editor_Hokeys_Descr, HK_ROTATE_ITEM ); msg = AddHotkeyName( _( "Rotate" ), g_Board_Editor_Hokeys_Descr, HK_ROTATE_ITEM );
AddMenuItem( sub_menu_Text, ID_POPUP_PCB_ROTATE_TEXTEPCB, msg, KiBitmap( rotate_ccw_xpm ) ); AddMenuItem( sub_menu_Text, ID_POPUP_PCB_ROTATE_TEXTEPCB, msg, KiBitmap( rotate_ccw_xpm ) );
msg = AddHotkeyName( _( "Flip" ), g_Board_Editor_Hokeys_Descr, HK_FLIP_ITEM );
AddMenuItem( sub_menu_Text, ID_POPUP_PCB_FLIP_TEXTEPCB, msg, KiBitmap( invert_module_xpm ) );
msg = AddHotkeyName( _( "Edit" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); msg = AddHotkeyName( _( "Edit" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM );
AddMenuItem( sub_menu_Text, ID_POPUP_PCB_EDIT_TEXTEPCB, msg, KiBitmap( edit_text_xpm ) ); AddMenuItem( sub_menu_Text, ID_POPUP_PCB_EDIT_TEXTEPCB, msg, KiBitmap( edit_text_xpm ) );
AddMenuItem( sub_menu_Text, ID_POPUP_PCB_RESET_TEXT_SIZE, AddMenuItem( sub_menu_Text, ID_POPUP_PCB_RESET_TEXT_SIZE,
......
...@@ -135,10 +135,8 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME ) ...@@ -135,10 +135,8 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
EVT_MENU( ID_PCB_GLOBAL_DELETE, PCB_EDIT_FRAME::Process_Special_Functions ) EVT_MENU( ID_PCB_GLOBAL_DELETE, PCB_EDIT_FRAME::Process_Special_Functions )
EVT_MENU( ID_MENU_PCB_CLEAN, PCB_EDIT_FRAME::Process_Special_Functions ) EVT_MENU( ID_MENU_PCB_CLEAN, PCB_EDIT_FRAME::Process_Special_Functions )
EVT_MENU( ID_MENU_PCB_SWAP_LAYERS, PCB_EDIT_FRAME::Process_Special_Functions ) EVT_MENU( ID_MENU_PCB_SWAP_LAYERS, PCB_EDIT_FRAME::Process_Special_Functions )
EVT_MENU( ID_MENU_PCB_RESET_TEXTMODULE_REFERENCE_SIZES, EVT_MENU( ID_MENU_PCB_RESET_TEXTMODULE_FIELDS_SIZES,
PCB_EDIT_FRAME::Process_Special_Functions ) PCB_EDIT_FRAME::OnResetModuleTextSizes )
EVT_MENU( ID_MENU_PCB_RESET_TEXTMODULE_VALUE_SIZES,
PCB_EDIT_FRAME::Process_Special_Functions )
// Menu Help // Menu Help
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp ) EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
......
...@@ -66,6 +66,7 @@ enum pcbnew_ids ...@@ -66,6 +66,7 @@ enum pcbnew_ids
ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST, ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST,
ID_POPUP_PCB_ROTATE_TEXTEPCB, ID_POPUP_PCB_ROTATE_TEXTEPCB,
ID_POPUP_PCB_FLIP_TEXTEPCB,
ID_POPUP_PCB_EDIT_TEXTEPCB, ID_POPUP_PCB_EDIT_TEXTEPCB,
ID_POPUP_PCB_DELETE_TEXTEPCB, ID_POPUP_PCB_DELETE_TEXTEPCB,
...@@ -219,8 +220,7 @@ enum pcbnew_ids ...@@ -219,8 +220,7 @@ enum pcbnew_ids
ID_MENU_LIST_NETS, ID_MENU_LIST_NETS,
ID_MENU_PCB_CLEAN, ID_MENU_PCB_CLEAN,
ID_MENU_PCB_SWAP_LAYERS, ID_MENU_PCB_SWAP_LAYERS,
ID_MENU_PCB_RESET_TEXTMODULE_REFERENCE_SIZES, ID_MENU_PCB_RESET_TEXTMODULE_FIELDS_SIZES,
ID_MENU_PCB_RESET_TEXTMODULE_VALUE_SIZES,
ID_GEN_EXPORT_FILE_VRML, ID_GEN_EXPORT_FILE_VRML,
ID_GEN_EXPORT_SPECCTRA, ID_GEN_EXPORT_SPECCTRA,
......
...@@ -523,7 +523,8 @@ void PlotTextePcb( PLOTTER* aPlotter, const PCB_PLOT_PARAMS& aPlotOpts, TEXTE_PC ...@@ -523,7 +523,8 @@ void PlotTextePcb( PLOTTER* aPlotter, const PCB_PLOT_PARAMS& aPlotOpts, TEXTE_PC
*/ */
void PlotFilledAreas( PLOTTER* aPlotter, const PCB_PLOT_PARAMS& aPlotOpts, ZONE_CONTAINER* aZone, EDA_DRAW_MODE_T trace_mode ) void PlotFilledAreas( PLOTTER* aPlotter, const PCB_PLOT_PARAMS& aPlotOpts, ZONE_CONTAINER* aZone, EDA_DRAW_MODE_T trace_mode )
{ {
unsigned imax = aZone->m_FilledPolysList.size(); std::vector<CPolyPt> polysList = aZone->GetFilledPolysList();
unsigned imax = polysList.size();
if( imax == 0 ) // Nothing to draw if( imax == 0 ) // Nothing to draw
return; return;
...@@ -540,7 +541,7 @@ void PlotFilledAreas( PLOTTER* aPlotter, const PCB_PLOT_PARAMS& aPlotOpts, ZONE_ ...@@ -540,7 +541,7 @@ void PlotFilledAreas( PLOTTER* aPlotter, const PCB_PLOT_PARAMS& aPlotOpts, ZONE_
*/ */
for( unsigned ic = 0; ic < imax; ic++ ) for( unsigned ic = 0; ic < imax; ic++ )
{ {
CPolyPt* corner = &aZone->m_FilledPolysList[ic]; CPolyPt* corner = &polysList[ic];
cornerList.push_back( wxPoint( corner->x, corner->y) ); cornerList.push_back( wxPoint( corner->x, corner->y) );
if( corner->end_contour ) // Plot the current filled area outline if( corner->end_contour ) // Plot the current filled area outline
......
...@@ -1152,7 +1152,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IO_ERROR ) ...@@ -1152,7 +1152,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IO_ERROR )
PATH* mainPolygon = new PATH( plane, T_polygon ); PATH* mainPolygon = new PATH( plane, T_polygon );
plane->SetShape( mainPolygon ); plane->SetShape( mainPolygon );
plane->name = TO_UTF8( item->m_Netname ); plane->name = TO_UTF8( item->GetNetName() );
if( plane->name.size() == 0 ) if( plane->name.size() == 0 )
{ {
......
...@@ -800,7 +800,7 @@ void PCB_EDIT_FRAME::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* aZone ) ...@@ -800,7 +800,7 @@ void PCB_EDIT_FRAME::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* aZone )
NETINFO_ITEM* net = GetBoard()->FindNet( zoneInfo.m_NetcodeSelection ); NETINFO_ITEM* net = GetBoard()->FindNet( zoneInfo.m_NetcodeSelection );
if( net ) // net == NULL should not occur if( net ) // net == NULL should not occur
aZone->m_Netname = net->GetNetname(); aZone->SetNetName( net->GetNetname() );
// Combine zones if possible // Combine zones if possible
GetBoard()->AreaPolygonModified( &_AuxiliaryList, aZone, true, s_Verbose ); GetBoard()->AreaPolygonModified( &_AuxiliaryList, aZone, true, s_Verbose );
......
...@@ -105,7 +105,7 @@ int PCB_EDIT_FRAME::Fill_Zone( ZONE_CONTAINER* aZone ) ...@@ -105,7 +105,7 @@ int PCB_EDIT_FRAME::Fill_Zone( ZONE_CONTAINER* aZone )
wxBusyCursor dummy; // Shows an hourglass cursor (removed by its destructor) wxBusyCursor dummy; // Shows an hourglass cursor (removed by its destructor)
aZone->m_FilledPolysList.clear(); aZone->ClearFilledPolysList();
aZone->UnFill(); aZone->UnFill();
aZone->BuildFilledPolysListData( GetBoard() ); aZone->BuildFilledPolysListData( GetBoard() );
......
...@@ -471,6 +471,7 @@ int CopyPolygonsFromKPolygonListToFilledPolysList( ZONE_CONTAINER* aZone, ...@@ -471,6 +471,7 @@ int CopyPolygonsFromKPolygonListToFilledPolysList( ZONE_CONTAINER* aZone,
KPolygonSet& aKPolyList ) KPolygonSet& aKPolyList )
{ {
int count = 0; int count = 0;
std::vector<CPolyPt> polysList;
for( unsigned ii = 0; ii < aKPolyList.size(); ii++ ) for( unsigned ii = 0; ii < aKPolyList.size(); ii++ )
{ {
...@@ -487,14 +488,15 @@ int CopyPolygonsFromKPolygonListToFilledPolysList( ZONE_CONTAINER* aZone, ...@@ -487,14 +488,15 @@ int CopyPolygonsFromKPolygonListToFilledPolysList( ZONE_CONTAINER* aZone,
// Flag this corner if starting a hole connection segment: // Flag this corner if starting a hole connection segment:
// This is used by draw functions to draw only useful segments (and not extra segments) // This is used by draw functions to draw only useful segments (and not extra segments)
// corner.utility = (aBoolengine->GetPolygonPointEdgeType() == KB_FALSE_EDGE) ? 1 : 0; // corner.utility = (aBoolengine->GetPolygonPointEdgeType() == KB_FALSE_EDGE) ? 1 : 0;
aZone->m_FilledPolysList.push_back( corner ); polysList.push_back( corner );
count++; count++;
} }
corner.end_contour = true; corner.end_contour = true;
aZone->m_FilledPolysList.pop_back(); polysList.pop_back();
aZone->m_FilledPolysList.push_back( corner ); polysList.push_back( corner );
} }
aZone->AddFilledPolysList( polysList );
return count; return count;
} }
...@@ -503,7 +505,8 @@ int CopyPolygonsFromKPolygonListToFilledPolysList( ZONE_CONTAINER* aZone, ...@@ -503,7 +505,8 @@ int CopyPolygonsFromKPolygonListToFilledPolysList( ZONE_CONTAINER* aZone,
int CopyPolygonsFromFilledPolysListTotKPolygonList( ZONE_CONTAINER* aZone, int CopyPolygonsFromFilledPolysListTotKPolygonList( ZONE_CONTAINER* aZone,
KPolygonSet& aKPolyList ) KPolygonSet& aKPolyList )
{ {
unsigned corners_count = aZone->m_FilledPolysList.size(); std::vector<CPolyPt> polysList = aZone->GetFilledPolysList();
unsigned corners_count = polysList.size();
int count = 0; int count = 0;
unsigned ic = 0; unsigned ic = 0;
...@@ -511,7 +514,7 @@ int CopyPolygonsFromFilledPolysListTotKPolygonList( ZONE_CONTAINER* aZone, ...@@ -511,7 +514,7 @@ int CopyPolygonsFromFilledPolysListTotKPolygonList( ZONE_CONTAINER* aZone,
for( unsigned ii = 0; ii < corners_count; ii++ ) for( unsigned ii = 0; ii < corners_count; ii++ )
{ {
CPolyPt* corner = &aZone->m_FilledPolysList[ic]; CPolyPt* corner = &polysList[ic];
if( corner->end_contour ) if( corner->end_contour )
polycount++; polycount++;
...@@ -527,7 +530,7 @@ int CopyPolygonsFromFilledPolysListTotKPolygonList( ZONE_CONTAINER* aZone, ...@@ -527,7 +530,7 @@ int CopyPolygonsFromFilledPolysListTotKPolygonList( ZONE_CONTAINER* aZone,
{ {
for( ; ic < corners_count; ic++ ) for( ; ic < corners_count; ic++ )
{ {
CPolyPt* corner = &aZone->m_FilledPolysList[ic]; CPolyPt* corner = &polysList[ic];
cornerslist.push_back( KPolyPoint( corner->x, corner->y ) ); cornerslist.push_back( KPolyPoint( corner->x, corner->y ) );
count++; count++;
......
...@@ -74,7 +74,6 @@ DIALOG_NON_COPPER_ZONES_EDITOR::DIALOG_NON_COPPER_ZONES_EDITOR( PCB_BASE_FRAME* ...@@ -74,7 +74,6 @@ DIALOG_NON_COPPER_ZONES_EDITOR::DIALOG_NON_COPPER_ZONES_EDITOR( PCB_BASE_FRAME*
void DIALOG_NON_COPPER_ZONES_EDITOR::Init() void DIALOG_NON_COPPER_ZONES_EDITOR::Init()
{ {
SetFocus();
SetReturnCode( ZONE_ABORT ); // Will be changed on button click SetReturnCode( ZONE_ABORT ); // Will be changed on button click
m_FillModeCtrl->SetSelection( m_settings.m_FillMode ? 1 : 0 ); m_FillModeCtrl->SetSelection( m_settings.m_FillMode ? 1 : 0 );
......
...@@ -28,7 +28,7 @@ void Merge_SubNets_Connected_By_CopperAreas( BOARD* aPcb, int aNetcode ); ...@@ -28,7 +28,7 @@ void Merge_SubNets_Connected_By_CopperAreas( BOARD* aPcb, int aNetcode );
bool sort_areas( const ZONE_CONTAINER* ref, const ZONE_CONTAINER* tst ) bool sort_areas( const ZONE_CONTAINER* ref, const ZONE_CONTAINER* tst )
{ {
if( ref->GetNet() == tst->GetNet() ) if( ref->GetNet() == tst->GetNet() )
return ref->m_FilledPolysList.size() < tst->m_FilledPolysList.size(); return ref->GetFilledPolysList().size() < tst->GetFilledPolysList().size();
else else
return ref->GetNet() < tst->GetNet(); return ref->GetNet() < tst->GetNet();
} }
...@@ -71,7 +71,7 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode ) ...@@ -71,7 +71,7 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode )
continue; continue;
if( (aNetcode >= 0) && ( aNetcode != curr_zone->GetNet() ) ) if( (aNetcode >= 0) && ( aNetcode != curr_zone->GetNet() ) )
continue; continue;
if( curr_zone->m_FilledPolysList.size() == 0 ) if( curr_zone->GetFilledPolysList().size() == 0 )
continue; continue;
zones_candidates.push_back(curr_zone); zones_candidates.push_back(curr_zone);
} }
...@@ -120,10 +120,11 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode ) ...@@ -120,10 +120,11 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode )
// test if a candidate is inside a filled area of this zone // test if a candidate is inside a filled area of this zone
unsigned indexstart = 0, indexend; unsigned indexstart = 0, indexend;
for( indexend = 0; indexend < curr_zone->m_FilledPolysList.size(); indexend++ ) std::vector<CPolyPt> polysList = curr_zone->GetFilledPolysList();
for( indexend = 0; indexend < polysList.size(); indexend++ )
{ {
// end of a filled sub-area found // end of a filled sub-area found
if( curr_zone->m_FilledPolysList[indexend].end_contour ) if( polysList[indexend].end_contour )
{ {
subnet++; subnet++;
EDA_RECT bbox = curr_zone->CalculateSubAreaBoundaryBox( indexstart, indexend ); EDA_RECT bbox = curr_zone->CalculateSubAreaBoundaryBox( indexstart, indexend );
...@@ -162,7 +163,7 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode ) ...@@ -162,7 +163,7 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode )
if( bbox.Contains( pos1 ) ) if( bbox.Contains( pos1 ) )
{ {
if( TestPointInsidePolygon( curr_zone->m_FilledPolysList, indexstart, if( TestPointInsidePolygon( polysList, indexstart,
indexend, pos1.x, pos1.y ) ) indexend, pos1.x, pos1.y ) )
connected = true; connected = true;
} }
...@@ -170,7 +171,7 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode ) ...@@ -170,7 +171,7 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode )
{ {
if( bbox.Contains( pos2 ) ) if( bbox.Contains( pos2 ) )
{ {
if( TestPointInsidePolygon( curr_zone->m_FilledPolysList, if( TestPointInsidePolygon( polysList,
indexstart, indexend, indexstart, indexend,
pos2.x, pos2.y ) ) pos2.x, pos2.y ) )
connected = true; connected = true;
......
...@@ -282,7 +282,7 @@ int BOARD::ClipAreaPolygon( PICKED_ITEMS_LIST * aNewZonesList, ...@@ -282,7 +282,7 @@ int BOARD::ClipAreaPolygon( PICKED_ITEMS_LIST * aNewZonesList,
{ {
wxString str; wxString str;
str.Printf( wxT( "Area %08lX of net \"%s\" has arcs intersecting other sides.\n" ), str.Printf( wxT( "Area %08lX of net \"%s\" has arcs intersecting other sides.\n" ),
aCurrArea->GetTimeStamp(), GetChars( aCurrArea->m_Netname ) ); aCurrArea->GetTimeStamp(), GetChars( aCurrArea->GetNetName() ) );
str += wxT( "This may cause problems with other editing operations,\n" ); str += wxT( "This may cause problems with other editing operations,\n" );
str += wxT( "such as adding cutouts. It can't be fixed automatically.\n" ); str += wxT( "such as adding cutouts. It can't be fixed automatically.\n" );
str += wxT( "Manual correction is recommended." ); str += wxT( "Manual correction is recommended." );
...@@ -305,7 +305,7 @@ int BOARD::ClipAreaPolygon( PICKED_ITEMS_LIST * aNewZonesList, ...@@ -305,7 +305,7 @@ int BOARD::ClipAreaPolygon( PICKED_ITEMS_LIST * aNewZonesList,
{ {
wxString str; wxString str;
str.Printf( wxT( "Area %08lX of net \"%s\" is self-intersecting and will be clipped.\n" ), str.Printf( wxT( "Area %08lX of net \"%s\" is self-intersecting and will be clipped.\n" ),
aCurrArea->GetTimeStamp(), GetChars( aCurrArea->m_Netname ) ); aCurrArea->GetTimeStamp(), GetChars( aCurrArea->GetNetName() ) );
str += wxT( "This may result in splitting the area.\n" ); str += wxT( "This may result in splitting the area.\n" );
str += wxT( "If the area is complex, this may take a few seconds." ); str += wxT( "If the area is complex, this may take a few seconds." );
wxMessageBox( str ); wxMessageBox( str );
...@@ -482,7 +482,7 @@ int BOARD::CombineAllAreasInNet( PICKED_ITEMS_LIST* aDeletedList, int aNetCode, ...@@ -482,7 +482,7 @@ int BOARD::CombineAllAreasInNet( PICKED_ITEMS_LIST* aDeletedList, int aNetCode,
str.Printf( wxT( "Areas %d and %d of net \"%s\" intersect, but some of the intersecting sides are arcs.\n" ), str.Printf( wxT( "Areas %d and %d of net \"%s\" intersect, but some of the intersecting sides are arcs.\n" ),
ia1 + 1, ia1 + 1,
ia2 + 1, ia2 + 1,
GetChars( curr_area->m_Netname ) ); GetChars( curr_area->GetNetName() ) );
str += wxT( "Therefore, these areas can't be combined." ); str += wxT( "Therefore, these areas can't be combined." );
wxMessageBox( str ); wxMessageBox( str );
} }
......
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