46 wxSizer* mainSizer = GetSizer();
47 wxCHECK_RET( mainSizer, wxT(
"Shape properties dialog has no main sizer" ) );
51 wxGridBagSizer* gbSizerEndings =
new wxGridBagSizer( 3, 0 );
52 gbSizerEndings->SetFlexibleDirection( wxBOTH );
53 gbSizerEndings->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
57 gbSizerEndings->Add(
m_startShapeLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL | wxRIGHT,
60 m_startShapeChoice =
new wxBitmapComboBox(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0,
61 nullptr, wxCB_READONLY );
62 gbSizerEndings->Add(
m_startShapeChoice, wxGBPosition( 0, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL | wxEXPAND,
67 gbSizerEndings->Add(
m_endShapeLabel, wxGBPosition( 0, 4 ), wxGBSpan( 1, 1 ),
68 wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5 );
70 m_endShapeChoice =
new wxBitmapComboBox(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0,
71 nullptr, wxCB_READONLY );
72 gbSizerEndings->Add(
m_endShapeChoice, wxGBPosition( 0, 5 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL | wxEXPAND,
75 auto addEndingValue = [&](
int aRow,
int aCol,
const wxString& aLabel, wxStaticText*& aLabelCtrl,
76 wxTextCtrl*& aValueCtrl, wxStaticText*& aUnitsCtrl,
int aFlags )
78 aLabelCtrl =
new wxStaticText(
this, wxID_ANY, aLabel );
79 aLabelCtrl->Wrap( -1 );
80 gbSizerEndings->Add( aLabelCtrl, wxGBPosition( aRow, aCol ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL | aFlags,
83 aValueCtrl =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1, -1 ), 0 );
84 gbSizerEndings->Add( aValueCtrl, wxGBPosition( aRow, aCol + 1 ), wxGBSpan( 1, 1 ),
85 wxALIGN_CENTER_VERTICAL | wxEXPAND, 5 );
87 aUnitsCtrl =
new wxStaticText(
this, wxID_ANY,
_(
"unit" ) );
88 aUnitsCtrl->Wrap( -1 );
89 aUnitsCtrl->SetMinSize( wxSize( 60, -1 ) );
90 gbSizerEndings->Add( aUnitsCtrl, wxGBPosition( aRow, aCol + 2 ), wxGBSpan( 1, 1 ),
91 wxALIGN_CENTER_VERTICAL | wxLEFT, 3 );
103 gbSizerEndings->AddGrowableCol( 1 );
104 gbSizerEndings->AddGrowableCol( 5 );
114 wxColour fg = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
115 wxColour bg = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
116 wxSize iconSize( 80, 24 );
130 for(
const auto& item : shapeItems )
173 m_endingsHelpLabel->SetLabel( wxString::Format(
_(
"Shape sizes of 0 = auto (%g\u00d7 line width)." ),
182 for(
const auto& [ lineStyle, lineStyleDesc ] :
lineTypeNames )
192 if(
m_frame->GetColorSettings()->GetOverrideSchItemColors() )
193 m_infoBar->ShowMessage(
_(
"Note: individual item colors overridden in Preferences." ) );
211 if( !symbolEditor->IsSymbolGraphicallyEditable() )
241 if( !wxDialog::TransferDataToWindow() )
249 m_cbDNP->SetValue( ruleArea->GetDNP() );
270 int style =
static_cast<int>(
m_shape->GetStroke().GetLineStyle() );
277 wxFAIL_MSG( wxT(
"Line type not found in the type lookup map" ) );
359 defaultInMils = symbolEditor->libeditconfig()->m_Defaults.line_width;
361 defaultInMils =
m_frame->eeconfig()->m_Drawing.default_line_thickness;
442 if( !wxDialog::TransferDataFromWindow() )
455 ruleArea->SetDNP(
m_cbDNP->GetValue() );
500 m_shape->SetBodyStyle( symbolEditor->GetBodyStyle() );
505 m_shape->SetUnit( symbolEditor->GetUnit() );
545 if( !commit.
Empty() )
546 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
wxBitmapComboBox * m_startShapeChoice
std::unique_ptr< UNIT_BINDER > m_startWidth
wxStaticText * m_endShapeLabel
void createLineEndingControls(SCH_BASE_FRAME *aParent)
wxBoxSizer * m_endingsSizer
wxBitmapComboBox * m_endShapeChoice
void onCustomColorSwatch(wxCommandEvent &aEvent)
UNIT_BINDER m_borderWidth
wxStaticText * m_endWidthUnits
DIALOG_SHAPE_PROPERTIES(SCH_BASE_FRAME *aParent, SCH_SHAPE *aShape)
std::unique_ptr< UNIT_BINDER > m_startStrokeWidth
std::unique_ptr< UNIT_BINDER > m_startLength
wxTextCtrl * m_startWidthCtrl
std::unique_ptr< UNIT_BINDER > m_endLength
bool TransferDataToWindow() override
wxTextCtrl * m_endLengthCtrl
wxStaticText * m_startWidthUnits
~DIALOG_SHAPE_PROPERTIES() override
void onBorderChecked(wxCommandEvent &aEvent) override
void onBorderSwatch(wxCommandEvent &aEvent)
wxStaticText * m_endStrokeWidthUnits
wxStaticText * m_endWidthLabel
wxTextCtrl * m_startStrokeWidthCtrl
wxStaticText * m_startStrokeWidthLabel
wxStaticText * m_endStrokeWidthLabel
wxStaticText * m_startLengthUnits
std::unique_ptr< UNIT_BINDER > m_endStrokeWidth
wxStaticText * m_startStrokeWidthUnits
wxTextCtrl * m_endStrokeWidthCtrl
wxStaticText * m_endLengthUnits
void onFillChoice(wxCommandEvent &event) override
wxTextCtrl * m_endWidthCtrl
void onFillRadioButton(wxCommandEvent &aEvent) override
wxStaticText * m_startLengthLabel
wxStaticText * m_endLengthLabel
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,...
virtual void Push(const wxString &aMessage=wxT("A commit"), 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.
static bool isOpenShape(SHAPE_T aShape)
@ 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, const wxColour &aBackground, wxWindow *aWindow, bool aShapeOnRight)
Generate a DPI-aware bitmap icon showing a line ending style.
KICOMMON_API wxFont GetInfoFont(wxWindow *aWindow)
static bool isOpenShape(SHAPE_T aShape)
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
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