7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 12:01:40 +00:00

use kbool 2.1 in zones calculations. see CHANGELOG for others changes and more info

This commit is contained in:
charras 2009-09-17 17:48:40 +00:00
parent 3803b79ac5
commit 7776dd61eb
50 changed files with 1410 additions and 217 deletions

View File

@ -4,6 +4,25 @@ KiCad ChangeLog 2009
Please add newer entries at the top, list the date and your name with
email address.
2009-sept-17 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++pcbnew
Speed up ZONE_CONTAINER::Copy method
Speed up NETINFO_ITEM* BOARD::FindNet( const wxString& aNetname ) by using afast binary search
Switch to kbool V2.1. This version solves others problems in zones calculations.
Adding an other way to generate thermal shape; DO NOT USE: this is for kbool tests only
(I am thinking some bugs are remaining, so i am always working on kbool tests.
Klaas Olwerda is supporting me)
2009-sept-14 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++pcbnew
moved copper layers properties (layers couns anf layers names) from Design rules
to a specific dialog.
This must be seen as a TEMPORARY work, until a volunteer creates a better dialog box,
because there is currently no other way to change copper layers names.
2009-Sep-10 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
++pcbnew
@ -22,7 +41,7 @@ email address.
++pcbnew
Work on undo/redo in pcbnew finished.
Switch to kbool V2.0. This version solves some problems in zones calculations but not all.
The Kbool's author, Klaas Holveda, is still working on these problems
The Kbool's author, Klaas Holweda, is still working on these problems
Thanks to Klaas

View File

@ -64,6 +64,7 @@ set(BITMAP_SRCS
config.xpm
CopyBlock.xpm
copy.xpm
copper_layers_setup.cpp
Cursor_Shape.xpm
cursor.xpm
cut.xpm

View File

@ -0,0 +1,23 @@
/* XPM */
const char * copper_layers_setup_xpm[] = {
"16 16 4 1",
" c None",
". c #B70000",
"s c #606020",
"# c #008F00",
".......... ",
".......... ",
".......... ",
"...ssssssssss ",
"...ssssssssss ",
"...ssssssssss ",
"...sss##########",
"...sss##########",
"...sss##########",
"...sss##########",
" sss##########",
" sss##########",
" sss##########",
" ##########",
" ##########",
" ##########"};

View File

@ -72,9 +72,9 @@ void InitKiCadAbout( wxAboutDialogInfo& info )
/* Show Unicode or Ansi version */
#if wxUSE_UNICODE
<< ( wxT( " Unicode\n" ) );
<< ( wxT( " Unicode " ) );
# else
<< ( wxT( " Ansi\n" ) );
<< ( wxT( " Ansi " ) );
#endif
@ -107,7 +107,7 @@ void InitKiCadAbout( wxAboutDialogInfo& info )
#endif
/* Websites */
/* Websites */
description << wxT( "\n\nKiCad on the web\n\n" );
description << wxT( "http://iut-tice.ujf-grenoble.fr/kicad \n" );
description << wxT( "http://kicad.sourceforge.net \n" );

View File

@ -340,11 +340,14 @@ void EDA_LibComponentStruct::Draw( WinEDA_DrawPanel* panel, wxDC* dc,
}
}
/* Enable this to draw the anchor of the component. */
#if 0
int len = panel->GetScreen()->Unscale( 3 );
GRLine( &panel->m_ClipBox, dc, offset.x, offset.y - len, offset.x,
offset.y + len, 0, color );
GRLine( &panel->m_ClipBox, dc, offset.x - len, offset.y, offset.x + len,
offset.y, 0, color );
#endif
/* Enable this to draw the bounding box around the component to validate
* the bounding box calculations. */

View File

@ -67,7 +67,10 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
Entry->Draw( panel, DC, Pos, Multi, convert, DrawMode, Color, TransMat,
DrawPinText, false );
if( g_DebugLevel > 4 ) /* Draw the component boundary box */
/* Enable this to draw the bounding box around the component to validate
* the bounding box calculations. */
#if 0
/* Draw the component boundary box */
{
EDA_Rect BoundaryBox;
if( Component )
@ -92,6 +95,7 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
y2 = BoundaryBox.GetBottom();
GRRect( &panel->m_ClipBox, DC, x1, y1, x2, y2, BROWN );
}
#endif
}

View File

@ -309,7 +309,7 @@ void WinEDA_LibeditFrame::UpdatePartSelectList()
return;
if( !m_SelpartBox->IsEmpty() )
if( m_SelpartBox->GetCount() != 0 )
m_SelpartBox->Clear();
if( CurrentLibEntry == NULL || CurrentLibEntry->m_UnitCount <= 1 )

View File

@ -59,6 +59,7 @@ extern const char* cancel_xpm[];
extern const char* component_select_alternate_shape_xpm[];
extern const char* component_select_unit_xpm[];
extern const char* config_xpm[];
extern const char* copper_layers_setup_xpm[];
extern const char* copyblock_xpm[];
extern const char* copy_button[];
extern const char* cursor_shape_xpm[];

View File

@ -469,7 +469,7 @@ enum main_id {
ID_PCB_MIRE_BUTT,
ID_PCB_SHOW_1_RATSNEST_BUTT,
ID_PCB_PLACE_OFFSET_COORD_BUTT,
ID_PCB_UNUSED_BUTT0,
ID_PCB_COPPER_LAYERS_SETUP,
ID_PCB_UNUSED_BUTT1,
ID_PCB_UNUSED_BUTT2,
ID_PCB_UNUSED_BUTT3,

View File

@ -25,6 +25,8 @@ set(PCBNEW_SRCS
cross-probing.cpp
debug_kbool_key_file_fct.cpp
deltrack.cpp
dialog_copper_layers_setup_base.cpp
dialog_copper_layers_setup.cpp
dialog_copper_zones.cpp
dialog_copper_zones_base.cpp
dialog_design_rules.cpp

View File

@ -827,7 +827,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR* inspector, const void* testData,
* Function FindNet
* searches for a net with the given netcode.
* @param anetcode The netcode to search for.
* @return EQUIPOT* - the net or NULL if not found.
* @return NETINFO_ITEM* - the net or NULL if not found.
*/
NETINFO_ITEM* BOARD::FindNet( int anetcode ) const
{
@ -851,21 +851,66 @@ NETINFO_ITEM* BOARD::FindNet( int anetcode ) const
* Function FindNet overlayed
* searches for a net with the given name.
* @param aNetname A Netname to search for.
* @return EQUIPOT* - the net or NULL if not found.
* @return NETINFO_ITEM* - the net or NULL if not found.
*/
NETINFO_ITEM* BOARD::FindNet( const wxString& aNetname ) const
{
// the first valid netcode is 1.
// zero is reserved for "no connection" and is not used.
if( !aNetname.IsEmpty() )
if( aNetname.IsEmpty() )
return NULL;
int ncount = m_NetInfo->GetCount();
// Search for a netname = aNetname
#if 0
// Use a sequencial search: easy to understand, but slow
printf("\nsearch %s, nets %d\n", CONV_TO_UTF8(aNetname), ncount);
for( int ii = 1; ii < ncount; ii++ )
{
for( unsigned ii = 1; ii < m_NetInfo->GetCount(); ii++ )
NETINFO_ITEM* item = m_NetInfo->GetNetItem( ii );
if( item && item->GetNetname() == aNetname )
{
NETINFO_ITEM* item = m_NetInfo->GetNetItem( ii );
if( item && item->GetNetname() == aNetname )
return item;
printf(" found\n");
return item;
}
}
#else
// Use a fast binary search,
// this is possible because Nets are alphabetically ordered in list
// see NETINFO_LIST::BuildListOfNets() and NETINFO_LIST::Build_Pads_Full_List()
int imax = ncount-1;
int index = imax;
while( ncount > 0 )
{
int ii = ncount;
ncount >>= 1;
if( (ii & 1) && ( ii > 1 ) )
ncount++;
NETINFO_ITEM* item = m_NetInfo->GetNetItem( index );
if( item == NULL )
return NULL;
int icmp = item->GetNetname().Cmp(aNetname);
if (icmp == 0 ) // found !
{
printf(" found\n");
return item;
}
if( icmp < 0 ) // must search after item
{
index += ncount;
continue;
}
if( icmp > 0 ) // must search before item
{
index -= ncount;
continue;
}
}
#endif
return NULL;
}

View File

@ -197,9 +197,9 @@ void BOARD::SynchronizeNetsAndNetClasses()
{
const wxString& netname = *member;
// @todo: although this overall function seems to be adequately fast, if you
// wanted to make an improvement it would be in FindNet( wxString ) which I
// think is a sequential search.
// although this overall function seems to be adequately fast,
// FindNet( wxString ) uses now a fast binary search and is fast
// event for large net lists
NETINFO_ITEM* net = FindNet( netname );
if( net && net->GetClassName() == NETCLASS::Default )

View File

@ -59,6 +59,10 @@ void NETINFO_LIST::AppendNet( NETINFO_ITEM* aNewElement )
/* sort function, to sort pad list by netnames
* this is a case sensitive sort.
* DO NOT change it because NETINFO_ITEM* BOARD::FindNet( const wxString& aNetname )
* when search a net by its net name does a binary search
* and expects to have a nets list sorted by an alphabetic case sensitive sort
*/
static bool PadlistSortByNetnames( const D_PAD* a, const D_PAD* b )
@ -74,10 +78,14 @@ void NETINFO_LIST::BuildListOfNets()
/**
* Compute and update the net_codes for PADS et and equipots (.m_NetCode member)
* net_codes are >= 1 (net_code = 0 means not connected)
* Update the equipotents buffer
* Update the net buffer
* Must be called after editing pads (netname, or deleting) or after read a netlist
* set to 1 flag NET_CODE_OK of m_Pcb->m_Status_Pcb;
* m_Pcb->m_NbNodes and m_Pcb->m_NbNets are updated
* Be aware NETINFO_ITEM* BOARD::FindNet( const wxString& aNetname )
* when search a net by its net name does a binary search
* and expects to have a nets list sorted by an alphabetic case sensitive sort
* So do not change Build_Pads_Full_List() taht build a sorted list of pads
*/
{
D_PAD* pad;
@ -139,12 +147,16 @@ void NETINFO_LIST::Build_Pads_Full_List()
/*****************************************/
/** Function Build_Pads_Full_List
* Create the pad list, sorted by net names
* Create the pad list, sorted by net names (sorted by an alphabetic case sensitive sort)
* initialise:
* m_Pads (list of pads)
* set m_Status_Pcb = LISTE_PAD_OK;
* also clear m_Pcb->m_FullRatsnest that could have bad data
* (m_Pcb->m_FullRatsnest uses pointer to pads)
* Be aware NETINFO_ITEM* BOARD::FindNet( const wxString& aNetname )
* when search a net by its net name does a binary search
* and expects to have a nets list sorted by an alphabetic case sensitive sort
* So do not change the sort function used here
*/
{
if( m_Parent->m_Status_Pcb & LISTE_PAD_OK )
@ -167,6 +179,7 @@ void NETINFO_LIST::Build_Pads_Full_List()
}
// Sort pad list per net
//
sort( m_PadsFullList.begin(), m_PadsFullList.end(), PadlistSortByNetnames );
m_Parent->m_Status_Pcb = LISTE_PAD_OK;

View File

@ -1142,7 +1142,8 @@ void ZONE_CONTAINER::Copy( ZONE_CONTAINER* src )
m_PadOption = src->m_PadOption;
m_ThermalReliefGapValue = src->m_ThermalReliefGapValue;
m_ThermalReliefCopperBridgeValue = src->m_ThermalReliefCopperBridgeValue;
m_Poly->SetHatch( src->m_Poly->GetHatchStyle() );
m_Poly->m_HatchStyle = src->m_Poly->GetHatchStyle();
m_Poly->m_HatchLines = src->m_Poly->m_HatchLines; // Copy vector <CSegment>
m_FilledPolysList.clear();
m_FilledPolysList = src->m_FilledPolysList;
m_FillSegmList.clear();

View File

@ -11,6 +11,9 @@
#ifdef CREATE_KBOOL_KEY_FILES
// Allows or not) 0 degree orientation thermal shapes, for kbool tests
//#define CREATE_KBOOL_KEY_FILES_WITH_0_DEG
#define KEYFILE_FILENAME "dbgfile.key"
/** function CreateKeyFile

View File

@ -0,0 +1,216 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_design_rules.cpp
// Author: jean-pierre Charras
/////////////////////////////////////////////////////////////////////////////
/* functions relatives to the design rules editor
*/
#include "fctsys.h"
#include "common.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "id.h"
#include "dialog_copper_layers_setup.h"
#include "wx/generic/gridctrl.h"
// Fields Positions on layer grid
#define LAYERS_GRID_ROUTABLE_POSITION 0
#define LAYERS_GRID_STATUS_POSITION 1
#define LAYERS_GRID_NAME_POSITION 2
/***********************************************************************************/
DIALOG_COPPER_LAYERS_SETUP::DIALOG_COPPER_LAYERS_SETUP( WinEDA_PcbFrame* parent ) :
DIALOG_COPPER_LAYERS_SETUP_BASE( parent )
/***********************************************************************************/
{
m_Parent = parent;
Init();
SetAutoLayout( true );
GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this );
}
/********************************************************************/
void DIALOG_COPPER_LAYERS_SETUP::Init()
/********************************************************************/
{
SetFocus();
SetReturnCode( 0 );
// Initialize the layers grid:
m_ActivesLayersCount = g_DesignSettings.m_CopperLayerCount;
m_Pcb = m_Parent->GetBoard();
m_LayersCountSelection->SetSelection( m_ActivesLayersCount / 2 );
// Initialize the Routable column
SetRoutableLayerStatus();
// Initialize the Status column (layers attribute)
LAYER_T typelist[4] = { LT_SIGNAL, LT_POWER, LT_MIXED, LT_JUMPER };
for( int ii = 0; ii < 4; ii++ )
{
m_LayersType[ii] = typelist[ii];
m_LayersTypeName[ii] = CONV_FROM_UTF8( LAYER::ShowType( typelist[ii] ) );
}
for( int ii = 0; ii < m_gridLayersProperties->GetNumberRows(); ii++ )
{
m_gridLayersProperties->SetCellEditor( ii, LAYERS_GRID_STATUS_POSITION,
new wxGridCellChoiceEditor( WXSIZEOF(
m_LayersTypeName ),
m_LayersTypeName ) );
int select = LT_SIGNAL;
for( int jj = 0; jj < 4; jj++ )
{
int layer = LAYER_CMP_N - ii;
if( m_Pcb->GetLayerType( layer ) == m_LayersType[jj] )
{
select = m_LayersType[jj];
break;
}
}
m_gridLayersProperties->SetCellValue( ii, LAYERS_GRID_STATUS_POSITION,
m_LayersTypeName[select] );
m_gridLayersProperties->SetCellOverflow( ii, LAYERS_GRID_STATUS_POSITION, false );
}
// Initialize the Name column
for( int ii = 0; ii < m_gridLayersProperties->GetNumberRows(); ii++ )
{
wxString layer_name = m_Pcb->GetLayerName( LAYER_CMP_N - ii );
m_gridLayersProperties->SetCellValue( ii, LAYERS_GRID_NAME_POSITION, layer_name );
}
}
/* Initialize the Routable column, and the R/W property of some cells
*/
void DIALOG_COPPER_LAYERS_SETUP::SetRoutableLayerStatus()
{
m_gridLayersProperties->SetColFormatBool( LAYERS_GRID_ROUTABLE_POSITION );
for( int ii = 0; ii < m_gridLayersProperties->GetNumberRows(); ii++ )
{
int layer = LAYER_CMP_N - ii;
wxString value = layer < (m_ActivesLayersCount - 1) ? wxT( "1" ) : wxT( "0" );
if( m_ActivesLayersCount > 1 && layer == LAYER_CMP_N )
value = wxT( "1" );
if( layer == COPPER_LAYER_N )
value = wxT( "1" );
m_gridLayersProperties->SetCellValue( ii, LAYERS_GRID_ROUTABLE_POSITION, value );
m_gridLayersProperties->SetReadOnly( ii, LAYERS_GRID_ROUTABLE_POSITION );
// Set to Read Only cell for non existing copper layers:
m_gridLayersProperties->SetReadOnly( ii, LAYERS_GRID_STATUS_POSITION, value != wxT( "1" ) );
m_gridLayersProperties->SetReadOnly( ii, LAYERS_GRID_NAME_POSITION, value != wxT( "1" ) );
}
}
/*****************************************************************/
void DIALOG_COPPER_LAYERS_SETUP::OnCancelButtonClick( wxCommandEvent& event )
/*****************************************************************/
{
EndModal( 0 );
}
/**************************************************************************/
void DIALOG_COPPER_LAYERS_SETUP::OnOkButtonClick( wxCommandEvent& event )
/**************************************************************************/
{
if( !TestDataValidity() )
{
DisplayError( this, _( "Errors detected, Abort" ) );
return;
}
g_DesignSettings.m_CopperLayerCount = m_ActivesLayersCount;
// Initialize the new layer name
for( int ii = 0; ii < m_gridLayersProperties->GetNumberRows(); ii++ )
{
wxString layer_name = m_gridLayersProperties->GetCellValue( ii, LAYERS_GRID_NAME_POSITION );
if( layer_name != m_Pcb->GetLayerName( LAYER_CMP_N - ii ) )
{
m_Pcb->SetLayerName( LAYER_CMP_N - ii, layer_name );
}
}
// Initialize the layer type
for( int ii = 0; ii < m_gridLayersProperties->GetNumberRows(); ii++ )
{
wxString txt = m_gridLayersProperties->GetCellValue( ii, LAYERS_GRID_STATUS_POSITION );
int layer = LAYER_CMP_N - ii;
for( int jj = 0; jj < 3; jj++ )
{
if( m_LayersTypeName[jj] == txt )
{
m_Pcb->SetLayerType( layer, m_LayersType[jj] );
break;
}
}
}
m_Parent->ReCreateLayerBox( NULL );
EndModal( wxID_OK );
}
/**************************************************************************/
void DIALOG_COPPER_LAYERS_SETUP::OnLayerCountClick( wxCommandEvent& event )
/**************************************************************************/
{
m_ActivesLayersCount = m_LayersCountSelection->GetSelection() * 2;
if( m_ActivesLayersCount <= 0 )
m_ActivesLayersCount = 1;
// Reinit the routable layers status
SetRoutableLayerStatus();
}
/* TestDataValidity
* Performs a control of data validity
* set the background of a bad cell in RED and display an info message
* @return true if Ok, false if error
*/
bool DIALOG_COPPER_LAYERS_SETUP::TestDataValidity()
{
bool success = true;
m_MessagesList->SetPage(wxEmptyString); // Clear message list
// Test duplicate layers names
for( int ii = 0; ii < m_gridLayersProperties->GetNumberRows() - 1; ii++ )
{
wxString value = m_gridLayersProperties->GetCellValue( ii, LAYERS_GRID_NAME_POSITION );
for( int jj = ii+1; jj < m_gridLayersProperties->GetNumberRows(); jj++ )
{
wxString othervalue = m_gridLayersProperties->GetCellValue( ii,
LAYERS_GRID_NAME_POSITION );
othervalue = m_gridLayersProperties->GetCellValue( jj, LAYERS_GRID_NAME_POSITION );
if( value.CmpNoCase( othervalue ) == 0 ) // Already exists!
{
wxString text;
text.Printf( _(
"<small>This layer name <b>%s</b> is already existing<br>" ),
value.GetData() );
m_MessagesList->AppendToPage( text );
success = false;
}
}
}
return success;
}

View File

@ -0,0 +1,36 @@
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_COPPER_LAYERS_SETUP
///////////////////////////////////////////////////////////////////////////////
#ifndef __dialog_design_rules_h_
#define __dialog_design_rules_h_
#include "dialog_copper_layers_setup_base.h"
class DIALOG_COPPER_LAYERS_SETUP : public DIALOG_COPPER_LAYERS_SETUP_BASE
{
private:
WinEDA_PcbFrame * m_Parent;
int m_ActivesLayersCount;
BOARD * m_Pcb;
LAYER_T m_LayersType[4];
wxString m_LayersTypeName[4];
private:
void OnCancelButtonClick( wxCommandEvent& event );
void OnOkButtonClick( wxCommandEvent& event );
void OnLayerCountClick( wxCommandEvent& event );
void OnLayerGridLeftClick( wxGridEvent& event ){ event.Skip(); }
void OnLayerGridRighttClick( wxGridEvent& event ){ event.Skip(); }
void Init();
void SetRoutableLayerStatus( );
bool TestDataValidity();
public:
DIALOG_COPPER_LAYERS_SETUP( WinEDA_PcbFrame* parent );
~DIALOG_COPPER_LAYERS_SETUP( ) { };
};
#endif //__dialog_design_rules_h_

View File

@ -0,0 +1,114 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_copper_layers_setup_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_COPPER_LAYERS_SETUP_BASE::DIALOG_COPPER_LAYERS_SETUP_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bMainSizerLayers;
bMainSizerLayers = new wxBoxSizer( wxHORIZONTAL );
wxString m_LayersCountSelectionChoices[] = { _("1"), _("2"), _("4"), _("6"), _("8"), _("10"), _("12"), _("14"), _("16") };
int m_LayersCountSelectionNChoices = sizeof( m_LayersCountSelectionChoices ) / sizeof( wxString );
m_LayersCountSelection = new wxRadioBox( this, ID_LAYERS_COUNT_SELECTION, _("Layers Count"), wxDefaultPosition, wxDefaultSize, m_LayersCountSelectionNChoices, m_LayersCountSelectionChoices, 1, wxRA_SPECIFY_COLS );
m_LayersCountSelection->SetSelection( 1 );
bMainSizerLayers->Add( m_LayersCountSelection, 0, wxALL, 5 );
m_gridLayersProperties = new wxGrid( this, ID_LAYERS_PROPERTIES, wxDefaultPosition, wxDefaultSize, 0 );
// Grid
m_gridLayersProperties->CreateGrid( 16, 3 );
m_gridLayersProperties->EnableEditing( true );
m_gridLayersProperties->EnableGridLines( true );
m_gridLayersProperties->EnableDragGridSize( false );
m_gridLayersProperties->SetMargins( 0, 0 );
// Columns
m_gridLayersProperties->SetColSize( 0, 100 );
m_gridLayersProperties->SetColSize( 1, 100 );
m_gridLayersProperties->SetColSize( 2, 150 );
m_gridLayersProperties->EnableDragColMove( false );
m_gridLayersProperties->EnableDragColSize( true );
m_gridLayersProperties->SetColLabelSize( 30 );
m_gridLayersProperties->SetColLabelValue( 0, _("Active") );
m_gridLayersProperties->SetColLabelValue( 1, _("Status") );
m_gridLayersProperties->SetColLabelValue( 2, _("Name") );
m_gridLayersProperties->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Rows
m_gridLayersProperties->AutoSizeRows();
m_gridLayersProperties->EnableDragRowSize( true );
m_gridLayersProperties->SetRowLabelSize( 80 );
m_gridLayersProperties->SetRowLabelValue( 0, _("Top Layer") );
m_gridLayersProperties->SetRowLabelValue( 1, _("Inner 14") );
m_gridLayersProperties->SetRowLabelValue( 2, _("Inner 13") );
m_gridLayersProperties->SetRowLabelValue( 3, _("Inner 12") );
m_gridLayersProperties->SetRowLabelValue( 4, _("Inner 11") );
m_gridLayersProperties->SetRowLabelValue( 5, _("Inner 10") );
m_gridLayersProperties->SetRowLabelValue( 6, _("Inner 9") );
m_gridLayersProperties->SetRowLabelValue( 7, _("Inner 8") );
m_gridLayersProperties->SetRowLabelValue( 8, _("Inner 7") );
m_gridLayersProperties->SetRowLabelValue( 9, _("Inner 6") );
m_gridLayersProperties->SetRowLabelValue( 10, _("Inner 5") );
m_gridLayersProperties->SetRowLabelValue( 11, _("Inner 4") );
m_gridLayersProperties->SetRowLabelValue( 12, _("Inner 3") );
m_gridLayersProperties->SetRowLabelValue( 13, _("Inner 2") );
m_gridLayersProperties->SetRowLabelValue( 14, _("Inner 1") );
m_gridLayersProperties->SetRowLabelValue( 15, _("Bottom Layer") );
m_gridLayersProperties->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Label Appearance
// Cell Defaults
m_gridLayersProperties->SetDefaultCellAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
bMainSizerLayers->Add( m_gridLayersProperties, 1, wxALL|wxEXPAND, 5 );
bMainSizer->Add( bMainSizerLayers, 1, wxEXPAND, 5 );
wxStaticBoxSizer* sbSizer1;
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Messages:") ), wxVERTICAL );
m_MessagesList = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO );
sbSizer1->Add( m_MessagesList, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bMainSizer->Add( sbSizer1, 1, wxEXPAND, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
m_sdbSizer1->AddButton( m_sdbSizer1OK );
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize();
bMainSizer->Add( m_sdbSizer1, 0, wxALIGN_RIGHT, 5 );
this->SetSizer( bMainSizer );
this->Layout();
// Connect Events
m_LayersCountSelection->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_COPPER_LAYERS_SETUP_BASE::OnLayerCountClick ), NULL, this );
m_gridLayersProperties->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_COPPER_LAYERS_SETUP_BASE::OnLayerGridLeftClick ), NULL, this );
m_gridLayersProperties->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_COPPER_LAYERS_SETUP_BASE::OnLayerGridRighttClick ), NULL, this );
m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_COPPER_LAYERS_SETUP_BASE::OnCancelButtonClick ), NULL, this );
m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_COPPER_LAYERS_SETUP_BASE::OnOkButtonClick ), NULL, this );
}
DIALOG_COPPER_LAYERS_SETUP_BASE::~DIALOG_COPPER_LAYERS_SETUP_BASE()
{
// Disconnect Events
m_LayersCountSelection->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_COPPER_LAYERS_SETUP_BASE::OnLayerCountClick ), NULL, this );
m_gridLayersProperties->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_COPPER_LAYERS_SETUP_BASE::OnLayerGridLeftClick ), NULL, this );
m_gridLayersProperties->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_COPPER_LAYERS_SETUP_BASE::OnLayerGridRighttClick ), NULL, this );
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_COPPER_LAYERS_SETUP_BASE::OnCancelButtonClick ), NULL, this );
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_COPPER_LAYERS_SETUP_BASE::OnOkButtonClick ), NULL, this );
}

View File

@ -0,0 +1,349 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="9" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_copper_layers_setup_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">1</property>
<property name="name">dialog_copper_layers_setup_base</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
<property name="bg"></property>
<property name="center"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="extra_style"></property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size">-1,-1</property>
<property name="name">DIALOG_COPPER_LAYERS_SETUP_BASE</property>
<property name="pos"></property>
<property name="size">558,479</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass"></property>
<property name="title">Copper layers setup</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnChar"></event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bMainSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bMainSizerLayers</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxRadioBox" expanded="1">
<property name="bg"></property>
<property name="choices">&quot;1&quot; &quot;2&quot; &quot;4&quot; &quot;6&quot; &quot;8&quot; &quot;10&quot; &quot;12&quot; &quot;14&quot; &quot;16&quot;</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">ID_LAYERS_COUNT_SELECTION</property>
<property name="label">Layers Count</property>
<property name="majorDimension">1</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_LayersCountSelection</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="selection">1</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRadioBox">OnLayerCountClick</event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxGrid" expanded="1">
<property name="autosize_cols">0</property>
<property name="autosize_rows">1</property>
<property name="bg"></property>
<property name="cell_bg"></property>
<property name="cell_font"></property>
<property name="cell_horiz_alignment">wxALIGN_CENTRE</property>
<property name="cell_text"></property>
<property name="cell_vert_alignment">wxALIGN_CENTRE</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTRE</property>
<property name="col_label_size">30</property>
<property name="col_label_values">&quot;Active&quot; &quot;Status&quot; &quot;Name&quot;</property>
<property name="col_label_vert_alignment">wxALIGN_CENTRE</property>
<property name="cols">3</property>
<property name="column_sizes">100,100,150</property>
<property name="context_help"></property>
<property name="drag_col_move">0</property>
<property name="drag_col_size">1</property>
<property name="drag_grid_size">0</property>
<property name="drag_row_size">1</property>
<property name="editing">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="grid_line_color"></property>
<property name="grid_lines">1</property>
<property name="hidden">0</property>
<property name="id">ID_LAYERS_PROPERTIES</property>
<property name="label_bg"></property>
<property name="label_font"></property>
<property name="label_text"></property>
<property name="margin_height">0</property>
<property name="margin_width">0</property>
<property name="maximum_size"></property>
<property name="minimum_size">-1,-1</property>
<property name="name">m_gridLayersProperties</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="row_label_horiz_alignment">wxALIGN_CENTRE</property>
<property name="row_label_size">80</property>
<property name="row_label_values">&quot;Top Layer&quot; &quot;Inner 14&quot; &quot;Inner 13&quot; &quot;Inner 12&quot; &quot;Inner 11&quot; &quot;Inner 10&quot; &quot;Inner 9&quot; &quot;Inner 8&quot; &quot;Inner 7&quot; &quot;Inner 6&quot; &quot;Inner 5&quot; &quot;Inner 4&quot; &quot;Inner 3&quot; &quot;Inner 2&quot; &quot;Inner 1&quot; &quot;Bottom Layer&quot;</property>
<property name="row_label_vert_alignment">wxALIGN_CENTRE</property>
<property name="row_sizes"></property>
<property name="rows">16</property>
<property name="size"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnGridCellChange"></event>
<event name="OnGridCellLeftClick">OnLayerGridLeftClick</event>
<event name="OnGridCellLeftDClick"></event>
<event name="OnGridCellRightClick">OnLayerGridRighttClick</event>
<event name="OnGridCellRightDClick"></event>
<event name="OnGridCmdCellChange"></event>
<event name="OnGridCmdCellLeftClick"></event>
<event name="OnGridCmdCellLeftDClick"></event>
<event name="OnGridCmdCellRightClick"></event>
<event name="OnGridCmdCellRightDClick"></event>
<event name="OnGridCmdColSize"></event>
<event name="OnGridCmdEditorCreated"></event>
<event name="OnGridCmdEditorHidden"></event>
<event name="OnGridCmdEditorShown"></event>
<event name="OnGridCmdLabelLeftClick"></event>
<event name="OnGridCmdLabelLeftDClick"></event>
<event name="OnGridCmdLabelRightClick"></event>
<event name="OnGridCmdLabelRightDClick"></event>
<event name="OnGridCmdRangeSelect"></event>
<event name="OnGridCmdRowSize"></event>
<event name="OnGridCmdSelectCell"></event>
<event name="OnGridColSize"></event>
<event name="OnGridEditorCreated"></event>
<event name="OnGridEditorHidden"></event>
<event name="OnGridEditorShown"></event>
<event name="OnGridLabelLeftClick"></event>
<event name="OnGridLabelLeftDClick"></event>
<event name="OnGridLabelRightClick"></event>
<event name="OnGridLabelRightDClick"></event>
<event name="OnGridRangeSelect"></event>
<event name="OnGridRowSize"></event>
<event name="OnGridSelectCell"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Messages:</property>
<property name="minimum_size"></property>
<property name="name">sbSizer1</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxHtmlWindow" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_MessagesList</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxHW_SCROLLBAR_AUTO</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHtmlCellClicked"></event>
<event name="OnHtmlCellHover"></event>
<event name="OnHtmlLinkClicked"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_RIGHT</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="1">
<property name="Apply">0</property>
<property name="Cancel">1</property>
<property name="ContextHelp">0</property>
<property name="Help">0</property>
<property name="No">0</property>
<property name="OK">1</property>
<property name="Save">0</property>
<property name="Yes">0</property>
<property name="minimum_size"></property>
<property name="name">m_sdbSizer1</property>
<property name="permission">protected</property>
<event name="OnApplyButtonClick"></event>
<event name="OnCancelButtonClick">OnCancelButtonClick</event>
<event name="OnContextHelpButtonClick"></event>
<event name="OnHelpButtonClick"></event>
<event name="OnNoButtonClick"></event>
<event name="OnOKButtonClick">OnOkButtonClick</event>
<event name="OnSaveButtonClick"></event>
<event name="OnYesButtonClick"></event>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -0,0 +1,60 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_copper_layers_setup_base__
#define __dialog_copper_layers_setup_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/radiobox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/grid.h>
#include <wx/sizer.h>
#include <wx/html/htmlwin.h>
#include <wx/statbox.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
#define ID_LAYERS_COUNT_SELECTION 1000
#define ID_LAYERS_PROPERTIES 1001
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_COPPER_LAYERS_SETUP_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_COPPER_LAYERS_SETUP_BASE : public wxDialog
{
private:
protected:
wxRadioBox* m_LayersCountSelection;
wxGrid* m_gridLayersProperties;
wxHtmlWindow* m_MessagesList;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, overide them in your derived class
virtual void OnLayerCountClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnLayerGridLeftClick( wxGridEvent& event ){ event.Skip(); }
virtual void OnLayerGridRighttClick( wxGridEvent& event ){ event.Skip(); }
virtual void OnCancelButtonClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkButtonClick( wxCommandEvent& event ){ event.Skip(); }
public:
DIALOG_COPPER_LAYERS_SETUP_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Copper layers setup"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 558,479 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_COPPER_LAYERS_SETUP_BASE();
};
#endif //__dialog_copper_layers_setup_base__

View File

@ -290,6 +290,9 @@ static void class2gridRow( wxGrid* grid, int row, NETCLASS* nc, int units )
grid->SetCellValue( row, GRID_uVIADRILL, msg );
}
/** Function InitRulesList()
* Fill the grid showing current rules with values
*/
void DIALOG_DESIGN_RULES::InitRulesList()
{
NETCLASSES& netclasses = m_Pcb->m_NetClasses;
@ -300,8 +303,10 @@ void DIALOG_DESIGN_RULES::InitRulesList()
m_grid->AppendRows( netclasses.GetCount()+1 - m_grid->GetNumberRows() );
}
// enter the Default NETCLASS.
class2gridRow( m_grid, 0, netclasses.GetDefault(), m_Parent->m_InternalUnits );
// enter others netclasses
int row = 1;
for( NETCLASSES::iterator i=netclasses.begin(); i!=netclasses.end(); ++i, ++row )
{
@ -326,7 +331,7 @@ static void gridRow2class( wxGrid* grid, int row, NETCLASS* nc, int units )
}
/* Copy the rules list to board
/* Copy the rules list from grid to board
*/
void DIALOG_DESIGN_RULES::CopyRulesListToBoard()
{
@ -452,6 +457,44 @@ void DIALOG_DESIGN_RULES::OnRemoveNetclassClick( wxCommandEvent& event )
InitializeRulesSelectionBoxes();
}
/*
* Called on "Move Up" button click
* the selected(s) rules are moved up
* The default netclass is always the first rule
*/
void DIALOG_DESIGN_RULES::OnMoveUpSelectedNetClass( wxCommandEvent& event )
{
// Cannot move up rules if we have 1 or 2 rules only
if( m_grid->GetNumberRows() < 3 )
return;
wxArrayInt select = m_grid->GetSelectedRows();
bool reinit = false;
for( unsigned irow = 0; irow < select.GetCount(); irow++ )
{
int ii = select[irow];
if( ii < 2 ) // The default netclass *must* be the first netclass
continue; // so we cannot move up line 0 and 1
// Swap the rule and the previous rule
wxString curr_value, previous_value;
for( int icol = 0; icol < m_grid->GetNumberCols(); icol++ )
{
reinit = true;
curr_value = m_grid->GetCellValue( ii, icol );
previous_value = m_grid->GetCellValue( ii-1, icol );
m_grid->SetCellValue( ii, icol, previous_value );
m_grid->SetCellValue( ii-1, icol, curr_value );
}
curr_value = m_grid->GetRowLabelValue( ii );
previous_value = m_grid->GetRowLabelValue( ii-1 );
m_grid->SetRowLabelValue(ii, previous_value );
m_grid->SetRowLabelValue(ii-1, curr_value );
}
if( reinit )
InitializeRulesSelectionBoxes();
}
/*
* Called on the left Choice Box selection

View File

@ -42,15 +42,16 @@ private:
NETCUPS m_AllNets;
private:
void OnLayerCountClick( wxCommandEvent& event );
void OnLayerGridLeftClick( wxGridEvent& event ){ event.Skip(); }
void OnLayerGridRighttClick( wxGridEvent& event ){ event.Skip(); }
// void OnLayerCountClick( wxCommandEvent& event );
// void OnLayerGridLeftClick( wxGridEvent& event ){ event.Skip(); }
// void OnLayerGridRighttClick( wxGridEvent& event ){ event.Skip(); }
void OnNetClassesGridLeftClick( wxGridEvent& event ){ event.Skip(); }
void OnNetClassesGridRightClick( wxGridEvent& event ){ event.Skip(); }
void OnCancelButtonClick( wxCommandEvent& event );
void OnOkButtonClick( wxCommandEvent& event );
void OnAddNetclassClick( wxCommandEvent& event );
void OnRemoveNetclassClick( wxCommandEvent& event );
void OnMoveUpSelectedNetClass( wxCommandEvent& event );
void OnLeftCBSelection( wxCommandEvent& event );
void OnRightCBSelection( wxCommandEvent& event );
void OnRightToLeftCopyButton( wxCommandEvent& event );

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 9 2009)
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -79,7 +79,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
buttonBoxSizer->Add( m_moveUpButton, 0, wxALL, 5 );
sbSizer1->Add( buttonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM, 5 );
sbSizer1->Add( buttonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
bMainSizer->Add( sbSizer1, 1, wxALL|wxEXPAND, 5 );
@ -138,7 +138,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
sbSizer4->Add( rghtNetSelectBoxSizer, 0, wxALL|wxEXPAND, 5 );
bMainSizer->Add( sbSizer4, 2, wxALL|wxEXPAND, 5 );
bMainSizer->Add( sbSizer4, 2, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxStaticBoxSizer* sbSizer2;
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Messages:") ), wxHORIZONTAL );
@ -146,7 +146,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_MessagesList = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO|wxSUNKEN_BORDER );
m_MessagesList->SetMinSize( wxSize( -1,100 ) );
sbSizer2->Add( m_MessagesList, 1, wxALL|wxEXPAND, 5 );
sbSizer2->Add( m_MessagesList, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
bMainSizer->Add( sbSizer2, 0, wxALL|wxEXPAND, 5 );
@ -166,6 +166,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_grid->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesGridRightClick ), NULL, this );
m_addButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnAddNetclassClick ), NULL, this );
m_removeButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRemoveNetclassClick ), NULL, this );
m_moveUpButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnMoveUpSelectedNetClass ), NULL, this );
m_leftClassChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftCBSelection ), NULL, this );
m_buttonRightToLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightToLeftCopyButton ), NULL, this );
m_buttonLeftToRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftToRightCopyButton ), NULL, this );
@ -183,6 +184,7 @@ DIALOG_DESIGN_RULES_BASE::~DIALOG_DESIGN_RULES_BASE()
m_grid->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesGridRightClick ), NULL, this );
m_addButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnAddNetclassClick ), NULL, this );
m_removeButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRemoveNetclassClick ), NULL, this );
m_moveUpButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnMoveUpSelectedNetClass ), NULL, this );
m_leftClassChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftCBSelection ), NULL, this );
m_buttonRightToLeft->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightToLeftCopyButton ), NULL, this );
m_buttonLeftToRight->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftToRightCopyButton ), NULL, this );
@ -191,5 +193,4 @@ DIALOG_DESIGN_RULES_BASE::~DIALOG_DESIGN_RULES_BASE()
m_rightClassChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightCBSelection ), NULL, this );
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnCancelButtonClick ), NULL, this );
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnOkButtonClick ), NULL, this );
}

View File

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="10" />
<FileVersion major="1" minor="9" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_python_events">0</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_design_rules_base</property>
@ -18,16 +16,13 @@
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_python_events">1</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
<property name="bg"></property>
<property name="center"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="extra_style"></property>
<property name="fg"></property>
<property name="font"></property>
@ -37,15 +32,11 @@
<property name="minimum_size">600,520</property>
<property name="name">DIALOG_DESIGN_RULES_BASE</property>
<property name="pos"></property>
<property name="size">750,520</property>
<property name="size">750,692</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass"></property>
<property name="title">Design Rules Editor</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -116,7 +107,6 @@
<property name="cols">6</property>
<property name="column_sizes">100,100,100,100,100</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="drag_col_move">0</property>
<property name="drag_col_size">1</property>
<property name="drag_grid_size">0</property>
@ -148,10 +138,6 @@
<property name="size"></property>
<property name="subclass"></property>
<property name="tooltip">Net Class parameters</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE|wxFILTER_NUMERIC</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxHSCROLL|wxSIMPLE_BORDER|wxVSCROLL</property>
@ -214,7 +200,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxBOTTOM</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
@ -228,7 +214,6 @@
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
@ -245,10 +230,6 @@
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip">Add another Net Class</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -285,7 +266,6 @@
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
@ -302,10 +282,6 @@
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip">Remove the currently select Net Class</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -342,7 +318,6 @@
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
@ -359,14 +334,10 @@
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip">Move the currently selected Net Class up one row</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick"></event>
<event name="OnButtonClick">OnMoveUpSelectedNetClass</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -398,7 +369,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">2</property>
<object class="wxStaticBoxSizer" expanded="0">
<property name="id">wxID_ANY</property>
@ -425,7 +396,6 @@
<property name="bg"></property>
<property name="choices"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
@ -440,10 +410,6 @@
<property name="size"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -480,7 +446,6 @@
<object class="wxListCtrl" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
@ -495,10 +460,6 @@
<property name="style">wxLC_HRULES|wxLC_REPORT|wxLC_VRULES</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -565,7 +526,6 @@
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
@ -582,10 +542,6 @@
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -622,7 +578,6 @@
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
@ -639,10 +594,6 @@
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -688,7 +639,6 @@
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
@ -705,10 +655,6 @@
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -745,7 +691,6 @@
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
@ -762,10 +707,6 @@
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -816,7 +757,6 @@
<property name="bg"></property>
<property name="choices"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
@ -831,10 +771,6 @@
<property name="size"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -871,7 +807,6 @@
<object class="wxListCtrl" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
@ -886,10 +821,6 @@
<property name="style">wxLC_HRULES|wxLC_REPORT|wxLC_VRULES</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -956,12 +887,11 @@
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxHtmlWindow" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
@ -976,10 +906,6 @@
<property name="style">wxHW_SCROLLBAR_AUTO</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxSUNKEN_BORDER</property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 9 2009)
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -59,23 +59,23 @@ class DIALOG_DESIGN_RULES_BASE : public wxDialog
wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, overide them in your derived class
virtual void OnNetClassesGridLeftClick( wxGridEvent& event ) { event.Skip(); }
virtual void OnNetClassesGridRightClick( wxGridEvent& event ) { event.Skip(); }
virtual void OnAddNetclassClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRemoveNetclassClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnLeftCBSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRightToLeftCopyButton( wxCommandEvent& event ) { event.Skip(); }
virtual void OnLeftToRightCopyButton( wxCommandEvent& event ) { event.Skip(); }
virtual void OnLeftSelectAllButton( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRightSelectAllButton( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRightCBSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOkButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnNetClassesGridLeftClick( wxGridEvent& event ){ event.Skip(); }
virtual void OnNetClassesGridRightClick( wxGridEvent& event ){ event.Skip(); }
virtual void OnAddNetclassClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnRemoveNetclassClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnMoveUpSelectedNetClass( wxCommandEvent& event ){ event.Skip(); }
virtual void OnLeftCBSelection( wxCommandEvent& event ){ event.Skip(); }
virtual void OnRightToLeftCopyButton( wxCommandEvent& event ){ event.Skip(); }
virtual void OnLeftToRightCopyButton( wxCommandEvent& event ){ event.Skip(); }
virtual void OnLeftSelectAllButton( wxCommandEvent& event ){ event.Skip(); }
virtual void OnRightSelectAllButton( wxCommandEvent& event ){ event.Skip(); }
virtual void OnRightCBSelection( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelButtonClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkButtonClick( wxCommandEvent& event ){ event.Skip(); }
public:
DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Design Rules Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 750,520 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Design Rules Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 750,692 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_DESIGN_RULES_BASE();
};

Some files were not shown because too many files have changed in this diff Show More