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()
if( curr_zone->m_FillMode == 0 )
{
// 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 );
}
......@@ -286,14 +286,16 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List()
{
ZONE_CONTAINER* zone = pcb->GetArea( ii );
if( zone->m_FilledPolysList.size() == 0 )
std::vector<CPolyPt> polysList = zone->GetFilledPolysList();
if( polysList.size() == 0 )
continue;
if( zone->m_ZoneMinThickness <= 1 )
continue;
int imax = zone->m_FilledPolysList.size() - 1;
CPolyPt* firstcorner = &zone->m_FilledPolysList[0];
int imax = polysList.size() - 1;
CPolyPt* firstcorner = &polysList[0];
CPolyPt* begincorner = firstcorner;
SEGZONE dummysegment( pcb );
dummysegment.SetLayer( zone->GetLayer() );
......@@ -301,7 +303,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List()
for( int ic = 1; ic <= imax; ic++ )
{
CPolyPt* endcorner = &zone->m_FilledPolysList[ic];
CPolyPt* endcorner = &polysList[ic];
if( begincorner->utility == 0 )
{
......@@ -330,7 +332,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List()
ic++;
if( ic < imax - 1 )
begincorner = firstcorner = &zone->m_FilledPolysList[ic];
begincorner = firstcorner = &polysList[ic];
}
else
{
......@@ -440,7 +442,8 @@ void EDA_3D_CANVAS::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* aZone )
// Draw solid areas contained in this zone
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 )
{
......@@ -449,11 +452,11 @@ void EDA_3D_CANVAS::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* aZone )
StartContour = 0;
}
v_data[0] = aZone->m_FilledPolysList[ii].x * g_Parm_3D_Visu.m_BoardScale;
v_data[1] = -aZone->m_FilledPolysList[ii].y * g_Parm_3D_Visu.m_BoardScale;
gluTessVertex( tess, v_data, &aZone->m_FilledPolysList[ii] );
v_data[0] = polysList[ii].x * g_Parm_3D_Visu.m_BoardScale;
v_data[1] = -polysList[ii].y * g_Parm_3D_Visu.m_BoardScale;
gluTessVertex( tess, v_data, &polysList[ii] );
if( aZone->m_FilledPolysList[ii].end_contour == 1 )
if( polysList[ii].end_contour == 1 )
{
gluTessEndContour( tess );
gluTessEndPolygon( tess );
......
......@@ -42,6 +42,14 @@ Dialogs:
leaving them all bundled tightly together. The dialog box should look
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.
This is important because the help files and the wiki often lag behind
the source code.
......
......@@ -55,6 +55,7 @@ const wxString SchematicFileWildcard( _( "KiCad schematic files (*.sch)|*.sch" )
const wxString NetlistFileWildcard( _( "KiCad netlist files (*.net)|*.net" ) );
const wxString GerberFileWildcard( _( "Gerber files (*.pho)|*.pho" ) );
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 FootprintLibFileWildcard( _( "KiCad footprint library file (*.mod)|*.mod" ) );
const wxString PdfFileWildcard( _( "Portable document format files (*.pdf)|*.pdf" ) );
......
......@@ -34,6 +34,14 @@ public:
void OnUpdateTextDrawMode( 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
* @return true if the grid must be shown
......
......@@ -30,82 +30,78 @@
*/
void CVPCB_MAINFRAME::CreateScreenCmp()
{
wxString msg, FootprintName;
bool IsNew = false;
FootprintName = m_FootprintList->GetSelectedFootprint();
if( m_DisplayFootprintFrame == NULL )
{
m_DisplayFootprintFrame = new DISPLAY_FOOTPRINTS_FRAME( this, _( "Module" ),
wxPoint( 0, 0 ),
wxSize( 600, 400 ),
KICAD_DEFAULT_DRAWFRAME_STYLE );
IsNew = true;
m_DisplayFootprintFrame->Show( true );
}
else
{
// Raising the window does not show the window on Windows if iconized.
// This should work on any platform.
if( m_DisplayFootprintFrame->IsIconized() )
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;
m_DisplayFootprintFrame->SetTitle( msg );
FOOTPRINT_INFO* Module = m_footprints.GetModuleInfo( FootprintName );
msg = _( "Footprint: " ) + footprintName;
SetTitle( msg );
FOOTPRINT_INFO* module_info = parentframe->m_footprints.GetModuleInfo( footprintName );
msg = _( "Lib: " );
if( Module )
msg += Module->m_LibName;
if( module_info )
msg += module_info->m_LibName;
else
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
m_DisplayFootprintFrame->GetBoard()->m_Modules.DeleteAll();
GetBoard()->m_Modules.DeleteAll();
}
MODULE* mod = m_DisplayFootprintFrame->Get_Module( FootprintName );
if( mod )
m_DisplayFootprintFrame->GetBoard()->m_Modules.PushBack( mod );
MODULE* module = Get_Module( footprintName );
m_DisplayFootprintFrame->Zoom_Automatique( false );
m_DisplayFootprintFrame->GetCanvas()->Refresh();
if( module )
GetBoard()->m_Modules.PushBack( module );
// Display new cursor coordinates and zoom value:
m_DisplayFootprintFrame->UpdateStatusBar();
Zoom_Automatique( false );
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();
m_DisplayFootprintFrame->Zoom_Automatique( false );
m_DisplayFootprintFrame->SetStatusText( wxEmptyString, 0 );
m_DisplayFootprintFrame->UpdateStatusBar();
GetBoard()->m_Modules.DeleteAll();
Zoom_Automatique( false );
SetStatusText( wxEmptyString, 0 );
}
}
m_DisplayFootprintFrame->Refresh();
// Display new cursor coordinates and zoom value:
UpdateStatusBar();
if( m_DisplayFootprintFrame->m_Draw3DFrame )
m_DisplayFootprintFrame->m_Draw3DFrame->NewDisplay();
}
GetCanvas()->Refresh();
if( m_Draw3DFrame )
m_Draw3DFrame->NewDisplay();
}
/*
......
......@@ -321,7 +321,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::deleteFieldButtonHandler( wxCommandEven
if( fieldNdx >= m_FieldsBuf.size() ) // traps the -1 case too
return;
if( fieldNdx <= VALUE )
if( fieldNdx < MANDATORY_FIELDS )
{
wxBell();
return;
......@@ -360,7 +360,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB:: moveUpButtonHandler( wxCommandEvent& e
if( fieldNdx >= m_FieldsBuf.size() ) // traps the -1 case too
return;
if( fieldNdx <= MANDATORY_FIELDS )
if( fieldNdx < MANDATORY_FIELDS )
{
wxBell();
return;
......@@ -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
// 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
deleteFieldButton->Enable( fieldNdx > VALUE );
deleteFieldButton->Enable( fieldNdx >= MANDATORY_FIELDS );
fieldValueTextCtrl->SetValue( field.m_Text );
......
......@@ -35,14 +35,13 @@
#include <wxEeschemaStruct.h>
#include <general.h>
#include <protos.h>
#include <class_library.h>
#include <sch_component.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,
wxT( "Cannot edit invalid schematic field." ) );
......@@ -81,7 +80,6 @@ create a new power component with the new value." ), GetChars( entry->GetName()
wxString title;
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
{
aField->m_Pos = component->GetPosition();
......@@ -104,7 +102,7 @@ create a new power component with the new value." ), GetChars( entry->GetName()
{
if( fieldNdx == REFERENCE )
{
// Test is reference is acceptable:
// Test if the reference string is valid:
if( SCH_COMPONENT::IsReferenceStringValid( newtext ) )
{
component->SetRef( m_CurrentSheet, newtext );
......@@ -136,10 +134,9 @@ create a new power component with the new value." ), GetChars( entry->GetName()
if( can_update )
{
aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
dlg.TransfertDataToField();
aField->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
OnModify();
m_canvas->Refresh();
}
component->DisplayInfo( this );
......
......@@ -363,7 +363,7 @@ void SCH_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition )
break;
case SCH_FIELD_T:
EditComponentFieldText( (SCH_FIELD*) item, aDC );
EditComponentFieldText( (SCH_FIELD*) item );
m_canvas->MoveCursorToCrossHair();
break;
......
......@@ -811,15 +811,15 @@ void SCH_EDIT_FRAME::OnEditItem( wxCommandEvent& aEvent )
switch( aEvent.GetId() )
{
case ID_SCH_EDIT_COMPONENT_REFERENCE:
EditComponentFieldText( ( (SCH_COMPONENT*) item )->GetField( REFERENCE ), &dc );
EditComponentFieldText( ( (SCH_COMPONENT*) item )->GetField( REFERENCE ) );
break;
case ID_SCH_EDIT_COMPONENT_VALUE:
EditComponentFieldText( ( (SCH_COMPONENT*) item )->GetField( VALUE ), &dc );
EditComponentFieldText( ( (SCH_COMPONENT*) item )->GetField( VALUE ) );
break;
case ID_SCH_EDIT_COMPONENT_FOOTPRINT:
EditComponentFieldText( ( (SCH_COMPONENT*) item )->GetField( FOOTPRINT ), &dc );
EditComponentFieldText( ( (SCH_COMPONENT*) item )->GetField( FOOTPRINT ) );
break;
case ID_SCH_EDIT_ITEM:
......@@ -850,7 +850,7 @@ void SCH_EDIT_FRAME::OnEditItem( wxCommandEvent& aEvent )
break;
case SCH_FIELD_T:
EditComponentFieldText( (SCH_FIELD*) item, &dc );
EditComponentFieldText( (SCH_FIELD*) item );
break;
case SCH_BITMAP_T:
......
/*
Copyright 2008 Intel Corporation
Use, modification and distribution are subject to the Boost Software License,
Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
*/
#ifndef BOOST_POLYGON_POLYGON_HPP
#define BOOST_POLYGON_POLYGON_HPP
#define BOOST_POLYGON_VERSION 014401
#include "isotropy.hpp"
//point
#include "point_data.hpp"
#include "point_traits.hpp"
#include "point_concept.hpp"
//point 3d
#include "point_3d_data.hpp"
#include "point_3d_traits.hpp"
#include "point_3d_concept.hpp"
#include "transform.hpp"
#include "detail/transform_detail.hpp"
#include "detail/polygon_sort_adaptor.hpp"
#include "detail/polygon_sort_adaptor.hpp"
//interval
#include "interval_data.hpp"
#include "interval_traits.hpp"
#include "interval_concept.hpp"
//rectangle
#include "rectangle_data.hpp"
#include "rectangle_traits.hpp"
#include "rectangle_concept.hpp"
//algorithms needed by polygon types
#include "detail/iterator_points_to_compact.hpp"
#include "detail/iterator_compact_to_points.hpp"
//polygons
#include "polygon_45_data.hpp"
#include "polygon_data.hpp"
#include "polygon_90_data.hpp"
#include "polygon_90_with_holes_data.hpp"
#include "polygon_45_with_holes_data.hpp"
#include "polygon_with_holes_data.hpp"
#include "polygon_traits.hpp"
//manhattan boolean algorithms
#include "detail/boolean_op.hpp"
#include "detail/polygon_formation.hpp"
#include "detail/rectangle_formation.hpp"
#include "detail/max_cover.hpp"
#include "detail/property_merge.hpp"
#include "detail/polygon_90_touch.hpp"
#include "detail/iterator_geometry_to_set.hpp"
//45 boolean op algorithms
#include "detail/boolean_op_45.hpp"
#include "detail/polygon_45_formation.hpp"
//polygon set data types
#include "polygon_90_set_data.hpp"
//polygon set trait types
#include "polygon_90_set_traits.hpp"
//polygon set concepts
#include "polygon_90_set_concept.hpp"
//boolean operator syntax
#include "detail/polygon_90_set_view.hpp"
//45 boolean op algorithms
#include "detail/polygon_45_touch.hpp"
#include "detail/property_merge_45.hpp"
#include "polygon_45_set_data.hpp"
#include "polygon_45_set_traits.hpp"
#include "polygon_45_set_concept.hpp"
#include "detail/polygon_45_set_view.hpp"
//arbitrary polygon algorithms
#include "detail/polygon_arbitrary_formation.hpp"
#include "polygon_set_data.hpp"
//general scanline
#include "detail/scan_arbitrary.hpp"
#include "polygon_set_traits.hpp"
#include "detail/polygon_set_view.hpp"
#include "polygon_set_concept.hpp"
#endif
/*
Copyright 2008 Intel Corporation
Use, modification and distribution are subject to the Boost Software License,
Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
*/
#ifndef BOOST_POLYGON_POLYGON_HPP
#define BOOST_POLYGON_POLYGON_HPP
#define BOOST_POLYGON_VERSION 014401
#include "isotropy.hpp"
//point
#include "point_data.hpp"
#include "point_traits.hpp"
#include "point_concept.hpp"
//point 3d
#include "point_3d_data.hpp"
#include "point_3d_traits.hpp"
#include "point_3d_concept.hpp"
#include "transform.hpp"
#include "detail/transform_detail.hpp"
#include "detail/polygon_sort_adaptor.hpp"
//interval
#include "interval_data.hpp"
#include "interval_traits.hpp"
#include "interval_concept.hpp"
//rectangle
#include "rectangle_data.hpp"
#include "rectangle_traits.hpp"
#include "rectangle_concept.hpp"
//algorithms needed by polygon types
#include "detail/iterator_points_to_compact.hpp"
#include "detail/iterator_compact_to_points.hpp"
//polygons
#include "polygon_45_data.hpp"
#include "polygon_data.hpp"
#include "polygon_90_data.hpp"
#include "polygon_90_with_holes_data.hpp"
#include "polygon_45_with_holes_data.hpp"
#include "polygon_with_holes_data.hpp"
#include "polygon_traits.hpp"
//manhattan boolean algorithms
#include "detail/boolean_op.hpp"
#include "detail/polygon_formation.hpp"
#include "detail/rectangle_formation.hpp"
#include "detail/max_cover.hpp"
#include "detail/property_merge.hpp"
#include "detail/polygon_90_touch.hpp"
#include "detail/iterator_geometry_to_set.hpp"
//45 boolean op algorithms
#include "detail/boolean_op_45.hpp"
#include "detail/polygon_45_formation.hpp"
//polygon set data types
#include "polygon_90_set_data.hpp"
//polygon set trait types
#include "polygon_90_set_traits.hpp"
//polygon set concepts
#include "polygon_90_set_concept.hpp"
//boolean operator syntax
#include "detail/polygon_90_set_view.hpp"
//45 boolean op algorithms
#include "detail/polygon_45_touch.hpp"
#include "detail/property_merge_45.hpp"
#include "polygon_45_set_data.hpp"
#include "polygon_45_set_traits.hpp"
#include "polygon_45_set_concept.hpp"
#include "detail/polygon_45_set_view.hpp"
//arbitrary polygon algorithms
#include "detail/polygon_arbitrary_formation.hpp"
#include "polygon_set_data.hpp"
//general scanline
#include "detail/scan_arbitrary.hpp"
#include "polygon_set_traits.hpp"
#include "detail/polygon_set_view.hpp"
#include "polygon_set_concept.hpp"
#endif
......@@ -63,6 +63,7 @@ extern const wxString NetlistFileWildcard;
extern const wxString GerberFileWildcard;
extern const wxString LegacyPcbFileWildcard;
extern const wxString PcbFileWildcard;
extern const wxString EaglePcbFileWildcard;
extern const wxString PdfFileWildcard;
extern const wxString MacrosFileWildcard;
extern const wxString AllFilesWildcard;
......
......@@ -238,9 +238,10 @@ public:
* Function CursorGoto
* positions the cursor at a given coordinate and reframes the drawing if the
* 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
......@@ -319,10 +320,14 @@ public:
* Function ResetModuleTextSizes
* resets text size and width of all module text fields of given field
* 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 aDC is the drawing context.
*/
void ResetModuleTextSizes( int aType, wxDC* aDC );
* @param aFilter is a filter: footprint names must match this filter.
* an empty filter, or "*" do not filter anything.
* @param aRef = true to modify the reference of footprints.
* @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 InstallTextModOptionsFrame( TEXTE_MODULE* TextMod, wxDC* DC );
......
......@@ -963,7 +963,14 @@ private:
void ConvertPart( 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 );
/**
......
......@@ -481,6 +481,13 @@ public:
void Tracks_and_Vias_Size_Event( wxCommandEvent& event );
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 MuWaveCommand( wxDC* DC, const wxPoint& MousePos );
......@@ -921,6 +928,7 @@ public:
// Handling texts on the board
void Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
void FlipTextePcb( TEXTE_PCB* aTextePcb, wxDC* aDC );
TEXTE_PCB* Create_Texte_Pcb( wxDC* DC );
void Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
void StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC );
......@@ -1488,7 +1496,7 @@ public:
void Clean_Pcb( wxDC* DC );
void InstallFindFrame( const wxPoint& pos, wxDC* DC );
void InstallFindFrame();
/**
* Function SendMessageToEESCHEMA
......
......@@ -55,6 +55,8 @@ set(PCBNEW_DIALOGS
dialogs/dialog_edit_module_text_base.cpp
dialogs/dialog_exchange_modules_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_base.cpp
dialogs/dialog_gendrill.cpp
......@@ -64,6 +66,8 @@ set(PCBNEW_DIALOGS
dialogs/dialog_general_options_BoardEditor_base.cpp
dialogs/dialog_global_edit_tracks_and_vias.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_graphic_items_options.cpp
dialogs/dialog_graphic_items_options_base.cpp
......@@ -144,7 +148,6 @@ set(PCBNEW_CLASS_SRCS
export_gencad.cpp
export_vrml.cpp
files.cpp
find.cpp
gen_drill_report_files.cpp
gen_holes_and_tools_lists_for_drill.cpp
gen_modules_placefile.cpp
......
......@@ -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
PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen();
wxClientDC dc( m_canvas );
INSTALL_UNBUFFERED_DC( dc, m_canvas );
// There may be need to reframe the drawing.
if( !m_canvas->IsPointOnDisplay( aPos ) )
{
screen->SetCrossHairPosition( aPos );
RedrawScreen( aPos, true );
RedrawScreen( aPos, aWarp );
}
else
{
// Put cursor on item position
m_canvas->CrossHairOff( &dc );
screen->SetCrossHairPosition( aPos );
m_canvas->MoveCursorToCrossHair();
m_canvas->CrossHairOn( &dc );
if( aWarp )
m_canvas->MoveCursorToCrossHair();
}
m_canvas->CrossHairOn( &dc );
m_canvas->CrossHairOn( &dc );
}
......
......@@ -89,6 +89,12 @@ BOARD::~BOARD()
}
void BOARD::Move( const wxPoint& aMoveVector ) // overload
{
}
void BOARD::chainMarkedSegments( wxPoint aPosition, int aLayerMask, TRACK_PTRS* aList )
{
TRACK* segment; // The current segment being analyzed.
......@@ -1468,7 +1474,7 @@ int BOARD::SetAreasNetCodesFromNetNames( void )
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 )
{
......
......@@ -3,8 +3,8 @@
* @brief Class BOARD to handle a board.
*/
#ifndef CLASS_BOARD_H
#define CLASS_BOARD_H
#ifndef CLASS_BOARD_H_
#define CLASS_BOARD_H_
#include <dlist.h>
......@@ -255,10 +255,11 @@ public:
BOARD();
~BOARD();
void Move( const wxPoint& aMoveVector ); // overload
void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
int GetFileFormatVersionAtLoad() const { return m_fileFormatVersionAtLoad; }
/**
* Function GetDefaultLayerName
* returns a default name of a PCB layer when given \a aLayerNumber. This
......@@ -1327,4 +1328,4 @@ public:
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
if( ( draw_mode & GR_ALLOW_HIGHCONTRAST ) && DisplayOpt.ContrastModeDisplay )
{
if( !IsOnLayer( curr_layer ) )
if( !IsOnLayer( curr_layer ) && !IsOnLayer( EDGE_N ) )
{
color &= ~MASKCOLOR;
color |= DARKDARKGRAY;
......
......@@ -42,14 +42,11 @@ class EDA_DRAW_FRAME;
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:
EDGE_MODULE( MODULE* parent, STROKE_T aShape = S_SEGMENT );
// Do not create a copy constructor. The one generated by the compiler is adequate.
// EDGE_MODULE( const EDGE_MODULE& );
~EDGE_MODULE();
......@@ -90,6 +87,11 @@ public:
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // overload
#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_
......@@ -161,7 +161,10 @@ void TEXTE_PCB::Flip(const wxPoint& aCentre )
{
m_Pos.y = aCentre.y - ( m_Pos.y - aCentre.y );
// 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 */
}
......
......@@ -50,7 +50,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
BOARD_ITEM( parent, PCB_MODULE_TEXT_T ),
EDA_TEXT()
{
MODULE* Module = (MODULE*) m_Parent;
MODULE* module = (MODULE*) m_Parent;
m_Type = text_type; /* Reference */
......@@ -63,11 +63,11 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
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 )
SetLayer( SILKSCREEN_N_BACK );
......@@ -120,18 +120,18 @@ int TEXTE_MODULE::GetLength() const
// Update draw coordinates
void TEXTE_MODULE::SetDrawCoord()
{
MODULE* Module = (MODULE*) m_Parent;
MODULE* module = (MODULE*) m_Parent;
m_Pos = m_Pos0;
if( Module == NULL )
if( module == NULL )
return;
int angle = Module->m_Orient;
double angle = module->GetOrientation();
NORMALIZE_ANGLE_POS( 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()
// anchor point)
void TEXTE_MODULE::SetLocalCoord()
{
MODULE* Module = (MODULE*) m_Parent;
MODULE* module = (MODULE*) m_Parent;
if( Module == NULL )
if( module == NULL )
{
m_Pos0 = m_Pos;
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 );
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
wxSize size;
wxPoint pos; // Center of text
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
* parent has no sense) */
......@@ -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 );
}
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 )
return;
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 )
return;
......@@ -336,12 +336,12 @@ void TEXTE_MODULE::DrawUmbilical( EDA_DRAW_PANEL* aPanel,
int TEXTE_MODULE::GetDrawRotation() const
{
int rotation;
MODULE* Module = (MODULE*) m_Parent;
MODULE* module = (MODULE*) m_Parent;
rotation = m_Orient;
if( Module )
rotation += Module->m_Orient;
if( module )
rotation += module->m_Orient;
NORMALIZE_ANGLE_POS( rotation );
......
......@@ -74,6 +74,7 @@ ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone ) :
// For corner moving, corner index to drag, or -1 if no selection
m_CornerSelection = -1;
m_IsFilled = aZone.m_IsFilled;
m_ZoneClearance = aZone.m_ZoneClearance; // clearance value
m_ZoneMinThickness = aZone.m_ZoneMinThickness;
m_FillMode = aZone.m_FillMode; // Filling mode (segments/polygons)
......@@ -84,6 +85,11 @@ ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone ) :
m_ThermalReliefCopperBridge = aZone.m_ThermalReliefCopperBridge;
m_FilledPolysList = aZone.m_FilledPolysList;
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 )
frame->AppendMsgPanel( _( "Corners" ), msg, BLUE );
if( m_FillMode )
msg.Printf( _( "Segments" ), m_FillMode );
msg = _( "Segments" );
else
msg = _( "Polygons" );
......
......@@ -77,58 +77,7 @@ struct SEGMENT
class ZONE_CONTAINER : public BOARD_CONNECTED_ITEM
{
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( const ZONE_CONTAINER& aZone );
......@@ -257,13 +206,13 @@ public:
* returns the net name.
* @return const wxString& - The net name.
*/
const wxString& GetNetName() const { return m_Netname; };
void SetNetName( const wxString& aName ) { m_Netname = aName; }
const wxString& GetNetName() const { return m_Netname; };
void SetNetName( const wxString& aName ) { m_Netname = aName; }
void SetFillMode( int aFillMode ) { m_FillMode = aFillMode; }
int GetFillMode() const { return m_FillMode; }
void SetFillMode( int aFillMode ) { m_FillMode = aFillMode; }
int GetFillMode() const { return m_FillMode; }
void SetThermalReliefGap( int aThermalReliefGap ) { m_ThermalReliefGap = aThermalReliefGap; }
void SetThermalReliefGap( int aThermalReliefGap ) { m_ThermalReliefGap = aThermalReliefGap; }
int GetThermalReliefGap( D_PAD* aPad = NULL ) const;
void SetThermalReliefCopperBridge( int aThermalReliefCopperBridge )
......@@ -508,6 +457,34 @@ public:
*/
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
* returns a pointer to the corner-smoothed version of
......@@ -547,6 +524,59 @@ public:
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#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:
wxListView* m_LayerSelectionCtrl;
static wxPoint prevPosition; ///< Dialog position & size
static wxSize prevSize;
/**
* Function initDialog
* fills in the dialog controls using the current settings.
......@@ -108,8 +105,6 @@ private:
// Initialize static member variables
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 )
......@@ -157,11 +152,7 @@ DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS*
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()
{
BOARD* board = m_Parent->GetBoard();
SetFocus(); // Required under wxGTK if we want to demiss the dialog with the ESC key
wxString msg;
if( m_settings.m_Zone_45_Only )
......@@ -297,8 +286,6 @@ void DIALOG_COPPER_ZONE::OnButtonCancelClick( wxCommandEvent& event )
void DIALOG_COPPER_ZONE::OnButtonOkClick( wxCommandEvent& event )
{
m_netNameShowFilter = m_ShowNetNameFilter->GetValue();
prevPosition = GetPosition();
prevSize = GetSize();
if( AcceptOptions( true ) )
{
......@@ -311,9 +298,6 @@ void DIALOG_COPPER_ZONE::OnButtonOkClick( wxCommandEvent& event )
// called on system close button
void DIALOG_COPPER_ZONE::OnClose( wxCloseEvent& event )
{
prevPosition = GetPosition();
prevSize = GetSize();
if( m_OnExitCode != ZONE_ABORT )
*m_ptr = m_settings;
......@@ -384,7 +368,7 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportab
wxString txtvalue = m_ZoneClearanceCtrl->GetValue();
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
#define CLEARANCE_MAX_VALUE 5000 // in 1/10000 inch
if( m_settings.m_ZoneClearance > CLEARANCE_MAX_VALUE )
......@@ -519,9 +503,6 @@ void DIALOG_COPPER_ZONE::OnNetSortingOptionSelected( wxCommandEvent& event )
void DIALOG_COPPER_ZONE::ExportSetupToOtherCopperZones( wxCommandEvent& event )
{
prevPosition = GetPosition();
prevSize = GetSize();
if( !AcceptOptions( true, true ) )
return;
......
This diff is collapsed.
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 30 2011)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_COPPER_ZONES_BASE_H__
#define __DIALOG_COPPER_ZONES_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.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/sizer.h>
#include <wx/listbox.h>
#include <wx/choice.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/statbox.h>
#include <wx/spinctrl.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_COPPER_ZONE_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_COPPER_ZONE_BASE : public wxDialog
{
DECLARE_EVENT_TABLE()
private:
// Private event handlers
void _wxFB_OnClose( wxCloseEvent& event ){ OnClose( event ); }
void _wxFB_OnSize( wxSizeEvent& event ){ OnSize( event ); }
void _wxFB_OnNetSortingOptionSelected( wxCommandEvent& event ){ OnNetSortingOptionSelected( event ); }
void _wxFB_OnRunFiltersButtonClick( wxCommandEvent& event ){ OnRunFiltersButtonClick( event ); }
void _wxFB_OnCornerSmoothingModeChoice( wxCommandEvent& event ){ OnCornerSmoothingModeChoice( event ); }
void _wxFB_OnPadsInZoneClick( wxCommandEvent& event ){ OnPadsInZoneClick( event ); }
void _wxFB_ExportSetupToOtherCopperZones( wxCommandEvent& event ){ ExportSetupToOtherCopperZones( event ); }
void _wxFB_OnButtonOkClick( wxCommandEvent& event ){ OnButtonOkClick( event ); }
void _wxFB_OnButtonCancelClick( wxCommandEvent& event ){ OnButtonCancelClick( event ); }
protected:
enum
{
ID_DIALOG_COPPER_ZONE_BASE = 1000,
ID_NETNAME_SELECTION,
ID_M_NETDISPLAYOPTION,
ID_TEXTCTRL_NETNAMES_FILTER,
wxID_APPLY_FILTERS,
ID_CORNER_SMOOTHING,
ID_M_CORNERSMOOTHINGCTRL,
ID_M_PADINZONEOPT,
wxID_ANTIPAD_SIZE,
wxID_COPPER_BRIDGE_VALUE,
ID_M_PRIORITYLEVELCTRL,
ID_M_FILLMODECTRL,
ID_M_ARCAPPROXIMATIONOPT,
ID_M_ORIENTEDGESOPT,
ID_M_OUTLINEAPPEARANCECTRL,
wxID_BUTTON_EXPORT,
};
wxBoxSizer* m_MainBoxSizer;
wxBoxSizer* m_layerSizer;
wxStaticText* m_staticText17;
wxStaticText* m_staticText2;
wxListBox* m_ListNetNameSelection;
wxStaticText* m_staticText16;
wxChoice* m_NetDisplayOption;
wxStaticText* m_staticText5;
wxTextCtrl* m_DoNotShowNetNameFilter;
wxStaticText* m_staticText51;
wxTextCtrl* m_ShowNetNameFilter;
wxButton* m_buttonRunFilter;
wxStaticText* m_ClearanceValueTitle;
wxTextCtrl* m_ZoneClearanceCtrl;
wxStaticText* m_MinThicknessValueTitle;
wxTextCtrl* m_ZoneMinThicknessCtrl;
wxStaticText* m_staticText151;
wxChoice* m_cornerSmoothingChoice;
wxStaticText* m_cornerSmoothingTitle;
wxTextCtrl* m_cornerSmoothingCtrl;
wxStaticText* m_staticText13;
wxChoice* m_PadInZoneOpt;
wxStaticText* m_AntipadSizeText;
wxTextCtrl* m_AntipadSizeValue;
wxStaticText* m_CopperBridgeWidthText;
wxTextCtrl* m_CopperWidthValue;
wxStaticText* m_staticText171;
wxSpinCtrl* m_PriorityLevelCtrl;
wxStaticText* m_staticText11;
wxChoice* m_FillModeCtrl;
wxStaticText* m_staticText12;
wxChoice* m_ArcApproximationOpt;
wxStaticText* m_staticText14;
wxChoice* m_OrientEdgesOpt;
wxStaticText* m_staticText15;
wxChoice* m_OutlineAppearanceCtrl;
wxButton* m_ExportSetupButton;
wxButton* m_OkButton;
wxButton* m_ButtonCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnSize( wxSizeEvent& event ) { event.Skip(); }
virtual void OnNetSortingOptionSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRunFiltersButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCornerSmoothingModeChoice( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPadsInZoneClick( wxCommandEvent& event ) { event.Skip(); }
virtual void ExportSetupToOtherCopperZones( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonOkClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCancelClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID id = ID_DIALOG_COPPER_ZONE_BASE, const wxString& title = _("Zone Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 550,500 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_COPPER_ZONE_BASE();
};
#endif //__DIALOG_COPPER_ZONES_BASE_H__
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 11 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_COPPER_ZONES_BASE_H__
#define __DIALOG_COPPER_ZONES_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/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/listbox.h>
#include <wx/choice.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/statbox.h>
#include <wx/spinctrl.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_COPPER_ZONE_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_COPPER_ZONE_BASE : public DIALOG_SHIM
{
DECLARE_EVENT_TABLE()
private:
// Private event handlers
void _wxFB_OnClose( wxCloseEvent& event ){ OnClose( event ); }
void _wxFB_OnSize( wxSizeEvent& event ){ OnSize( event ); }
void _wxFB_OnNetSortingOptionSelected( wxCommandEvent& event ){ OnNetSortingOptionSelected( event ); }
void _wxFB_OnRunFiltersButtonClick( wxCommandEvent& event ){ OnRunFiltersButtonClick( event ); }
void _wxFB_OnCornerSmoothingModeChoice( wxCommandEvent& event ){ OnCornerSmoothingModeChoice( event ); }
void _wxFB_OnPadsInZoneClick( wxCommandEvent& event ){ OnPadsInZoneClick( event ); }
void _wxFB_ExportSetupToOtherCopperZones( wxCommandEvent& event ){ ExportSetupToOtherCopperZones( event ); }
void _wxFB_OnButtonOkClick( wxCommandEvent& event ){ OnButtonOkClick( event ); }
void _wxFB_OnButtonCancelClick( wxCommandEvent& event ){ OnButtonCancelClick( event ); }
protected:
enum
{
ID_DIALOG_COPPER_ZONE_BASE = 1000,
ID_NETNAME_SELECTION,
ID_M_NETDISPLAYOPTION,
ID_TEXTCTRL_NETNAMES_FILTER,
wxID_APPLY_FILTERS,
ID_CORNER_SMOOTHING,
ID_M_CORNERSMOOTHINGCTRL,
ID_M_PADINZONEOPT,
wxID_ANTIPAD_SIZE,
wxID_COPPER_BRIDGE_VALUE,
ID_M_PRIORITYLEVELCTRL,
ID_M_FILLMODECTRL,
ID_M_ARCAPPROXIMATIONOPT,
ID_M_ORIENTEDGESOPT,
ID_M_OUTLINEAPPEARANCECTRL,
wxID_BUTTON_EXPORT
};
wxBoxSizer* m_MainBoxSizer;
wxBoxSizer* m_layerSizer;
wxStaticText* m_staticText17;
wxStaticText* m_staticText2;
wxListBox* m_ListNetNameSelection;
wxStaticText* m_staticText16;
wxChoice* m_NetDisplayOption;
wxStaticText* m_staticText5;
wxTextCtrl* m_DoNotShowNetNameFilter;
wxStaticText* m_staticText51;
wxTextCtrl* m_ShowNetNameFilter;
wxButton* m_buttonRunFilter;
wxStaticText* m_ClearanceValueTitle;
wxTextCtrl* m_ZoneClearanceCtrl;
wxStaticText* m_MinThicknessValueTitle;
wxTextCtrl* m_ZoneMinThicknessCtrl;
wxStaticText* m_staticText151;
wxChoice* m_cornerSmoothingChoice;
wxStaticText* m_cornerSmoothingTitle;
wxTextCtrl* m_cornerSmoothingCtrl;
wxStaticText* m_staticText13;
wxChoice* m_PadInZoneOpt;
wxStaticText* m_AntipadSizeText;
wxTextCtrl* m_AntipadSizeValue;
wxStaticText* m_CopperBridgeWidthText;
wxTextCtrl* m_CopperWidthValue;
wxStaticText* m_staticText171;
wxSpinCtrl* m_PriorityLevelCtrl;
wxStaticText* m_staticText11;
wxChoice* m_FillModeCtrl;
wxStaticText* m_staticText12;
wxChoice* m_ArcApproximationOpt;
wxStaticText* m_staticText14;
wxChoice* m_OrientEdgesOpt;
wxStaticText* m_staticText15;
wxChoice* m_OutlineAppearanceCtrl;
wxButton* m_ExportSetupButton;
wxButton* m_OkButton;
wxButton* m_ButtonCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnSize( wxSizeEvent& event ) { event.Skip(); }
virtual void OnNetSortingOptionSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRunFiltersButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCornerSmoothingModeChoice( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPadsInZoneClick( wxCommandEvent& event ) { event.Skip(); }
virtual void ExportSetupToOtherCopperZones( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonOkClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCancelClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID id = ID_DIALOG_COPPER_ZONE_BASE, const wxString& title = _("Zone Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 550,500 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_COPPER_ZONE_BASE();
};
#endif //__DIALOG_COPPER_ZONES_BASE_H__
This diff is collapsed.
/*
* 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 );
}
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// 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__
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// C++ code generated with wxFormBuilder (version Apr 11 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -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_CANCEL, DialogNonCopperZonesPropertiesBase::_wxFB_OnCancelClick )
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 );
......@@ -40,6 +40,7 @@ DialogNonCopperZonesPropertiesBase::DialogNonCopperZonesPropertiesBase( wxWindow
m_ZoneMinThicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbLeftSizer_->Add( m_ZoneMinThicknessCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_UpperSizer->Add( sbLeftSizer_, 0, 0, 5 );
wxStaticBoxSizer* m_OutilinesBoxOpt;
......@@ -57,6 +58,7 @@ DialogNonCopperZonesPropertiesBase::DialogNonCopperZonesPropertiesBase( wxWindow
m_OutlineAppearanceCtrl->SetSelection( 1 );
m_OutilinesBoxOpt->Add( m_OutlineAppearanceCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_UpperSizer->Add( m_OutilinesBoxOpt, 0, 0, 5 );
wxBoxSizer* m_ButtonsSizer;
......@@ -69,8 +71,10 @@ DialogNonCopperZonesPropertiesBase::DialogNonCopperZonesPropertiesBase( wxWindow
m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
m_ButtonsSizer->Add( m_buttonCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_UpperSizer->Add( m_ButtonsSizer, 1, wxALIGN_CENTER_VERTICAL, 5 );
m_MainSizer->Add( m_UpperSizer, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 );
m_staticTextLayerSelection = new wxStaticText( this, wxID_ANY, _("Layer selection:"), wxDefaultPosition, wxDefaultSize, 0 );
......@@ -80,6 +84,7 @@ DialogNonCopperZonesPropertiesBase::DialogNonCopperZonesPropertiesBase( wxWindow
m_LayerSelectionCtrl = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_MainSizer->Add( m_LayerSelectionCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
this->SetSizer( m_MainSizer );
this->Layout();
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// C++ code generated with wxFormBuilder (version Apr 11 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_non_copper_zones_properties_base__
#define __dialog_non_copper_zones_properties_base__
#ifndef __DIALOG_NON_COPPER_ZONES_PROPERTIES_BASE_H__
#define __DIALOG_NON_COPPER_ZONES_PROPERTIES_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/radiobox.h>
#include <wx/gdicmn.h>
......@@ -29,7 +31,7 @@
///////////////////////////////////////////////////////////////////////////////
/// Class DialogNonCopperZonesPropertiesBase
///////////////////////////////////////////////////////////////////////////////
class DialogNonCopperZonesPropertiesBase : public wxDialog
class DialogNonCopperZonesPropertiesBase : public DIALOG_SHIM
{
DECLARE_EVENT_TABLE()
private:
......@@ -51,14 +53,15 @@ class DialogNonCopperZonesPropertiesBase : public wxDialog
wxListBox* m_LayerSelectionCtrl;
// Virtual event handlers, overide them in your derived class
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
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();
};
#endif //__dialog_non_copper_zones_properties_base__
#endif //__DIALOG_NON_COPPER_ZONES_PROPERTIES_BASE_H__
This diff is collapsed.
......@@ -56,36 +56,18 @@ struct ENET
{}
};
typedef std::map< std::string, ENET > NET_MAP;
/*
#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 std::map< std::string, ENET > NET_MAP;
typedef NET_MAP::const_iterator NET_MAP_CITER;
typedef boost::property_tree::ptree PTREE;
typedef const PTREE CPTREE;
struct EWIRE;
struct EVIA;
struct EROT;
struct EATTR;
struct ECIRCLE;
struct ETEXT;
struct ERECT;
class XPATH;
/**
* 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
{
......@@ -118,36 +100,46 @@ public:
//-----</PUBLIC PLUGIN API>-------------------------------------------------
typedef int BIU;
typedef int BIU;
EAGLE_PLUGIN();
~EAGLE_PLUGIN();
private:
NET_MAP m_pads_to_nets;
XPATH* m_xpath; ///< keeps track of what we are working on within
///< XML document during a Load().
MODULE_MAP m_templates; ///< is part of a MODULE factory that operates
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
///< using copy construction.
///< lookup key is libname.packagename
PROPERTIES* m_props; ///< passed via Save() or Load(), no ownership, may be NULL.
BOARD* m_board; ///< which BOARD, no ownership here
double mm_per_biu; ///< how many mm in each BIU
double biu_per_mm; ///< how many bius in a mm
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
double mm_per_biu; ///< how many mm in each BIU
double biu_per_mm; ///< how many bius in a mm
/// initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed.
void init( PROPERTIES* aProperties );
/// Convert an Eagle distance to a KiCad distance.
int kicad( double d ) const;
int kicad_y( double y ) const { return -kicad( y ); }
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 );
/// Convert a KiCad distance to an Eagle distance.
double eagle( BIU d ) const { return mm_per_biu * d; }
double eagle_x( BIU x ) const { return eagle( x ); }
double eagle_y( BIU y ) const { return eagle( y ); }
......@@ -180,38 +172,15 @@ private:
// 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 );
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;
/// move the BOARD into the center of the page
void centerBoard();
/**
* Function fmtDEG
......@@ -235,7 +204,6 @@ private:
void packageCircle( MODULE* aModule, CPTREE& aTree ) const;
void packageHole( MODULE* aModule, CPTREE& aTree ) const;
void packageSMD( MODULE* aModule, CPTREE& aTree ) const;
};
#endif // EAGLE_PLUGIN_H_
......@@ -81,6 +81,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_TOOLBARH_PCB_SELECT_LAYER:
case ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR:
case ID_POPUP_PCB_ROTATE_TEXTEPCB:
case ID_POPUP_PCB_FLIP_TEXTEPCB:
case ID_POPUP_PCB_EDIT_TEXTEPCB:
case ID_POPUP_PCB_EDIT_MIRE:
case ID_POPUP_PCB_ROTATE_TEXTMODULE:
......@@ -286,7 +287,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break;
case ID_FIND_ITEMS:
InstallFindFrame( pos, &dc );
InstallFindFrame();
break;
case ID_POPUP_CLOSE_CURRENT_TOOL:
......@@ -578,7 +579,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
{
// Remove filled areas in zone
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
......@@ -930,6 +931,11 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
m_canvas->MoveCursorToCrossHair();
break;
case ID_POPUP_PCB_FLIP_TEXTEPCB:
FlipTextePcb( (TEXTE_PCB*) GetCurItem(), &dc );
m_canvas->MoveCursorToCrossHair();
break;
case ID_POPUP_PCB_DELETE_TEXTEPCB:
Delete_Texte_Pcb( (TEXTE_PCB*) GetCurItem(), &dc );
m_canvas->MoveCursorToCrossHair();
......@@ -1078,14 +1084,6 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
Swap_Layers( event );
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:
InstallGridFrame( pos );
break;
......
......@@ -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 )
{
int angle = 900;
int drawmode = GR_XOR;
if( TextePcb == NULL )
return;
......@@ -228,13 +227,34 @@ void PCB_EDIT_FRAME::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
NORMALIZE_ANGLE_POS( TextePcb->m_Orient );
/* Redraw text in new position. */
TextePcb->Draw( m_canvas, DC, drawmode );
TextePcb->Draw( m_canvas, DC, GR_XOR );
TextePcb->DisplayInfo( this );
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
TextePcb->SetFlags( IN_EDIT );
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.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
* 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
......@@ -37,7 +37,7 @@
#include <macros.h>
#include <pcbnew.h>
#include <protos.h>
#include <wxPcbStruct.h>
#include <class_board.h>
#include <class_module.h>
......@@ -356,107 +356,3 @@ void PCB_BASE_FRAME::ResetTextSize( BOARD_ITEM* aItem, wxDC* aDC )
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();
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -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 HkEndTrack( wxT( "End Track" ), HK_END_TRACK, WXK_END );
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 HkMoveItem( wxT( "Move Item" ), HK_MOVE_ITEM, 'M' );
static EDA_HOTKEY HkDragFootprint( wxT( "Drag Footprint" ), HK_DRAG_ITEM, 'G' );
......@@ -78,7 +78,7 @@ static EDA_HOTKEY HkLock_Unlock_Footprint( wxT( "Lock/Unlock Footprint" ),
static EDA_HOTKEY HkDelete( wxT( "Delete Track or Footprint" ), HK_DELETE, WXK_DELETE );
static EDA_HOTKEY HkResetLocalCoord( wxT( "Reset Local Coordinates" ),
HK_RESET_LOCAL_COORD, ' ' );
static EDA_HOTKEY HkSwitchHighContrastMode( wxT("Switch Highcontrast mode"),
static EDA_HOTKEY HkSwitchHighContrastMode( wxT("Switch Highcontrast mode"),
HK_SWITCH_HIGHCONTRAST_MODE,'H');
/* Fit on Screen */
#if !defined( __WXMAC__ )
......@@ -210,8 +210,8 @@ EDA_HOTKEY* board_edit_Hotkey_List[] =
&HkSwitchTrackPosture,
&HkDragTrackKeepSlope,
&HkPlaceItem,
&HkEndTrack, &HkMoveItem,
&HkFlipFootprint, &HkRotateItem, &HkDragFootprint,
&HkEndTrack, &HkMoveItem, &HkFlipItem,
&HkRotateItem, &HkDragFootprint,
&HkGetAndMoveFootprint, &HkLock_Unlock_Footprint, &HkSavefile,
&HkLoadfile, &HkFindItem, &HkEditBoardItem,
&HkSwitch2CopperLayer, &HkSwitch2InnerLayer1,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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