43 m_borderWidth( aFrame, m_borderWidthLabel, m_borderWidthCtrl, m_borderWidthUnits ),
44 m_separatorsWidth( aFrame, m_separatorsWidthLabel, m_separatorsWidthCtrl, m_separatorsWidthUnits )
46 m_grid =
new WX_GRID(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
49 m_grid->EnableEditing(
true );
50 m_grid->EnableGridLines(
true );
51 m_grid->EnableDragGridSize(
false );
52 m_grid->SetMargins( 0, 0 );
53 m_grid->SetCellHighlightROPenWidth( 0 );
55 m_grid->EnableDragColMove(
false );
56 m_grid->EnableDragColSize(
false );
58 m_grid->EnableDragRowMove(
false );
59 m_grid->EnableDragRowSize(
false );
60 m_grid->SetRowLabelSize( 0 );
61 m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
66 wxColor coveredColor = wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT );
73 wxGridCellAttr* attr =
new wxGridCellAttr;
88 [
this](
const wxString& xRef, wxArrayString* tokens )
95 m_grid->SetAttr( row, col, attr );
126 m_grid->PopEventHandler(
true );
132 if( !wxDialog::TransferDataToWindow() )
139 wxColour coveredColor = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE );
142 coveredColor = coveredColor.ChangeLightness( 140 );
144 coveredColor = coveredColor.ChangeLightness( 100 );
153 m_grid->SetCellValue( row, col, coveredColor.GetAsString() );
169 m_grid->SetGridCursor( row, col );
170 m_grid->EnableCellEditControl();
171 m_grid->ShowCellEditControl();
199 wxFAIL_MSG(
"Line type not found in the type lookup map" );
225 wxFAIL_MSG(
"Line type not found in the type lookup map" );
238 wxArrayString* aTokens )
240 if( !aCrossRef.IsEmpty() )
247 for(
int jj = 0; jj < (int) refs.
GetCount(); jj++ )
272 aTokens->push_back( entry.first );
310 if( !wxDialog::TransferDataFromWindow() )
324 wxString txt =
m_grid->GetCellValue( row, col );
329 txt.Replace(
"\r",
"\n" );
330#elif defined( __WINDOWS__ )
333 txt.Replace(
"\r",
"" );
386 if( !commit.
Empty() )
387 commit.
Push(
_(
"Edit Table" ) );
397 wxSize availableGridSize =
m_grid->GetClientSize();
399 if( availableGridSize.x == 0 || availableGridSize.y == 0 )
403 double scalerX =
static_cast<double>( availableGridSize.x ) / tableBBox.
GetWidth();
404 double scalerY =
static_cast<double>( availableGridSize.y ) / tableBBox.
GetHeight();
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
constexpr size_type GetWidth() const
constexpr size_type GetHeight() const
bool GetOverrideSchItemColors() const
COLOR4D GetColor(int aLayer) const
void SetSwatchColor(const KIGFX::COLOR4D &aColor, bool aSendEvent)
Set the current swatch color directly.
KIGFX::COLOR4D GetSwatchColor() const
void SetSwatchBackground(const KIGFX::COLOR4D &aBackground)
Set the swatch background color.
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_TABLE_PROPERTIES_BASE.
wxCheckBox * m_headerBorder
wxStaticText * m_separatorsStyleLabel
wxStaticText * m_borderStyleLabel
wxBitmapComboBox * m_borderStyleCombo
wxStaticText * m_separatorsColorLabel
wxCheckBox * m_borderCheckbox
COLOR_SWATCH * m_borderColorSwatch
wxCheckBox * m_rowSeparators
wxBitmapComboBox * m_separatorsStyleCombo
wxCheckBox * m_colSeparators
wxStaticText * m_borderColorLabel
COLOR_SWATCH * m_separatorsColorSwatch
bool TransferDataFromWindow() override
UNIT_BINDER m_borderWidth
DIALOG_TABLE_PROPERTIES(SCH_EDIT_FRAME *aParentFrame, SCH_TABLE *aTable)
~DIALOG_TABLE_PROPERTIES()
void getContextualTextVars(const wxString &aCrossRef, wxArrayString *aTokens)
UNIT_BINDER m_separatorsWidth
void onBorderChecked(wxCommandEvent &aEvent) override
bool TransferDataToWindow() override
void onSize(wxSizeEvent &aEvent) override
EDA_ITEM_FLAGS GetEditFlags() const
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual void SetText(const wxString &aText)
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
A color representation with 4 components: red, green, blue, alpha.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
virtual std::map< wxString, wxString > & GetTextVars() const
Holds all the data relating to one schematic.
SCH_SHEET_PATH & CurrentSheet() const override
SCH_SHEET_LIST Hierarchy() const override
Return the full schematic flattened hierarchical sheet list.
EESCHEMA_SETTINGS * eeconfig() 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
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.
SCHEMATIC & Schematic() const
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
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
const STROKE_PARAMS & GetSeparatorsStroke() const
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
bool StrokeExternal() const
int GetRowHeight(int aRow) const
void SetStrokeHeader(bool aDoStroke)
int GetColWidth(int aCol) const
const STROKE_PARAMS & GetBorderStroke() const
void SetStrokeExternal(bool aDoStroke)
void SetStrokeColumns(bool aDoStroke)
SCH_TABLECELL * GetCell(int aRow, int aCol) const
bool StrokeColumns() const
void SetSeparatorsStroke(const STROKE_PARAMS &aParams)
void SetStrokeRows(bool aDoStroke)
void SetBorderStroke(const STROKE_PARAMS &aParams)
bool StrokeHeader() const
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)
Simple container to manage line stroke parameters.
void SetLineStyle(LINE_STYLE aLineStyle)
void SetWidth(int aWidth)
void SetColor(const KIGFX::COLOR4D &aColor)
LINE_STYLE GetLineStyle() const
KIGFX::COLOR4D GetColor() const
virtual long long int GetValue()
Return the current value in Internal Units.
void Enable(bool aEnable)
Enable/disable the label, widget and units label.
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
void SetColLabelSize(int aHeight)
Hide wxGrid's SetColLabelSize() method with one which makes sure the size is tall enough for the syst...
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
void ShowMessage(const wxString &aMessage, int aFlags=wxICON_INFORMATION) override
Show the info bar with the provided message and icon.
@ LAYER_SCHEMATIC_BACKGROUND
const std::map< LINE_STYLE, struct LINE_STYLE_DESC > lineTypeNames
int default_line_thickness