bool DIALOG_KEEPOUT_AREA_PROPERTIES::TransferDataToWindow() { // Init keepout parameters: m_cbTracksCtrl->SetValue( m_zonesettings.GetDoNotAllowTracks() ); m_cbViasCtrl->SetValue( m_zonesettings.GetDoNotAllowVias() ); m_cbCopperPourCtrl->SetValue( m_zonesettings.GetDoNotAllowCopperPour() ); m_cbConstrainCtrl->SetValue( m_zonesettings.m_Zone_45_Only ); switch( m_zonesettings.m_Zone_HatchingStyle ) { case ZONE_CONTAINER::NO_HATCH: m_OutlineAppearanceCtrl->SetSelection( 0 ); break; case ZONE_CONTAINER::DIAGONAL_EDGE: m_OutlineAppearanceCtrl->SetSelection( 1 ); break; case ZONE_CONTAINER::DIAGONAL_FULL: m_OutlineAppearanceCtrl->SetSelection( 2 ); break; } SetInitialFocus( m_OutlineAppearanceCtrl ); return true; }
bool DIALOG_KEEPOUT_AREA_PROPERTIES::TransferDataFromWindow() { // Init keepout parameters: m_zonesettings.SetIsKeepout( true ); m_zonesettings.SetDoNotAllowTracks( m_cbTracksCtrl->GetValue() ); m_zonesettings.SetDoNotAllowVias( m_cbViasCtrl->GetValue() ); m_zonesettings.SetDoNotAllowCopperPour( m_cbCopperPourCtrl->GetValue() ); // Test for not allowed items: should have at least one item not allowed: if( ! m_zonesettings.GetDoNotAllowTracks() && ! m_zonesettings.GetDoNotAllowVias() && ! m_zonesettings.GetDoNotAllowCopperPour() ) { DisplayError( NULL, _("Tracks, vias, and pads are allowed. The keepout will have no effect." ) ); return false; } if( m_zonesettings.m_Layers.count() == 0 ) { DisplayError( NULL, _( "No layers selected." ) ); return false; } switch( m_OutlineAppearanceCtrl->GetSelection() ) { case 0: m_zonesettings.m_Zone_HatchingStyle = ZONE_CONTAINER::NO_HATCH; break; case 1: m_zonesettings.m_Zone_HatchingStyle = ZONE_CONTAINER::DIAGONAL_EDGE; break; case 2: m_zonesettings.m_Zone_HatchingStyle = ZONE_CONTAINER::DIAGONAL_FULL; break; } if( m_config ) m_config->Write( ZONE_NET_OUTLINES_STYLE_KEY, (long) m_zonesettings.m_Zone_HatchingStyle ); m_zonesettings.m_Zone_45_Only = m_cbConstrainCtrl->GetValue(); m_zonesettings.m_ZonePriority = 0; // for a keepout, this param is not used. *m_ptr = m_zonesettings; return true; }