60 m_cellText->SetTechnology( wxSTC_TECHNOLOGY_DIRECTWRITE );
66 [
this]( wxKeyEvent& aEvent )
68 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
72 [
this]( wxStyledTextEvent& aEvent )
76 [
this](
const wxString& xRef, wxArrayString* tokens )
86 if(
m_frame->GetColorSettings()->GetOverrideSchItemColors() )
87 m_infoBar->ShowMessage(
_(
"Note: individual item colors overridden in Preferences." ) );
133 if( !aCrossRef.IsEmpty() )
142 for(
int jj = 0; jj < (int) refs.
GetCount(); jj++ )
165 for( std::pair<wxString, wxString> entry :
Prj().GetTextVars() )
166 aTokens->push_back( entry.first );
174 if( !wxDialog::TransferDataToWindow() )
177 bool firstCell =
true;
183 wxString
text = cell->GetText();
190 m_fontCtrl->SetFontSelection( cell->GetFont() );
193 m_bold->Set3StateValue( cell->IsBold() ? wxCHK_CHECKED : wxCHK_UNCHECKED );
194 m_italic->Set3StateValue( cell->IsItalic() ? wxCHK_CHECKED : wxCHK_UNCHECKED );
196 hAlign = cell->GetHorizJustify();
197 vAlign = cell->GetVertJustify();
205 if( cell->IsSolidFill() )
221 if( cell->GetFont() !=
m_fontCtrl->GetFontSelection( cell->IsBold(), cell->IsItalic() ) )
224 if( cell->GetTextWidth() !=
m_textSize.GetValue() )
227 wxCheckBoxState bold = cell->IsBold() ? wxCHK_CHECKED : wxCHK_UNCHECKED;
229 if( bold !=
m_bold->Get3StateValue() )
230 m_bold->Set3StateValue( wxCHK_UNDETERMINED );
232 wxCheckBoxState italic = cell->IsItalic() ? wxCHK_CHECKED : wxCHK_UNCHECKED;
234 if( italic !=
m_italic->Get3StateValue() )
235 m_italic->Set3StateValue( wxCHK_UNDETERMINED );
237 if( cell->GetHorizJustify() != hAlign )
240 if( cell->GetVertJustify() != vAlign )
260 if( cell->GetMarginLeft() !=
m_marginLeft.GetIntValue() )
263 if( cell->GetMarginTop() !=
m_marginTop.GetIntValue() )
298 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
308 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
316 if( aEvent.GetSelection() == 1 )
326 if( aEvent.GetSelection() == 1 )
336 if( !wxDialog::TransferDataFromWindow() )
342 if(
m_table->GetEditFlags() == 0 )
351 text.Replace(
"\r",
"\n" );
352#elif defined( __WINDOWS__ )
355 text.Replace(
"\r",
"" );
358 cell->SetText(
text );
360 if(
m_bold->Get3StateValue() == wxCHK_CHECKED )
361 cell->SetBold(
true );
362 else if(
m_bold->Get3StateValue() == wxCHK_UNCHECKED )
363 cell->SetBold(
false );
365 if(
m_italic->Get3StateValue() == wxCHK_CHECKED )
366 cell->SetItalic(
true );
367 else if(
m_italic->Get3StateValue() == wxCHK_UNCHECKED )
368 cell->SetItalic(
false );
371 cell->SetFont(
m_fontCtrl->GetFontSelection( cell->IsBold(), cell->IsItalic() ) );
404 cell->SetFillColor( fillColor );
421 if( !commit.
Empty() )
422 commit.
Push(
_(
"Edit Table Cell Properties" ) );
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.
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.
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...
DIALOG_TABLECELL_PROPERTIES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Table Cell Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1, -1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
BITMAP_BUTTON * m_vAlignTop
wxChoice * m_fillColorPopup
COLOR_SWATCH * m_fillColorSwatch
BITMAP_BUTTON * m_vAlignCenter
BITMAP_BUTTON * m_hAlignRight
BITMAP_BUTTON * m_hAlignCenter
BITMAP_BUTTON * m_vAlignBottom
wxStyledTextCtrl * m_cellTextCtrl
wxTextCtrl * m_textSizeCtrl
COLOR_SWATCH * m_textColorSwatch
wxSimplebook * m_textColorBook
wxTextCtrl * m_marginTopCtrl
wxChoice * m_textColorPopup
wxTextCtrl * m_marginBottomCtrl
wxStaticText * m_textSizeUnits
BITMAP_BUTTON * m_hAlignLeft
wxTextCtrl * m_marginRightCtrl
wxStaticText * m_marginTopUnits
wxSimplebook * m_fillColorBook
wxTextCtrl * m_marginLeftCtrl
wxStaticText * m_textSizeLabel
bool TransferDataFromWindow() override
std::vector< SCH_TABLECELL * > m_cells
HTML_MESSAGE_BOX * m_helpWindow
@ TABLECELL_PROPS_EDIT_TABLE
void onTextColorPopup(wxCommandEvent &aEvent) override
void onMultiLineTCLostFocus(wxFocusEvent &event) override
void onFillColorPopup(wxCommandEvent &aEvent) override
void onHAlignButton(wxCommandEvent &aEvent)
void onEditTable(wxCommandEvent &aEvent) override
enum TABLECELL_PROPS_RETVALUE m_returnValue
wxStyledTextCtrl * m_cellText
SCINTILLA_TRICKS * m_scintillaTricks
DIALOG_TABLECELL_PROPERTIES(SCH_EDIT_FRAME *aParentFrame, std::vector< SCH_TABLECELL * > aCells)
void OnFormattingHelp(wxHyperlinkEvent &aEvent) override
UNIT_BINDER m_marginBottom
bool TransferDataToWindow() override
~DIALOG_TABLECELL_PROPERTIES()
void getContextualTextVars(const wxString &aCrossRef, wxArrayString *aTokens)
UNIT_BINDER m_marginRight
void onVAlignButton(wxCommandEvent &aEvent)
A color representation with 4 components: red, green, blue, alpha.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
Holds all the data relating to one schematic.
SCH_SHEET_LIST Hierarchy() const
Return the full schematic flattened hierarchical sheet list.
SCH_SHEET_PATH & CurrentSheet() const
COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Returns a pointer to the active color theme settings.
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Execute the changes.
Schematic editor (Eeschema) main window.
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
A helper to define a symbol's reference designator in a schematic.
const SCH_SHEET_PATH & GetSheetPath() const
SCH_SYMBOL * GetSymbol() const
void GetSymbols(SCH_REFERENCE_LIST &aReferences, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanSymbols=false) const
Add a SCH_REFERENCE object to aReferences for each symbol in the list of sheets.
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this symbol.
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
static HTML_MESSAGE_BOX * ShowSyntaxHelp(wxWindow *aParentWindow)
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
@ LAYER_SCHEMATIC_BACKGROUND
GR_TEXT_H_ALIGN_T
This is API surface mapped to common.types.HorizontalAlignment.
@ GR_TEXT_H_ALIGN_INDETERMINATE
GR_TEXT_V_ALIGN_T
This is API surface mapped to common.types.VertialAlignment.
@ GR_TEXT_V_ALIGN_INDETERMINATE
#define INDETERMINATE_STATE
Used for holding indeterminate values, such as with multiple selections holding different values or c...
VECTOR2< int32_t > VECTOR2I