39 wxSizer* mainSizer = GetSizer();
40 wxCHECK_RET( mainSizer, wxT(
"Shape properties dialog has no main sizer" ) );
42 wxGridBagSizer* gbSizerEndings =
new wxGridBagSizer( 3, 0 );
43 gbSizerEndings->SetFlexibleDirection( wxBOTH );
44 gbSizerEndings->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
45 gbSizerEndings->SetEmptyCellSize( wxSize( 20, -1 ) );
49 wxALIGN_CENTER_VERTICAL | wxRIGHT, 5 );
51 m_startShapeChoice =
new wxBitmapComboBox(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0,
52 nullptr, wxCB_READONLY );
54 wxALIGN_CENTER_VERTICAL | wxEXPAND, 5 );
57 gbSizerEndings->Add(
m_endShapeLabel, wxGBPosition( 0, 4 ), wxGBSpan( 1, 1 ),
58 wxALIGN_CENTER_VERTICAL | wxRIGHT, 5 );
60 m_endShapeChoice =
new wxBitmapComboBox(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0,
61 nullptr, wxCB_READONLY );
62 gbSizerEndings->Add(
m_endShapeChoice, wxGBPosition( 0, 5 ), wxGBSpan( 1, 2 ),
63 wxALIGN_CENTER_VERTICAL | wxEXPAND, 5 );
66 [&](
int aRow,
int aCol,
const wxString& aLabel, wxStaticText*& aLabelCtrl, wxTextCtrl*& aValueCtrl,
67 wxStaticText*& aUnitsCtrl,
int aFlags )
69 aLabelCtrl =
new wxStaticText(
this, wxID_ANY, aLabel );
70 gbSizerEndings->Add( aLabelCtrl, wxGBPosition( aRow, aCol ), wxGBSpan( 1, 1 ),
71 wxALIGN_CENTER_VERTICAL | wxLEFT | aFlags, 15 );
73 aValueCtrl =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1, -1 ), 0 );
74 gbSizerEndings->Add( aValueCtrl, wxGBPosition( aRow, aCol + 1 ), wxGBSpan( 1, 1 ),
75 wxALIGN_CENTER_VERTICAL | wxLEFT | wxEXPAND, 15 );
77 aUnitsCtrl =
new wxStaticText(
this, wxID_ANY,
_(
"unit" ) );
78 gbSizerEndings->Add( aUnitsCtrl, wxGBPosition( aRow, aCol + 2 ), wxGBSpan( 1, 1 ),
79 wxALIGN_CENTER_VERTICAL | wxLEFT, 3 );
91 gbSizerEndings->AddGrowableCol( 1 );
92 gbSizerEndings->AddGrowableCol( 5 );
99 wxColour fg = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
100 wxSize iconSize = GetTextExtent( wxT(
"XXXXXX" ) );
114 for(
const auto& item : shapeItems )
157 m_endingsHelpLabel->SetLabel( wxString::Format(
_(
"Set line ending sizes to 0 for automatic (%g\u00d7 line width)." ),
166 for(
const auto& [ lineStyle, lineStyleDesc ] :
lineTypeNames )
176 if(
m_frame->GetColorSettings()->GetOverrideSchItemColors() )
177 m_infoBar->ShowMessage(
_(
"Note: individual item colors overridden in Preferences." ) );
195 if( !symbolEditor->IsSymbolGraphicallyEditable() )
225 if( !wxDialog::TransferDataToWindow() )
233 m_cbDNP->SetValue( ruleArea->GetDNP() );
254 int style =
static_cast<int>(
m_shape->GetStroke().GetLineStyle() );
261 wxFAIL_MSG( wxT(
"Line type not found in the type lookup map" ) );
343 defaultInMils = symbolEditor->libeditconfig()->m_Defaults.line_width;
345 defaultInMils =
m_frame->eeconfig()->m_Drawing.default_line_thickness;
426 if( !wxDialog::TransferDataFromWindow() )
439 ruleArea->SetDNP(
m_cbDNP->GetValue() );
484 m_shape->SetBodyStyle( symbolEditor->GetBodyStyle() );
489 m_shape->SetUnit( symbolEditor->GetUnit() );
529 if( !commit.
Empty() )
530 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