2021-07-17 19:56:18 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2024-03-09 13:50:26 +00:00
|
|
|
* Copyright (C) 2021-2024 KiCad Developers, see AUTHORS.txt for contributors.
|
2021-07-17 19:56:18 +00:00
|
|
|
*
|
|
|
|
* 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 <widgets/color_swatch.h>
|
|
|
|
#include <stroke_params.h>
|
|
|
|
#include <sch_edit_frame.h>
|
2024-04-15 20:18:54 +00:00
|
|
|
#include <symbol_edit_frame.h>
|
2021-07-17 19:56:18 +00:00
|
|
|
#include <sch_shape.h>
|
|
|
|
#include <dialog_shape_properties.h>
|
2022-03-29 19:41:03 +00:00
|
|
|
#include <settings/color_settings.h>
|
2024-04-15 20:18:54 +00:00
|
|
|
#include <symbol_editor_settings.h>
|
2023-06-09 21:41:33 +00:00
|
|
|
#include <sch_commit.h>
|
2024-04-15 20:18:54 +00:00
|
|
|
#include <string_utils.h>
|
2023-06-07 22:45:06 +00:00
|
|
|
|
2021-07-17 19:56:18 +00:00
|
|
|
|
2024-04-15 20:18:54 +00:00
|
|
|
DIALOG_SHAPE_PROPERTIES::DIALOG_SHAPE_PROPERTIES( SCH_BASE_FRAME* aParent, SCH_SHAPE* aShape ) :
|
2021-07-17 19:56:18 +00:00
|
|
|
DIALOG_SHAPE_PROPERTIES_BASE( aParent ),
|
2022-01-11 18:33:30 +00:00
|
|
|
m_frame( aParent ),
|
2021-07-17 19:56:18 +00:00
|
|
|
m_shape( aShape ),
|
2022-04-05 22:32:48 +00:00
|
|
|
m_borderWidth( aParent, m_borderWidthLabel, m_borderWidthCtrl, m_borderWidthUnits, true )
|
2021-07-17 19:56:18 +00:00
|
|
|
{
|
2024-04-15 20:18:54 +00:00
|
|
|
SetTitle( wxString::Format( GetTitle(), aShape->GetFriendlyName() ) );
|
|
|
|
|
|
|
|
// DIALOG_SHIM needs a unique hash_key because classname is not sufficient because the
|
|
|
|
// different shapes (and even whether or not we're within the symbol editor) cause different
|
|
|
|
// dialog layouts).
|
|
|
|
m_hash_key = TO_UTF8( GetTitle() + aParent->GetName() );
|
2021-07-17 19:56:18 +00:00
|
|
|
|
2021-12-24 17:23:41 +00:00
|
|
|
m_helpLabel1->SetFont( KIUI::GetInfoFont( this ).Italic() );
|
|
|
|
m_helpLabel2->SetFont( KIUI::GetInfoFont( this ).Italic() );
|
2021-07-17 19:56:18 +00:00
|
|
|
|
2024-04-15 20:18:54 +00:00
|
|
|
COLOR_SETTINGS* colorSettings = m_frame->GetColorSettings();
|
|
|
|
COLOR4D schematicBackground = colorSettings->GetColor( LAYER_SCHEMATIC_BACKGROUND );
|
2021-07-17 19:56:18 +00:00
|
|
|
|
2022-04-05 22:32:48 +00:00
|
|
|
m_borderColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
|
2024-04-15 20:18:54 +00:00
|
|
|
m_borderColorSwatch->SetSwatchBackground( schematicBackground );
|
2021-07-17 19:56:18 +00:00
|
|
|
|
2023-11-25 13:05:45 +00:00
|
|
|
for( const auto& [ lineStyle, lineStyleDesc ] : lineTypeNames )
|
2024-01-22 03:55:13 +00:00
|
|
|
m_borderStyleCombo->Append( lineStyleDesc.name, KiBitmapBundle( lineStyleDesc.bitmap ) );
|
2021-07-17 19:56:18 +00:00
|
|
|
|
2022-04-05 22:32:48 +00:00
|
|
|
m_borderStyleCombo->Append( DEFAULT_STYLE );
|
2021-07-17 19:56:18 +00:00
|
|
|
|
|
|
|
m_fillColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
|
2024-04-15 20:18:54 +00:00
|
|
|
m_fillColorSwatch->SetSwatchBackground( schematicBackground );
|
2021-07-17 19:56:18 +00:00
|
|
|
|
2022-09-05 11:43:08 +00:00
|
|
|
KIGFX::COLOR4D canvas = m_frame->GetColorSettings()->GetColor( LAYER_SCHEMATIC_BACKGROUND );
|
|
|
|
m_borderColorSwatch->SetSwatchBackground( canvas.ToColour() );
|
|
|
|
m_fillColorSwatch->SetSwatchBackground( canvas.ToColour() );
|
|
|
|
|
2022-03-29 19:41:03 +00:00
|
|
|
if( m_frame->GetColorSettings()->GetOverrideSchItemColors() )
|
|
|
|
m_infoBar->ShowMessage( _( "Note: individual item colors overridden in Preferences." ) );
|
|
|
|
|
2024-04-15 20:18:54 +00:00
|
|
|
SetInitialFocus( m_borderWidthCtrl );
|
|
|
|
|
2021-07-17 19:56:18 +00:00
|
|
|
// Required under wxGTK if we want to dismiss the dialog with the ESC key
|
|
|
|
SetFocus();
|
2021-11-16 19:39:58 +00:00
|
|
|
|
|
|
|
SetupStandardButtons();
|
2021-07-17 19:56:18 +00:00
|
|
|
|
2024-04-15 20:18:54 +00:00
|
|
|
if( SYMBOL_EDIT_FRAME* symbolEditor = dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame ) )
|
|
|
|
{
|
|
|
|
m_fillBook->SetSelection( 1 );
|
|
|
|
|
|
|
|
if( !symbolEditor->IsSymbolEditable() || symbolEditor->IsSymbolAlias() )
|
|
|
|
{
|
|
|
|
m_sdbSizerCancel->SetDefault();
|
|
|
|
m_sdbSizerOK->SetLabel( _( "Read Only" ) );
|
|
|
|
m_sdbSizerOK->Enable( false );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_fillBook->SetSelection( 0 );
|
|
|
|
m_symbolEditorSizer->Show( false );
|
|
|
|
}
|
|
|
|
|
|
|
|
m_borderColorSwatch->Bind( COLOR_SWATCH_CHANGED, &DIALOG_SHAPE_PROPERTIES::onBorderSwatch,
|
|
|
|
this );
|
|
|
|
m_customColorSwatch->Bind( COLOR_SWATCH_CHANGED, &DIALOG_SHAPE_PROPERTIES::onCustomColorSwatch,
|
|
|
|
this );
|
|
|
|
|
2021-07-17 19:56:18 +00:00
|
|
|
// Now all widgets have the size fixed, call FinishDialogSettings
|
|
|
|
finishDialogSettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-04-15 20:18:54 +00:00
|
|
|
DIALOG_SHAPE_PROPERTIES::~DIALOG_SHAPE_PROPERTIES()
|
|
|
|
{
|
|
|
|
m_borderColorSwatch->Unbind( COLOR_SWATCH_CHANGED, &DIALOG_SHAPE_PROPERTIES::onBorderSwatch,
|
|
|
|
this );
|
|
|
|
m_customColorSwatch->Unbind( COLOR_SWATCH_CHANGED, &DIALOG_SHAPE_PROPERTIES::onCustomColorSwatch,
|
|
|
|
this );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-07-17 19:56:18 +00:00
|
|
|
bool DIALOG_SHAPE_PROPERTIES::TransferDataToWindow()
|
|
|
|
{
|
|
|
|
if( !wxDialog::TransferDataToWindow() )
|
|
|
|
return false;
|
|
|
|
|
2022-04-05 22:32:48 +00:00
|
|
|
if( m_shape->GetWidth() >= 0 )
|
|
|
|
{
|
|
|
|
m_borderCheckbox->SetValue( true );
|
|
|
|
m_borderWidth.SetValue( m_shape->GetWidth() );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_borderCheckbox->SetValue( false );
|
|
|
|
|
|
|
|
m_borderWidth.Enable( false );
|
|
|
|
m_borderColorLabel->Enable( false );
|
|
|
|
m_borderColorSwatch->Enable( false );
|
|
|
|
m_borderStyleLabel->Enable( false );
|
|
|
|
m_borderStyleCombo->Enable( false );
|
|
|
|
}
|
|
|
|
|
|
|
|
m_borderColorSwatch->SetSwatchColor( m_shape->GetStroke().GetColor(), false );
|
2021-07-17 19:56:18 +00:00
|
|
|
|
2023-11-25 13:05:45 +00:00
|
|
|
int style = static_cast<int>( m_shape->GetStroke().GetLineStyle() );
|
2021-07-17 19:56:18 +00:00
|
|
|
|
|
|
|
if( style == -1 )
|
2022-04-05 22:32:48 +00:00
|
|
|
m_borderStyleCombo->SetStringSelection( DEFAULT_STYLE );
|
2021-07-17 19:56:18 +00:00
|
|
|
else if( style < (int) lineTypeNames.size() )
|
2022-04-05 22:32:48 +00:00
|
|
|
m_borderStyleCombo->SetSelection( style );
|
2021-07-17 19:56:18 +00:00
|
|
|
else
|
|
|
|
wxFAIL_MSG( "Line type not found in the type lookup map" );
|
|
|
|
|
2024-04-15 20:18:54 +00:00
|
|
|
if( SYMBOL_EDIT_FRAME* symbolEditor = dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame ) )
|
|
|
|
{
|
|
|
|
m_rbFillNone->Enable( true );
|
|
|
|
m_rbFillOutline->Enable( true );
|
|
|
|
m_rbFillBackground->Enable( true );
|
|
|
|
m_rbFillCustom->Enable( true );
|
|
|
|
m_customColorSwatch->Enable( true );
|
|
|
|
|
|
|
|
if( m_shape->GetFillMode() == FILL_T::FILLED_SHAPE )
|
|
|
|
{
|
|
|
|
m_rbFillOutline->SetValue( true );
|
|
|
|
|
|
|
|
COLOR4D color = m_shape->GetStroke().GetColor();
|
|
|
|
|
|
|
|
if( color == COLOR4D::UNSPECIFIED )
|
|
|
|
color = m_frame->GetRenderSettings()->GetLayerColor( LAYER_DEVICE );
|
|
|
|
|
|
|
|
m_customColorSwatch->SetSwatchColor( color, false );
|
|
|
|
}
|
|
|
|
else if( m_shape->GetFillMode() == FILL_T::FILLED_WITH_BG_BODYCOLOR )
|
|
|
|
{
|
|
|
|
m_rbFillBackground->SetValue( true );
|
|
|
|
|
|
|
|
COLOR4D color = m_frame->GetRenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND );
|
|
|
|
m_customColorSwatch->SetSwatchColor( color, false );
|
|
|
|
}
|
|
|
|
else if( m_shape->GetFillMode() == FILL_T::FILLED_WITH_COLOR )
|
|
|
|
{
|
|
|
|
m_rbFillCustom->SetValue( true );
|
|
|
|
m_customColorSwatch->SetSwatchColor( m_shape->GetFillColor(), false );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_rbFillNone->SetValue( true );
|
|
|
|
m_customColorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
|
|
|
|
}
|
|
|
|
|
|
|
|
const SYMBOL* symbol = m_shape->GetParentSymbol();
|
|
|
|
|
|
|
|
m_privateCheckbox->SetValue( m_shape->IsPrivate() );
|
|
|
|
m_checkApplyToAllUnits->SetValue( symbol->GetUnitCount() > 1 && m_shape->GetUnit() == 0 );
|
|
|
|
m_checkApplyToAllUnits->Enable( symbol->GetUnitCount() > 1 );
|
|
|
|
m_checkApplyToAllBodyStyles->SetValue( m_shape->GetBodyStyle() == 0 );
|
|
|
|
|
|
|
|
bool enableAlternateBodyStyle = symbol->HasAlternateBodyStyle();
|
|
|
|
|
|
|
|
// If a symbol contains no body-style-specific pins or graphic items,
|
|
|
|
// symbol->HasAlternateBodyStyle() will return false.
|
|
|
|
// But when creating a new symbol, with DeMorgan option set, the m_checkApplyToAllBodyStyles
|
|
|
|
// must be enabled in order to be able to create graphic items shared by all body styles.
|
|
|
|
if( symbolEditor->GetShowDeMorgan() )
|
|
|
|
enableAlternateBodyStyle = true;
|
|
|
|
|
|
|
|
m_checkApplyToAllBodyStyles->Enable( enableAlternateBodyStyle );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_filledCtrl->SetValue( m_shape->IsFilled() );
|
|
|
|
m_fillColorSwatch->SetSwatchColor( m_shape->GetFillColor(), false );
|
|
|
|
}
|
2021-07-17 19:56:18 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-04-05 22:32:48 +00:00
|
|
|
void DIALOG_SHAPE_PROPERTIES::onBorderChecked( wxCommandEvent& event )
|
|
|
|
{
|
|
|
|
bool border = m_borderCheckbox->GetValue();
|
|
|
|
|
|
|
|
if( border && m_borderWidth.GetValue() < 0 )
|
2024-04-15 20:18:54 +00:00
|
|
|
{
|
|
|
|
int defaultInMils;
|
|
|
|
|
|
|
|
if( SYMBOL_EDIT_FRAME* symbolEditor = dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame ) )
|
|
|
|
defaultInMils = symbolEditor->libeditconfig()->m_Defaults.line_width;
|
|
|
|
else
|
|
|
|
defaultInMils = m_frame->eeconfig()->m_Drawing.default_line_thickness;
|
|
|
|
|
|
|
|
m_borderWidth.SetValue( schIUScale.MilsToIU( defaultInMils ) );
|
|
|
|
}
|
2022-04-05 22:32:48 +00:00
|
|
|
|
|
|
|
m_borderWidth.Enable( border );
|
|
|
|
m_borderColorLabel->Enable( border );
|
|
|
|
m_borderColorSwatch->Enable( border );
|
|
|
|
m_borderStyleLabel->Enable( border );
|
|
|
|
m_borderStyleCombo->Enable( border );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DIALOG_SHAPE_PROPERTIES::onFillChecked( wxCommandEvent& aEvent )
|
|
|
|
{
|
|
|
|
bool fill = m_filledCtrl->GetValue();
|
|
|
|
|
|
|
|
m_fillColorLabel->Enable( fill );
|
|
|
|
m_fillColorSwatch->Enable( fill );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-04-15 20:18:54 +00:00
|
|
|
void DIALOG_SHAPE_PROPERTIES::onFillRadioButton( wxCommandEvent& event )
|
|
|
|
{
|
|
|
|
if( event.GetId() == NO_FILL )
|
|
|
|
{
|
|
|
|
m_rbFillNone->SetValue( true );
|
2024-04-19 13:26:15 +00:00
|
|
|
m_customColorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
|
2024-04-15 20:18:54 +00:00
|
|
|
}
|
|
|
|
else if( event.GetId() == FILLED_SHAPE )
|
|
|
|
{
|
|
|
|
m_rbFillOutline->SetValue( true );
|
|
|
|
|
2024-04-19 13:26:15 +00:00
|
|
|
COLOR4D color = m_borderColorSwatch->GetSwatchColor();
|
2024-04-15 20:18:54 +00:00
|
|
|
|
2024-04-19 13:26:15 +00:00
|
|
|
if( color == COLOR4D::UNSPECIFIED || !m_rbFillOutline->GetValue() )
|
2024-04-15 20:18:54 +00:00
|
|
|
color = m_frame->GetRenderSettings()->GetLayerColor( LAYER_DEVICE );
|
|
|
|
|
2024-04-19 13:26:15 +00:00
|
|
|
m_customColorSwatch->SetSwatchColor( color, false );
|
2024-04-15 20:18:54 +00:00
|
|
|
}
|
|
|
|
else if( event.GetId() == FILLED_WITH_BG_BODYCOLOR )
|
|
|
|
{
|
|
|
|
m_rbFillBackground->SetValue( true );
|
|
|
|
|
|
|
|
COLOR4D color = m_frame->GetRenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND );
|
2024-04-19 13:26:15 +00:00
|
|
|
m_customColorSwatch->SetSwatchColor( color, false );
|
2024-04-15 20:18:54 +00:00
|
|
|
}
|
|
|
|
else if( event.GetId() == FILLED_WITH_COLOR )
|
|
|
|
{
|
|
|
|
m_rbFillCustom->SetValue( true );
|
2024-04-19 13:26:15 +00:00
|
|
|
m_customColorSwatch->GetNewSwatchColor();
|
2024-04-15 20:18:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DIALOG_SHAPE_PROPERTIES::onBorderSwatch( wxCommandEvent& aEvent )
|
|
|
|
{
|
|
|
|
if( m_rbFillOutline->GetValue() )
|
|
|
|
m_fillColorSwatch->SetSwatchColor( m_borderColorSwatch->GetSwatchColor(), false );
|
2024-04-19 13:26:15 +00:00
|
|
|
|
|
|
|
if( m_rbFillOutline->IsEnabled() && m_rbFillOutline->GetValue() )
|
|
|
|
{
|
|
|
|
COLOR4D color = COLOR4D::UNSPECIFIED;
|
|
|
|
|
|
|
|
if( m_rbFillOutline->GetValue() )
|
|
|
|
color = m_fillColorSwatch->GetSwatchColor();
|
|
|
|
|
|
|
|
if( color == COLOR4D::UNSPECIFIED )
|
|
|
|
color = m_frame->GetRenderSettings()->GetLayerColor( LAYER_DEVICE );
|
|
|
|
|
|
|
|
m_customColorSwatch->SetSwatchColor( color, false );
|
|
|
|
}
|
2024-04-15 20:18:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DIALOG_SHAPE_PROPERTIES::onCustomColorSwatch( wxCommandEvent& aEvent )
|
|
|
|
{
|
|
|
|
m_rbFillCustom->SetValue( true );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-07-17 19:56:18 +00:00
|
|
|
bool DIALOG_SHAPE_PROPERTIES::TransferDataFromWindow()
|
|
|
|
{
|
|
|
|
if( !wxDialog::TransferDataFromWindow() )
|
|
|
|
return false;
|
|
|
|
|
2023-06-09 21:41:33 +00:00
|
|
|
SCH_COMMIT commit( m_frame );
|
2023-06-07 22:45:06 +00:00
|
|
|
|
2022-01-11 18:33:30 +00:00
|
|
|
if( !m_shape->IsNew() )
|
2023-06-07 22:45:06 +00:00
|
|
|
commit.Modify( m_shape, m_frame->GetScreen() );
|
2022-01-11 18:33:30 +00:00
|
|
|
|
2021-07-17 19:56:18 +00:00
|
|
|
STROKE_PARAMS stroke = m_shape->GetStroke();
|
|
|
|
|
2022-04-05 22:32:48 +00:00
|
|
|
if( m_borderCheckbox->GetValue() )
|
2024-04-15 20:18:54 +00:00
|
|
|
{
|
|
|
|
if( !m_borderWidth.IsIndeterminate() )
|
|
|
|
stroke.SetWidth( std::max( 0, m_borderWidth.GetIntValue() ) );
|
|
|
|
}
|
2022-04-05 22:32:48 +00:00
|
|
|
else
|
2024-04-15 20:18:54 +00:00
|
|
|
{
|
2022-04-05 22:32:48 +00:00
|
|
|
stroke.SetWidth( -1 );
|
2024-04-15 20:18:54 +00:00
|
|
|
}
|
2021-07-17 19:56:18 +00:00
|
|
|
|
|
|
|
auto it = lineTypeNames.begin();
|
2022-04-05 22:32:48 +00:00
|
|
|
std::advance( it, m_borderStyleCombo->GetSelection() );
|
2021-07-17 19:56:18 +00:00
|
|
|
|
|
|
|
if( it == lineTypeNames.end() )
|
2023-11-25 13:05:45 +00:00
|
|
|
stroke.SetLineStyle( LINE_STYLE::DEFAULT );
|
2021-07-17 19:56:18 +00:00
|
|
|
else
|
2023-11-25 13:05:45 +00:00
|
|
|
stroke.SetLineStyle( it->first );
|
2021-07-17 19:56:18 +00:00
|
|
|
|
2022-04-05 22:32:48 +00:00
|
|
|
stroke.SetColor( m_borderColorSwatch->GetSwatchColor() );
|
2021-07-17 19:56:18 +00:00
|
|
|
|
|
|
|
m_shape->SetStroke( stroke );
|
|
|
|
|
2024-04-15 20:18:54 +00:00
|
|
|
if( SYMBOL_EDIT_FRAME* symbolEditor = dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame ) )
|
2023-06-09 16:24:49 +00:00
|
|
|
{
|
2024-04-15 20:18:54 +00:00
|
|
|
if( m_rbFillOutline->GetValue() )
|
|
|
|
m_shape->SetFillMode( FILL_T::FILLED_SHAPE );
|
|
|
|
else if( m_rbFillBackground->GetValue() )
|
|
|
|
m_shape->SetFillMode( FILL_T::FILLED_WITH_BG_BODYCOLOR );
|
|
|
|
else if( m_rbFillCustom->GetValue() )
|
|
|
|
m_shape->SetFillMode( FILL_T::FILLED_WITH_COLOR );
|
|
|
|
else
|
|
|
|
m_shape->SetFillMode( FILL_T::NO_FILL );
|
|
|
|
|
|
|
|
m_shape->SetFillColor( m_customColorSwatch->GetSwatchColor() );
|
|
|
|
|
|
|
|
m_shape->SetPrivate( m_privateCheckbox->GetValue() );
|
|
|
|
|
|
|
|
if( m_checkApplyToAllBodyStyles->IsChecked() )
|
|
|
|
m_shape->SetBodyStyle( 0 );
|
|
|
|
else
|
|
|
|
m_shape->SetBodyStyle( symbolEditor->GetBodyStyle() );
|
|
|
|
|
|
|
|
if( m_checkApplyToAllUnits->IsChecked() )
|
|
|
|
m_shape->SetUnit( 0 );
|
|
|
|
else
|
|
|
|
m_shape->SetUnit( symbolEditor->GetUnit() );
|
2023-06-09 16:24:49 +00:00
|
|
|
}
|
2024-04-15 20:18:54 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if( m_filledCtrl->GetValue() )
|
|
|
|
m_shape->SetFillMode( FILL_T::FILLED_WITH_COLOR );
|
|
|
|
else
|
|
|
|
m_shape->SetFillMode( FILL_T::NO_FILL );
|
|
|
|
|
|
|
|
m_shape->SetFillColor( m_fillColorSwatch->GetSwatchColor() );
|
|
|
|
}
|
|
|
|
|
|
|
|
if( !commit.Empty() )
|
|
|
|
commit.Push( wxString::Format( _( "Edit %s" ), m_shape->GetFriendlyName() ) );
|
2023-06-07 22:45:06 +00:00
|
|
|
|
2021-07-17 19:56:18 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|