2011-09-23 13:57:12 +00:00
|
|
|
/**
|
2014-10-06 01:18:24 +00:00
|
|
|
* @file dialog_non_copper_zones_properties.cpp
|
2011-09-23 13:57:12 +00:00
|
|
|
*/
|
2014-07-15 16:53:13 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
|
|
|
* Copyright (C) 2014 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
|
|
|
* Copyright (C) 1992-2014 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
|
|
|
|
*/
|
2008-09-26 19:51:36 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
#include <kiface_i.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <confirm.h>
|
|
|
|
#include <wxPcbStruct.h>
|
2012-04-13 18:51:24 +00:00
|
|
|
#include <base_units.h>
|
2008-09-26 19:51:36 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <class_board.h>
|
|
|
|
#include <class_zone.h>
|
2011-09-23 13:57:12 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <pcbnew.h>
|
|
|
|
#include <zones.h>
|
2008-09-26 19:51:36 +00:00
|
|
|
|
2014-07-15 18:13:08 +00:00
|
|
|
#include <wx/imaglist.h> // needed for wx/listctrl.h, in wxGTK 2.8.12
|
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <dialog_non_copper_zones_properties_base.h>
|
2008-09-26 19:51:36 +00:00
|
|
|
|
2014-07-15 16:53:13 +00:00
|
|
|
#define LAYER_BITMAP_SIZE_X 20
|
|
|
|
#define LAYER_BITMAP_SIZE_Y 10
|
2008-09-26 19:51:36 +00:00
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
/**
|
|
|
|
* Class DIALOG_NON_COPPER_ZONES_EDITOR
|
|
|
|
* is a dialog editor for non copper zones properties,
|
2014-07-15 16:53:13 +00:00
|
|
|
* derived from DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE, which is maintained and
|
2012-02-06 05:44:19 +00:00
|
|
|
* created by wxFormBuilder
|
2008-09-26 19:51:36 +00:00
|
|
|
*/
|
2014-07-15 16:53:13 +00:00
|
|
|
class DIALOG_NON_COPPER_ZONES_EDITOR : public DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE
|
2008-09-26 19:51:36 +00:00
|
|
|
{
|
|
|
|
private:
|
2014-07-15 16:53:13 +00:00
|
|
|
PCB_BASE_FRAME* m_parent;
|
2012-02-06 05:44:19 +00:00
|
|
|
ZONE_CONTAINER* m_zone;
|
|
|
|
ZONE_SETTINGS* m_ptr;
|
2012-07-13 18:55:29 +00:00
|
|
|
ZONE_SETTINGS m_settings; // working copy of zone settings
|
2008-09-26 19:51:36 +00:00
|
|
|
|
|
|
|
void OnOkClick( wxCommandEvent& event );
|
|
|
|
void OnCancelClick( wxCommandEvent& event );
|
2009-05-01 16:46:56 +00:00
|
|
|
void Init();
|
2008-09-26 19:51:36 +00:00
|
|
|
|
|
|
|
public:
|
2012-02-06 05:44:19 +00:00
|
|
|
DIALOG_NON_COPPER_ZONES_EDITOR( PCB_BASE_FRAME* aParent,
|
2012-03-17 14:39:27 +00:00
|
|
|
ZONE_CONTAINER* aZone, ZONE_SETTINGS* aSettings );
|
2014-07-15 16:53:13 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* Function makeLayerBitmap
|
|
|
|
* creates the colored rectangle bitmaps used in the layer selection widget.
|
|
|
|
* @param aColor is the color to fill the rectangle with.
|
|
|
|
*/
|
|
|
|
wxBitmap makeLayerBitmap( EDA_COLOR_T aColor );
|
2008-09-26 19:51:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
ZONE_EDIT_T InvokeNonCopperZonesEditor( PCB_BASE_FRAME* aParent,
|
2012-03-17 14:39:27 +00:00
|
|
|
ZONE_CONTAINER* aZone, ZONE_SETTINGS* aSettings )
|
2008-09-26 19:51:36 +00:00
|
|
|
{
|
2012-02-06 05:44:19 +00:00
|
|
|
DIALOG_NON_COPPER_ZONES_EDITOR dlg( aParent, aZone, aSettings );
|
2008-09-26 19:51:36 +00:00
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
ZONE_EDIT_T result = ZONE_EDIT_T( dlg.ShowModal() );
|
2008-09-26 19:51:36 +00:00
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
return result;
|
2008-09-26 19:51:36 +00:00
|
|
|
}
|
|
|
|
|
2009-05-01 16:46:56 +00:00
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
DIALOG_NON_COPPER_ZONES_EDITOR::DIALOG_NON_COPPER_ZONES_EDITOR( PCB_BASE_FRAME* aParent,
|
2012-03-17 14:39:27 +00:00
|
|
|
ZONE_CONTAINER* aZone,
|
|
|
|
ZONE_SETTINGS* aSettings ) :
|
2014-07-15 16:53:13 +00:00
|
|
|
DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE( aParent )
|
2008-09-26 19:51:36 +00:00
|
|
|
{
|
2014-07-15 16:53:13 +00:00
|
|
|
m_parent = aParent;
|
2012-02-06 05:44:19 +00:00
|
|
|
|
|
|
|
m_zone = aZone;
|
|
|
|
m_ptr = aSettings;
|
|
|
|
m_settings = *aSettings;
|
2008-09-27 19:26:29 +00:00
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
Init();
|
|
|
|
|
|
|
|
// the size of some items has changed, so we must call SetSizeHints()
|
|
|
|
GetSizer()->SetSizeHints( this );
|
2008-09-26 19:51:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
void DIALOG_NON_COPPER_ZONES_EDITOR::Init()
|
2008-09-26 19:51:36 +00:00
|
|
|
{
|
2014-07-15 16:53:13 +00:00
|
|
|
BOARD* board = m_parent->GetBoard();
|
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
SetReturnCode( ZONE_ABORT ); // Will be changed on button click
|
2008-09-26 19:51:36 +00:00
|
|
|
|
2010-07-12 14:07:09 +00:00
|
|
|
AddUnitSymbol( *m_MinThicknessValueTitle, g_UserUnit );
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
wxString msg = StringFromValue( g_UserUnit, m_settings.m_ZoneMinThickness );
|
2009-05-01 16:46:56 +00:00
|
|
|
m_ZoneMinThicknessCtrl->SetValue( msg );
|
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
if( m_settings.m_Zone_45_Only )
|
2008-09-26 19:51:36 +00:00
|
|
|
m_OrientEdgesOpt->SetSelection( 1 );
|
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
switch( m_settings.m_Zone_HatchingStyle )
|
2008-09-26 19:51:36 +00:00
|
|
|
{
|
|
|
|
case CPolyLine::NO_HATCH:
|
|
|
|
m_OutlineAppearanceCtrl->SetSelection( 0 );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CPolyLine::DIAGONAL_EDGE:
|
|
|
|
m_OutlineAppearanceCtrl->SetSelection( 1 );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CPolyLine::DIAGONAL_FULL:
|
|
|
|
m_OutlineAppearanceCtrl->SetSelection( 2 );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2014-07-15 16:53:13 +00:00
|
|
|
// Create one column in m_LayerSelectionCtrl
|
|
|
|
wxListItem column0;
|
|
|
|
column0.SetId( 0 );
|
|
|
|
m_LayerSelectionCtrl->InsertColumn( 0, column0 );
|
|
|
|
|
|
|
|
// Create an icon list:
|
|
|
|
wxImageList* imageList = new wxImageList( LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
|
|
|
|
m_LayerSelectionCtrl->AssignImageList( imageList, wxIMAGE_LIST_SMALL );
|
|
|
|
|
2015-09-03 07:44:30 +00:00
|
|
|
LAYER_ID lyrSelect = m_parent->GetActiveLayer();
|
2014-07-15 16:53:13 +00:00
|
|
|
|
|
|
|
if( m_zone )
|
|
|
|
lyrSelect = m_zone->GetLayer();
|
2014-06-24 16:17:18 +00:00
|
|
|
|
2014-09-25 07:07:17 +00:00
|
|
|
int ctrlWidth = 0; // Min width for m_LayerSelectionCtrl to show the layers names
|
|
|
|
int imgIdx = 0;
|
|
|
|
|
|
|
|
for( LSEQ seq = LSET::AllNonCuMask().Seq(); seq; ++seq, ++imgIdx )
|
2008-09-26 19:51:36 +00:00
|
|
|
{
|
2014-06-24 16:17:18 +00:00
|
|
|
LAYER_ID layer = *seq;
|
|
|
|
|
2014-07-15 16:53:13 +00:00
|
|
|
EDA_COLOR_T layerColor = board->GetLayerColor( layer );
|
|
|
|
imageList->Add( makeLayerBitmap( layerColor ) );
|
2014-06-30 15:03:20 +00:00
|
|
|
|
2016-04-29 11:10:31 +00:00
|
|
|
msg = board->GetLayerName( layer );
|
2014-06-30 15:03:20 +00:00
|
|
|
msg.Trim();
|
2008-09-26 19:51:36 +00:00
|
|
|
|
2014-07-15 16:53:13 +00:00
|
|
|
int itemIndex = m_LayerSelectionCtrl->InsertItem(
|
2014-09-25 07:07:17 +00:00
|
|
|
m_LayerSelectionCtrl->GetItemCount(), msg, imgIdx );
|
2014-07-15 16:53:13 +00:00
|
|
|
|
|
|
|
if(lyrSelect == layer )
|
|
|
|
m_LayerSelectionCtrl->Select( itemIndex );
|
2014-09-25 07:07:17 +00:00
|
|
|
|
|
|
|
wxSize tsize( GetTextSize( msg, m_LayerSelectionCtrl ) );
|
|
|
|
ctrlWidth = std::max( ctrlWidth, tsize.x );
|
2008-09-26 19:51:36 +00:00
|
|
|
}
|
2014-09-25 07:07:17 +00:00
|
|
|
|
|
|
|
// The most easy way to ensure the right size is to use wxLIST_AUTOSIZE
|
|
|
|
// unfortunately this option does not work well both on
|
|
|
|
// wxWidgets 2.8 ( column witdth too small), and
|
|
|
|
// wxWidgets 2.9 ( column witdth too large)
|
|
|
|
ctrlWidth += LAYER_BITMAP_SIZE_X + 25; // Add bitmap width + margin between bitmap and text
|
|
|
|
m_LayerSelectionCtrl->SetColumnWidth( 0, ctrlWidth );
|
|
|
|
|
|
|
|
ctrlWidth += 25; // add small margin between text and window borders
|
|
|
|
// and room for vertical scroll bar
|
|
|
|
m_LayerSelectionCtrl->SetMinSize( wxSize( ctrlWidth, -1 ) );
|
2008-09-26 19:51:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
void DIALOG_NON_COPPER_ZONES_EDITOR::OnOkClick( wxCommandEvent& event )
|
2008-09-26 19:51:36 +00:00
|
|
|
{
|
2014-06-24 16:17:18 +00:00
|
|
|
wxString txtvalue = m_ZoneMinThicknessCtrl->GetValue();
|
2012-02-06 05:44:19 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
m_settings.m_ZoneMinThickness = ValueFromString( g_UserUnit, txtvalue );
|
2011-09-07 19:41:04 +00:00
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
if( m_settings.m_ZoneMinThickness < 10 )
|
2009-05-01 16:46:56 +00:00
|
|
|
{
|
|
|
|
DisplayError( this,
|
2012-07-13 18:55:29 +00:00
|
|
|
_( "Error :\nyou must choose a min thickness value bigger than 0.001 inch (or 0.0254 mm)" ) );
|
2009-05-01 16:46:56 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-07-13 18:55:29 +00:00
|
|
|
m_settings.m_FillMode = 0; // Use always polygon fill mode
|
2009-05-01 16:46:56 +00:00
|
|
|
|
2008-09-26 19:51:36 +00:00
|
|
|
switch( m_OutlineAppearanceCtrl->GetSelection() )
|
|
|
|
{
|
|
|
|
case 0:
|
2012-02-06 05:44:19 +00:00
|
|
|
m_settings.m_Zone_HatchingStyle = CPolyLine::NO_HATCH;
|
2008-09-26 19:51:36 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
2012-02-06 05:44:19 +00:00
|
|
|
m_settings.m_Zone_HatchingStyle = CPolyLine::DIAGONAL_EDGE;
|
2008-09-26 19:51:36 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
2012-02-06 05:44:19 +00:00
|
|
|
m_settings.m_Zone_HatchingStyle = CPolyLine::DIAGONAL_FULL;
|
2008-09-26 19:51:36 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
wxConfigBase* cfg = Kiface().KifaceSettings();
|
|
|
|
wxASSERT( cfg );
|
|
|
|
|
|
|
|
cfg->Write( ZONE_NET_OUTLINES_HATCH_OPTION_KEY, (long) m_settings.m_Zone_HatchingStyle );
|
2008-09-26 19:51:36 +00:00
|
|
|
|
|
|
|
if( m_OrientEdgesOpt->GetSelection() == 0 )
|
2012-02-06 05:44:19 +00:00
|
|
|
m_settings.m_Zone_45_Only = false;
|
2008-09-26 19:51:36 +00:00
|
|
|
else
|
2012-02-06 05:44:19 +00:00
|
|
|
m_settings.m_Zone_45_Only = true;
|
2008-09-26 19:51:36 +00:00
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
// Get the layer selection for this zone
|
2014-07-15 16:53:13 +00:00
|
|
|
int ii = m_LayerSelectionCtrl->GetFirstSelected();
|
2011-09-07 19:41:04 +00:00
|
|
|
|
2008-09-26 19:51:36 +00:00
|
|
|
if( ii < 0 )
|
|
|
|
{
|
|
|
|
DisplayError( this, _( "Error : you must choose a layer" ) );
|
|
|
|
return;
|
|
|
|
}
|
2011-09-07 19:41:04 +00:00
|
|
|
|
2014-06-24 16:17:18 +00:00
|
|
|
LSEQ seq = LSET::AllNonCuMask().Seq();
|
|
|
|
|
|
|
|
m_settings.m_CurrentZone_Layer = seq[ii];
|
2012-02-06 05:44:19 +00:00
|
|
|
|
|
|
|
*m_ptr = m_settings;
|
|
|
|
|
2008-09-26 19:51:36 +00:00
|
|
|
EndModal( ZONE_OK );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
void DIALOG_NON_COPPER_ZONES_EDITOR::OnCancelClick( wxCommandEvent& event )
|
2008-09-26 19:51:36 +00:00
|
|
|
{
|
2012-02-06 05:44:19 +00:00
|
|
|
// do not save the edits.
|
|
|
|
|
2008-09-26 19:51:36 +00:00
|
|
|
EndModal( ZONE_ABORT );
|
|
|
|
}
|
2012-02-06 05:44:19 +00:00
|
|
|
|
2014-07-15 16:53:13 +00:00
|
|
|
|
|
|
|
wxBitmap DIALOG_NON_COPPER_ZONES_EDITOR::makeLayerBitmap( EDA_COLOR_T aColor )
|
|
|
|
{
|
|
|
|
wxBitmap bitmap( LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
|
|
|
|
wxBrush brush;
|
|
|
|
wxMemoryDC iconDC;
|
|
|
|
|
|
|
|
iconDC.SelectObject( bitmap );
|
|
|
|
brush.SetColour( MakeColour( aColor ) );
|
|
|
|
brush.SetStyle( wxBRUSHSTYLE_SOLID );
|
|
|
|
|
|
|
|
iconDC.SetBrush( brush );
|
|
|
|
iconDC.DrawRectangle( 0, 0, LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
|
|
|
|
|
|
|
|
return bitmap;
|
|
|
|
}
|