38 std::vector<SCH_TABLECELL*> aCells ) :
43 m_textSize( aFrame, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits ),
44 m_marginLeft( aFrame, nullptr, m_marginLeftCtrl, nullptr ),
45 m_marginTop( aFrame, nullptr, m_marginTopCtrl, m_marginTopUnits ),
46 m_marginRight( aFrame, nullptr, m_marginRightCtrl, nullptr ),
47 m_marginBottom( aFrame, nullptr, m_marginBottomCtrl, nullptr ),
48 m_returnValue( TABLECELL_PROPS_CANCEL )
88 if( !wxDialog::TransferDataToWindow() )
91 bool firstCell =
true;
102 m_bold->Set3StateValue( cell->IsBold() ? wxCHK_CHECKED : wxCHK_UNCHECKED );
103 m_italic->Set3StateValue( cell->IsItalic() ? wxCHK_CHECKED : wxCHK_UNCHECKED );
105 hAlign = cell->GetHorizJustify();
106 vAlign = cell->GetVertJustify();
114 if( cell->IsFilled() )
136 wxCheckBoxState bold = cell->IsBold() ? wxCHK_CHECKED : wxCHK_UNCHECKED;
138 if( bold !=
m_bold->Get3StateValue() )
139 m_bold->Set3StateValue( wxCHK_UNDETERMINED );
141 wxCheckBoxState italic = cell->IsItalic() ? wxCHK_CHECKED : wxCHK_UNCHECKED;
143 if( italic !=
m_italic->Get3StateValue() )
144 m_italic->Set3StateValue( wxCHK_UNDETERMINED );
146 if( cell->GetHorizJustify() != hAlign )
149 if( cell->GetVertJustify() != vAlign )
158 COLOR4D fillColor = cell->IsFilled() ? cell->GetFillColor() : COLOR4D::UNSPECIFIED;
167 fillColor = COLOR4D::UNSPECIFIED;
207 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
217 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
225 if( aEvent.GetSelection() == 1 )
235 if( aEvent.GetSelection() == 1 )
245 if( !wxDialog::TransferDataFromWindow() )
256 if(
m_bold->Get3StateValue() == wxCHK_CHECKED )
257 cell->SetBold(
true );
258 else if(
m_bold->Get3StateValue() == wxCHK_UNCHECKED )
259 cell->SetBold(
false );
261 if(
m_italic->Get3StateValue() == wxCHK_CHECKED )
262 cell->SetItalic(
true );
263 else if(
m_italic->Get3StateValue() == wxCHK_UNCHECKED )
264 cell->SetItalic(
false );
293 if( fillColor == COLOR4D::UNSPECIFIED )
295 cell->SetFillMode( FILL_T::NO_FILL );
299 cell->SetFillMode( FILL_T::FILLED_WITH_COLOR );
300 cell->SetFillColor( fillColor );
317 if( !commit.
Empty() )
318 commit.
Push(
_(
"Edit Table Cell Properties" ) );
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
bool GetOverrideSchItemColors() const
void SetSwatchColor(const KIGFX::COLOR4D &aColor, bool aSendEvent)
Set the current swatch color directly.
void GetNewSwatchColor()
Prompt for a new colour, using the colour picker dialog.
KIGFX::COLOR4D GetSwatchColor() const
void SetDefaultColor(const KIGFX::COLOR4D &aColor)
Sets the color that will be chosen with the "Reset to Default" button in the chooser.
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Create an undo entry for an item that has been already modified.
bool Empty() const
Returns status of an item.
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...
Class DIALOG_TABLECELL_PROPERTIES_BASE.
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
COLOR_SWATCH * m_textColorSwatch
wxSimplebook * m_textColorBook
wxChoice * m_textColorPopup
BITMAP_BUTTON * m_hAlignLeft
wxSimplebook * m_fillColorBook
bool TransferDataFromWindow() override
std::vector< SCH_TABLECELL * > m_cells
@ TABLECELL_PROPS_EDIT_TABLE
void onTextColorPopup(wxCommandEvent &aEvent) override
void onFillColorPopup(wxCommandEvent &aEvent) override
void onHAlignButton(wxCommandEvent &aEvent)
void onEditTable(wxCommandEvent &aEvent) override
enum TABLECELL_PROPS_RETVALUE m_returnValue
DIALOG_TABLECELL_PROPERTIES(SCH_EDIT_FRAME *aParentFrame, std::vector< SCH_TABLECELL * > aCells)
UNIT_BINDER m_marginBottom
bool TransferDataToWindow() override
UNIT_BINDER m_marginRight
void onVAlignButton(wxCommandEvent &aEvent)
EDA_ITEM_FLAGS GetEditFlags() const
bool HaveFontSelection() const
void SetFontSelection(KIFONT::FONT *aFont)
KIFONT::FONT * GetFontSelection(bool aBold, bool aItalic) const
A color representation with 4 components: red, green, blue, alpha.
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
Revert the commit by restoring the modified items state.
Schematic editor (Eeschema) main window.
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual long long int GetValue()
Return the current value in Internal Units.
bool IsIndeterminate() const
Return true if the control holds the indeterminate value (for instance, if it represents a multiple s...
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
void ShowMessage(const wxString &aMessage, int aFlags=wxICON_INFORMATION) override
Show the info bar with the provided message and icon.
@ GR_TEXT_H_ALIGN_INDETERMINATE
@ GR_TEXT_V_ALIGN_INDETERMINATE
#define INDETERMINATE_STATE
Used for holding indeterminate values, such as with multiple selections holding different values or c...