38 wxSizer* mainSizer = GetSizer();
39 wxCHECK_RET( mainSizer, wxT(
"Shape properties dialog has no main sizer" ) );
41 wxGridBagSizer* gbSizerEndings =
new wxGridBagSizer( 3, 0 );
42 gbSizerEndings->SetFlexibleDirection( wxBOTH );
43 gbSizerEndings->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
44 gbSizerEndings->SetEmptyCellSize( wxSize( 20, -1 ) );
48 wxALIGN_CENTER_VERTICAL | wxRIGHT, 5 );
50 m_startShapeChoice =
new wxBitmapComboBox(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0,
51 nullptr, wxCB_READONLY );
53 wxALIGN_CENTER_VERTICAL | wxEXPAND, 5 );
56 gbSizerEndings->Add(
m_endShapeLabel, wxGBPosition( 0, 4 ), wxGBSpan( 1, 1 ),
57 wxALIGN_CENTER_VERTICAL | wxRIGHT, 5 );
59 m_endShapeChoice =
new wxBitmapComboBox(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0,
60 nullptr, wxCB_READONLY );
61 gbSizerEndings->Add(
m_endShapeChoice, wxGBPosition( 0, 5 ), wxGBSpan( 1, 2 ),
62 wxALIGN_CENTER_VERTICAL | wxEXPAND, 5 );
65 [&](
int aRow,
int aCol,
const wxString& aLabel, wxStaticText*& aLabelCtrl, wxTextCtrl*& aValueCtrl,
66 wxStaticText*& aUnitsCtrl,
int aFlags )
68 aLabelCtrl =
new wxStaticText(
this, wxID_ANY, aLabel );
69 gbSizerEndings->Add( aLabelCtrl, wxGBPosition( aRow, aCol ), wxGBSpan( 1, 1 ),
70 wxALIGN_CENTER_VERTICAL | wxLEFT | aFlags, 15 );
72 aValueCtrl =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1, -1 ), 0 );
73 gbSizerEndings->Add( aValueCtrl, wxGBPosition( aRow, aCol + 1 ), wxGBSpan( 1, 1 ),
74 wxALIGN_CENTER_VERTICAL | wxLEFT | wxEXPAND, 15 );
76 aUnitsCtrl =
new wxStaticText(
this, wxID_ANY,
_(
"unit" ) );
77 gbSizerEndings->Add( aUnitsCtrl, wxGBPosition( aRow, aCol + 2 ), wxGBSpan( 1, 1 ),
78 wxALIGN_CENTER_VERTICAL | wxLEFT, 3 );
90 gbSizerEndings->AddGrowableCol( 1 );
91 gbSizerEndings->AddGrowableCol( 5 );
98 wxColour fg = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
99 wxSize iconSize = GetTextExtent( wxT(
"XXXXXX" ) );
113 for(
const auto& item : shapeItems )
156 m_endingsHelpLabel->SetLabel( wxString::Format(
_(
"Set line ending sizes to 0 for automatic (%g\u00d7 line width)." ),
165 for(
const auto& [ lineStyle, lineStyleDesc ] :
lineTypeNames )
175 if(
m_frame->GetColorSettings()->GetOverrideSchItemColors() )
176 m_infoBar->ShowMessage(
_(
"Note: individual item colors overridden in Preferences." ) );
194 if( !symbolEditor->IsSymbolGraphicallyEditable() )
224 if( !wxDialog::TransferDataToWindow() )
232 m_cbDNP->SetValue( ruleArea->GetDNP() );
253 int style =
static_cast<int>(
m_shape->GetStroke().GetLineStyle() );
260 wxFAIL_MSG( wxT(
"Line type not found in the type lookup map" ) );
342 defaultInMils = symbolEditor->libeditconfig()->m_Defaults.line_width;
344 defaultInMils =
m_frame->eeconfig()->m_Drawing.default_line_thickness;
425 if( !wxDialog::TransferDataFromWindow() )
438 ruleArea->SetDNP(
m_cbDNP->GetValue() );
483 m_shape->SetBodyStyle( symbolEditor->GetBodyStyle() );
488 m_shape->SetUnit( symbolEditor->GetUnit() );
528 if( !commit.
Empty() )
529 commit.
Push( wxString::Format(
_(
"Edit %s" ),
m_shape->GetFriendlyName() ) );
constexpr EDA_IU_SCALE schIUScale
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Color settings are a bit different than most of the settings objects in that there can be more than o...
COLOR4D GetColor(int aLayer) const
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
wxStaticText * m_borderStyleLabel
wxButton * m_sdbSizerCancel
wxCheckBox * m_borderCheckbox
wxCheckBox * m_checkApplyToAllUnits
wxRadioButton * m_rbFillOutline
wxSimplebook * m_fillBook
wxTextCtrl * m_borderWidthCtrl
COLOR_SWATCH * m_fillColorSwatch
wxBitmapComboBox * m_borderStyleCombo
wxStaticText * m_borderWidthUnits
@ FILLED_WITH_BG_BODYCOLOR
wxStaticText * m_fillColorLabel
wxRadioButton * m_rbFillBackground
COLOR_SWATCH * m_borderColorSwatch
wxBoxSizer * m_symbolEditorSizer
wxCheckBox * m_cbExcludeFromBoard
wxStaticText * m_helpLabel1
wxCheckBox * m_cbExcludeFromSim
wxStaticText * m_borderWidthLabel
wxStaticText * m_helpLabel2
wxCheckBox * m_privateCheckbox
wxStaticText * m_borderColorLabel
wxBoxSizer * m_ruleAreaSizer
COLOR_SWATCH * m_customColorSwatch
wxCheckBox * m_cbExcludeFromBom
wxRadioButton * m_rbFillNone
wxRadioButton * m_rbFillCustom
wxCheckBox * m_checkApplyToAllBodyStyles
DIALOG_SHAPE_PROPERTIES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("%s Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
std::unique_ptr< UNIT_BINDER > m_endWidth
wxTextCtrl * m_endThicknessCtrl
wxBitmapComboBox * m_startShapeChoice
std::unique_ptr< UNIT_BINDER > m_startWidth
wxStaticText * m_endThicknessLabel
wxStaticText * m_endShapeLabel
void createLineEndingControls(SCH_BASE_FRAME *aParent)
wxStaticText * m_startThicknessUnits
wxBitmapComboBox * m_endShapeChoice
void onCustomColorSwatch(wxCommandEvent &aEvent)
UNIT_BINDER m_borderWidth
wxStaticText * m_startThicknessLabel
wxStaticText * m_endWidthUnits
DIALOG_SHAPE_PROPERTIES(SCH_BASE_FRAME *aParent, SCH_SHAPE *aShape)
std::unique_ptr< UNIT_BINDER > m_startLength
wxTextCtrl * m_startWidthCtrl
std::unique_ptr< UNIT_BINDER > m_endLength
wxBoxSizer * m_endingsSizer
std::unique_ptr< UNIT_BINDER > m_startThickness
bool TransferDataToWindow() override
wxTextCtrl * m_endLengthCtrl
std::unique_ptr< UNIT_BINDER > m_endThickness
wxStaticText * m_startWidthUnits
~DIALOG_SHAPE_PROPERTIES() override
void onBorderChecked(wxCommandEvent &aEvent) override
void onBorderSwatch(wxCommandEvent &aEvent)
wxStaticText * m_endWidthLabel
wxStaticText * m_startLengthUnits
wxStaticText * m_endLengthUnits
void onFillChoice(wxCommandEvent &event) override
wxTextCtrl * m_endWidthCtrl
void onFillRadioButton(wxCommandEvent &aEvent) override
wxTextCtrl * m_startThicknessCtrl
wxStaticText * m_startLengthLabel
wxStaticText * m_endLengthLabel
wxStaticText * m_endThicknessUnits
bool TransferDataFromWindow() override
wxStaticText * m_startShapeLabel
wxTextCtrl * m_startLengthCtrl
wxStaticText * m_startWidthLabel
wxStaticText * m_endingsHelpLabel
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
virtual wxString GetFriendlyName() const
A color representation with 4 components: red, green, blue, alpha.
wxColour ToColour() const
static constexpr double DEFAULT_RATIO_LENGTH
static const int s_defaultChoiceCount
static const LINE_ENDING_STYLE s_defaultChoiceOrder[]
Dropdown display order for line ending style choosers.
static int StyleToChoiceIndex(LINE_ENDING_STYLE aStyle)
Return the dropdown index for the given style, or 0 (NONE) if not found.
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
Commit for the schematic and symbol editors.
void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
Simple container to manage line stroke parameters.
void SetLineStyle(LINE_STYLE aLineStyle)
void SetWidth(int aWidth)
void SetColor(const KIGFX::COLOR4D &aColor)
The symbol library editor main window.
A base class for LIB_SYMBOL and SCH_SYMBOL.
virtual bool IsMultiUnit() const =0
virtual bool IsMultiBodyStyle() const =0
@ FILLED_WITH_BG_BODYCOLOR
@ FILLED_SHAPE
Fill with object color.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
@ LAYER_DEVICE_BACKGROUND
@ LAYER_SCHEMATIC_BACKGROUND
LINE_ENDING_STYLE
Line ending styles for graphic lines, arcs, and beziers.
wxBitmap MakeLineEndingBitmap(LINE_ENDING_STYLE aStyle, const wxSize &aSize, const wxColour &aForeground, wxWindow *aWindow, bool aShapeOnRight)
Generate a DPI-aware bitmap icon showing a line ending style.
KICOMMON_API wxFont GetInfoFont(wxWindow *aWindow)
const std::map< LINE_STYLE, struct LINE_STYLE_DESC > lineTypeNames
Conversion map between LINE_STYLE values and style names displayed.
#define DEFAULT_LINE_STYLE_LABEL