52 m_borderWidth( aFrame, m_borderWidthLabel, m_borderWidthCtrl, m_borderWidthUnits ),
53 m_separatorsWidth( aFrame, m_separatorsWidthLabel, m_separatorsWidthCtrl, m_separatorsWidthUnits )
55 m_grid =
new WX_GRID(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
58 m_grid->EnableEditing(
true );
59 m_grid->EnableGridLines(
true );
60 m_grid->EnableDragGridSize(
false );
61 m_grid->SetMargins( 0, 0 );
62 m_grid->SetCellHighlightROPenWidth( 0 );
64 m_grid->EnableDragColMove(
false );
65 m_grid->EnableDragColSize(
false );
67 m_grid->EnableDragRowMove(
false );
68 m_grid->EnableDragRowSize(
false );
69 m_grid->SetRowLabelSize( 0 );
70 m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
80 wxGridCellAttr* attr =
new wxGridCellAttr;
90 [
this, cell]( wxStyledTextEvent& aEvent,
SCINTILLA_TRICKS* aScintillaTricks )
94 [
this, cell](
const wxString& xRef, wxArrayString* tokens )
96 m_frame->GetContextualTextVars( cell, xRef, tokens );
101 m_grid->SetAttr( row, col, attr );
105 if(
m_table->GetParentFootprint() )
120 for(
const auto& [lineStyle, lineStyleDesc] :
lineTypeNames )
140 m_grid->PopEventHandler(
true );
146 if( !wxDialog::TransferDataToWindow() )
153 wxColour coveredColor = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE );
156 coveredColor = coveredColor.ChangeLightness( 140 );
158 coveredColor = coveredColor.ChangeLightness( 100 );
172 m_grid->SetCellValue( row, col, coveredColor.GetAsString() );
188 m_grid->SetGridCursor( row, col );
189 m_grid->EnableCellEditControl();
190 m_grid->ShowCellEditControl();
219 wxFAIL_MSG(
"Line type not found in the type lookup map" );
241 wxFAIL_MSG(
"Line type not found in the type lookup map" );
283 if( !wxDialog::TransferDataFromWindow() )
309 wxString txt =
m_grid->GetCellValue( row, col );
314 txt.Replace(
"\r",
"\n" );
315#elif defined( __WINDOWS__ )
318 txt.Replace(
"\r",
"" );
381 wxSize availableGridSize =
m_grid->GetClientSize();
383 if( availableGridSize.x == 0 || availableGridSize.y == 0 )
387 double scalerX =
static_cast<double>( availableGridSize.x ) / tableBBox.
GetWidth();
388 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...
#define SKIP_CONNECTIVITY
Container for design settings for a BOARD object.
int GetLineThickness(PCB_LAYER_ID aLayer) const
Return the default graphic segment thickness from the layer class for the given layer.
constexpr size_type GetWidth() const
constexpr size_type GetHeight() const
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
wxCheckBox * m_borderCheckbox
wxCheckBox * m_rowSeparators
PCB_LAYER_BOX_SELECTOR * m_LayerSelectionCtrl
wxBitmapComboBox * m_separatorsStyleCombo
wxCheckBox * m_colSeparators
bool TransferDataFromWindow() override
UNIT_BINDER m_borderWidth
DIALOG_TABLE_PROPERTIES(SCH_EDIT_FRAME *aParentFrame, SCH_TABLE *aTable)
~DIALOG_TABLE_PROPERTIES()
UNIT_BINDER m_separatorsWidth
void onBorderChecked(wxCommandEvent &aEvent) override
bool TransferDataToWindow() override
void onSize(wxSizeEvent &aEvent) override
EDA_ITEM_FLAGS GetEditFlags() const
void SetFlags(EDA_ITEM_FLAGS aMask)
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.
int GetLayerSelection() const
int SetLayerSelection(int layer)
bool SetLayersHotkeys(bool value)
Common, abstract interface for edit frames.
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
void ShowNonActivatedLayers(bool aShow)
virtual bool IsLocked() const
virtual void SetLocked(bool aLocked)
void SetLayer(SCH_LAYER_ID aLayer)
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
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)
LINE_STYLE GetLineStyle() 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.
This file is part of the common library.
#define IN_EDIT
Item currently edited.
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
PCB_LAYER_ID
A quick note on layer IDs:
PCB_LAYER_ID ToLAYER_ID(int aLayer)
const std::map< LINE_STYLE, struct LINE_STYLE_DESC > lineTypeNames