43 std::vector<PCB_TABLECELL*> aCells ) :
48 m_textHeight( aFrame, m_SizeYLabel, m_SizeYCtrl, m_SizeYUnits ),
49 m_textWidth( aFrame, m_SizeXLabel, m_SizeXCtrl, m_SizeXUnits ),
50 m_textThickness( aFrame, m_ThicknessLabel, m_ThicknessCtrl, m_ThicknessUnits ),
51 m_marginLeft( aFrame, nullptr, m_marginLeftCtrl, nullptr ),
52 m_marginTop( aFrame, nullptr, m_marginTopCtrl, m_marginTopUnits ),
53 m_marginRight( aFrame, nullptr, m_marginRightCtrl, nullptr ),
54 m_marginBottom( aFrame, nullptr, m_marginBottomCtrl, nullptr ),
55 m_cellText( m_cellTextCtrl ),
56 m_returnValue( TABLECELL_PROPS_CANCEL )
66 m_cellText->SetTechnology(wxSTC_TECHNOLOGY_DIRECTWRITE);
71 [
this]( wxKeyEvent& aEvent )
73 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
76 [
this]( wxStyledTextEvent& aEvent )
80 [
this](
const wxString& xRef, wxArrayString* tokens )
113 m_bold->SetIsCheckButton();
149 if( !wxDialog::TransferDataToWindow() )
152 bool firstCell =
true;
155 int textThickness = 0;
156 int effectivePenWidth = 0;
167 textThickness = cell->GetTextThickness();
168 effectivePenWidth = cell->GetEffectiveTextPenWidth();
170 hAlign = cell->GetHorizJustify();
171 vAlign = cell->GetVertJustify();
179 m_bold->Check( cell->IsBold() );
182 m_italic->Check( cell->IsItalic() );
200 if( cell->GetTextThickness() != textThickness )
203 if( cell->GetEffectiveTextPenWidth() != effectivePenWidth )
204 effectivePenWidth = -1;
206 if( cell->GetHorizJustify() != hAlign )
209 if( cell->GetVertJustify() != vAlign )
245 if( textThickness == 0 )
247 if( effectivePenWidth > 0 )
253 else if( textThickness > 0 )
265 if( aEvent.IsChecked() )
293 if( aEvent.IsChecked() )
299 wxCommandEvent
dummy;
316 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
326 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
334 if( !wxDialog::TransferDataFromWindow() )
358 txt.Replace(
"\r",
"\n" );
359#elif defined( __WINDOWS__ )
362 txt.Replace(
"\r",
"" );
365 cell->SetText( txt );
368 cell->SetBold(
m_bold->IsChecked() );
369 cell->SetItalic(
m_italic->IsChecked() );
381 cell->SetAutoThickness(
true );
412 if( !commit.Empty() )
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
#define SKIP_CONNECTIVITY
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 void OnCharHook(wxKeyEvent &aEvt)
Class DIALOG_TABLECELL_PROPERTIES_BASE.
BITMAP_BUTTON * m_vAlignTop
BITMAP_BUTTON * m_vAlignCenter
BITMAP_BUTTON * m_hAlignRight
BITMAP_BUTTON * m_hAlignCenter
BITMAP_BUTTON * m_vAlignBottom
wxStyledTextCtrl * m_cellTextCtrl
BITMAP_BUTTON * m_autoTextThickness
BITMAP_BUTTON * m_separator0
BITMAP_BUTTON * m_hAlignLeft
BITMAP_BUTTON * m_separator1
UNIT_BINDER m_textThickness
bool TransferDataFromWindow() override
void onBoldToggle(wxCommandEvent &aEvent) override
std::vector< SCH_TABLECELL * > m_cells
@ TABLECELL_PROPS_EDIT_TABLE
void onTextSize(wxCommandEvent &aEvent) override
void onHAlignButton(wxCommandEvent &aEvent)
void onAutoTextThickness(wxCommandEvent &aEvent) override
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)
UNIT_BINDER m_marginBottom
bool TransferDataToWindow() override
~DIALOG_TABLECELL_PROPERTIES()
UNIT_BINDER m_marginRight
void onVAlignButton(wxCommandEvent &aEvent)
EDA_ITEM_FLAGS GetEditFlags() const
void SetFlags(EDA_ITEM_FLAGS aMask)
void SetFontSelection(KIFONT::FONT *aFont, bool aSilentMode=false)
Set the selection in wxChoice widget.
KIFONT::FONT * GetFontSelection(bool aBold, bool aItalic, bool aForDrawingSheet=false) const
bool HaveFontSelection() const
Common, abstract interface for edit frames.
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
void DoTextVarAutocomplete(const std::function< void(const wxString &xRef, wxArrayString *tokens)> &getTokensFn)
virtual long long int GetValue()
Return the current value in Internal Units.
void Enable(bool aEnable)
Enable/disable the label, widget and units label.
bool IsIndeterminate() const
Return true if the control holds the indeterminate value (for instance, if it represents a multiple s...
virtual void ChangeValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion WITHOUT trigger...
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
This file is part of the common library.
#define IN_EDIT
Item currently edited.
int GetPenSizeForBold(int aTextSize)
int GetPenSizeForNormal(int aTextSize)
std::vector< FAB_LAYER_COLOR > dummy
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...