bool DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataToWindow() { m_cornerSmoothingChoice->SetSelection( m_settings.GetCornerSmoothingType() ); m_cornerRadius.SetValue( m_settings.GetCornerRadius() ); m_minWidth.SetValue( m_settings.m_ZoneMinThickness ); m_ConstrainOpt->SetValue( m_settings.m_Zone_45_Only ); switch( m_settings.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 ); switch( m_settings.m_FillMode ) { case ZFM_HATCH_PATTERN: m_GridStyleCtrl->SetSelection( 1 ); break; default: m_GridStyleCtrl->SetSelection( 0 ); break; } m_gridStyleRotation.SetUnits( DEGREES ); m_gridStyleRotation.SetValue( m_settings.m_HatchFillTypeOrientation*10 ); // IU is decidegree // Gives a reasonable value to grid style parameters, if currently there are no defined // parameters for grid pattern thickness and gap (if the value is 0) // the grid pattern thickness default value is (arbitrary) m_ZoneMinThickness * 4 // or 1mm // the grid pattern gap default value is (arbitrary) m_ZoneMinThickness * 6 // or 1.5 mm int bestvalue = m_settings.m_HatchFillTypeThickness; if( bestvalue <= 0 ) // No defined value for m_HatchFillTypeThickness bestvalue = std::max( m_settings.m_ZoneMinThickness * 4, Millimeter2iu( 1.0 ) ); m_gridStyleThickness.SetValue( std::max( bestvalue, m_settings.m_ZoneMinThickness ) ); bestvalue = m_settings.m_HatchFillTypeGap; if( bestvalue <= 0 ) // No defined value for m_HatchFillTypeGap bestvalue = std::max( m_settings.m_ZoneMinThickness * 6, Millimeter2iu( 1.5 ) ); m_gridStyleGap.SetValue( std::max( bestvalue, m_settings.m_ZoneMinThickness ) ); m_spinCtrlSmoothLevel->SetValue( m_settings.m_HatchFillTypeSmoothingLevel ); m_spinCtrlSmoothValue->SetValue( m_settings.m_HatchFillTypeSmoothingValue ); // Enable/Disable some widgets wxCommandEvent event; OnStyleSelection( event ); return true; }
bool DIALOG_TARGET_PROPERTIES::TransferDataToWindow() { m_Size.SetValue( m_Target->GetSize() ); m_Thickness.SetValue( m_Target->GetWidth() ); m_TargetShape->SetSelection( m_Target->GetShape() ? 1 : 0 ); return true; }