21#include <wx/tokenzr.h>
23#include <wx/settings.h>
25#include <wx/textentry.h>
44 wxGridCellAttr::wxAttrKind aKind )
46 wxGridCellAttr* attr = aInputAttr;
48 if( wxGridCellAttrProvider* provider = GetAttrProvider() )
50 wxGridCellAttr* providerAttr = provider->GetAttr( aRow, aCol, aKind );
54 attr =
new wxGridCellAttr;
55 attr->SetKind( wxGridCellAttr::Merged );
59 attr->MergeWith( aInputAttr );
63 attr->MergeWith( providerAttr );
64 providerAttr->DecRef();
72#define MIN_GRIDCELL_MARGIN FromDIP( 2 )
78 aEntry->SetMargins( 0, 0 );
84#if defined( __WXMSW__ ) || defined( __WXGTK__ )
91 const std::vector<int>& aRowHeights,
int aMaxRows )
96 int rowsHeight = aHeaderHeight;
97 int count = std::min( aMaxRows, (
int) aRowHeights.size() );
99 for(
int row = 0; row < count; ++row )
100 rowsHeight += aRowHeights[row];
102 return std::min( aMinHeight, rowsHeight );
110 std::vector<int> rowHeights;
111 rowHeights.reserve( GetNumberRows() );
113 int allRowsHeight = GetColLabelSize();
115 for(
int row = 0; row < GetNumberRows(); ++row )
117 rowHeights.push_back( GetRowSize( row ) );
118 allRowsHeight += rowHeights.back();
124 rowHeights, aMinRows ) ) );
126 aDialog->SetMinSize( wxDefaultSize );
127 aDialog->InvalidateBestSize();
128 aDialog->SetMinSize( aDialog->GetBestSize() );
131 int grow = allRowsHeight - GetSize().y;
134 aDialog->SetSize( aDialog->GetSize().x, aDialog->GetSize().y + grow );
140 KIGFX::COLOR4D bg = wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK );
141 KIGFX::COLOR4D fg = wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER );
152 wxDCBrushChanger SetBrush( dc, *wxTRANSPARENT_BRUSH );
155 rect.SetTop( rect.GetTop() + 1 );
156 rect.SetLeft( rect.GetLeft() + 1 );
157 rect.SetBottom( rect.GetBottom() - 1 );
158 rect.SetRight( rect.GetRight() - 1 );
159 dc.DrawRectangle( rect );
169 wxDCBrushChanger SetBrush( dc, *wxTRANSPARENT_BRUSH );
172 rect.SetTop( rect.GetTop() + 1 );
173 rect.SetLeft( rect.GetLeft() );
174 rect.SetBottom( rect.GetBottom() - 1 );
175 rect.SetRight( rect.GetRight() - 1 );
176 dc.DrawRectangle( rect );
186 wxDCBrushChanger SetBrush( dc, *wxTRANSPARENT_BRUSH );
189 rect.SetTop( rect.GetTop() + 1 );
190 rect.SetLeft( rect.GetLeft() + 1 );
191 rect.SetBottom( rect.GetBottom() - 1 );
192 rect.SetRight( rect.GetRight() );
193 dc.DrawRectangle( rect );
206 wxGridCellAttrProvider(),
220 wxGridCellAttr*
GetAttr(
int row,
int col, wxGridCellAttr::wxAttrKind kind )
const override
222 wxGridCellAttrPtr cellAttr( wxGridCellAttrProvider::GetAttr( row, col, kind ) );
227 return cellAttr.release();
235 if( !cellAttr->HasBackgroundColour() )
237 cellAttr = cellAttr->Clone();
238 cellAttr->SetBackgroundColour(
m_attrEven->GetBackgroundColour() );
242 return cellAttr.release();
250WX_GRID::WX_GRID( wxWindow *parent, wxWindowID
id,
const wxPoint& pos,
const wxSize& size,
long style,
251 const wxString&
name ) :
252 wxGrid( parent, id, pos, size, style,
name ),
256 SetDefaultRowSize( GetDefaultRowSize() + FromDIP( 4 ) );
258 SetDefaultCellOverflow(
false );
293 std::vector<int> hiddenCols;
295 for(
int col = 0; col < GetNumberCols(); ++col )
297 if( !IsColShown( col ) )
298 hiddenCols.push_back( col );
303 if( !hiddenCols.empty() )
308 for(
int col : hiddenCols )
321 wxGrid::SetColLabelSize( wxGRID_AUTOSIZE );
328 if( aHeight == 0 || aHeight == wxGRID_AUTOSIZE )
330 wxGrid::SetColLabelSize( aHeight );
337 wxGrid::SetColLabelSize( std::max( aHeight, minHeight ) );
351 int numberCols = GetNumberCols();
352 int* formBuilderColWidths =
new int[numberCols];
354 for(
int i = 0; i < numberCols; ++i )
355 formBuilderColWidths[ i ] = GetColSize( i );
357 wxGrid::SetTable( aTable );
361 numberCols = std::min( numberCols, GetNumberCols() );
363 for(
int i = 0; i < numberCols; ++i )
368 SetColSize( i, std::max( formBuilderColWidths[ i ], headingWidth ) );
371 delete[] formBuilderColWidths;
379 Connect( wxEVT_IDLE, wxIdleEventHandler( WX_GRID::onIdleRefreshHighlight ),
nullptr,
this );
388 wxGridTableBase*
table = wxGrid::GetTable();
390 wxCHECK_MSG(
table, ,
"Tried to enable alternate row colors without a table assigned to the grid" );
394 wxColor color = wxGrid::GetDefaultCellBackgroundColour();
399 table->SetAttrProvider(
nullptr );
409 int row = aEvent.GetRow();
410 int col = aEvent.GetCol();
412 if( row >= 0 && row < GetNumberRows() && col >= 0 && col < GetNumberCols() )
414 if( GetSelectionMode() == wxGrid::wxGridSelectCells )
416 SelectBlock( row, col, row, col,
false );
418 else if( GetSelectionMode() == wxGrid::wxGridSelectRows
419 || GetSelectionMode() == wxGrid::wxGridSelectRowsOrColumns )
421 SelectBlock( row, 0, row, GetNumberCols() - 1,
false );
423 else if( GetSelectionMode() == wxGrid::wxGridSelectColumns )
425 SelectBlock( 0, col, GetNumberRows() - 1, col,
false );
432void WX_GRID::onIdleRefreshHighlight( wxIdleEvent& aEvent )
442 if( !IsShownOnScreen() )
445 Disconnect( wxEVT_IDLE, wxIdleEventHandler( WX_GRID::onIdleRefreshHighlight ),
nullptr,
this );
455 int row = aEvent.GetRow();
456 int col = aEvent.GetCol();
458 const std::pair<wxString, wxString>& beforeAfter =
m_evalBeforeAfter[ { row, col } ];
460 if( GetCellValue( row, col ) == beforeAfter.second )
461 SetCellValue( row, col, beforeAfter.first );
468 const int col = aEvent.GetCol();
475 EDA_UNITS cellUnits = cellUnitsData.first;
478 m_eval->SetDefaultUnits( cellUnits );
480 const int row = aEvent.GetRow();
483 bool isNullable =
false;
484 wxGridCellEditor* cellEditor = GetCellEditor( row, col );
490 isNullable = nullable->IsNullable();
492 cellEditor->DecRef();
496 [
this, row, col, isNullable, unitsProvider, cellDataType]()
500 if( row >= GetNumberRows() || col >= GetNumberCols() )
503 wxString stringValue = GetCellValue( row, col );
504 bool processedOk =
true;
507 processedOk =
m_eval->Process( stringValue );
515 std::optional<int> val;
535 if( stringValue != evalValue )
537 SetCellValue( row, col, evalValue );
558 Disconnect( wxEVT_IDLE, wxIdleEventHandler( WX_GRID::onIdleRefreshHighlight ),
nullptr,
this );
561 wxGrid::SetTable(
nullptr );
568 wxString shownColumns;
570 for(
int i = 0; i < GetNumberCols(); ++i )
572 if( IsColShown( i ) )
574 if( shownColumns.Length() )
575 shownColumns << wxT(
" " );
587 std::bitset<64> shownColumns;
589 for(
int ii = 0; ii < GetNumberCols(); ++ii )
590 shownColumns[ii] = IsColShown( ii );
598 for(
int i = 0; i < GetNumberCols(); ++i )
601 wxStringTokenizer shownTokens( shownColumns,
" \t\r\n", wxTOKEN_STRTOK );
603 while( shownTokens.HasMoreTokens() )
606 shownTokens.GetNextToken().ToLong( &colNumber );
608 if( colNumber >= 0 && colNumber < GetNumberCols() )
609 ShowCol( (
int) colNumber );
616 if( m_nativeColumnLabels )
617 wxGrid::DrawCornerLabel( dc );
619 wxRect rect( wxSize( m_rowLabelWidth, m_colLabelHeight ) );
625 wxDCBrushChanger setBrush( dc, m_colLabelWin->GetBackgroundColour() );
626 wxDCPenChanger setPen( dc, m_colLabelWin->GetBackgroundColour() );
627 dc.DrawRectangle( rect.Inflate( 1 ) );
636 if( m_nativeColumnLabels )
637 wxGrid::DrawColLabel( dc, col );
639 if( GetColWidth( col ) <= 0 || m_colLabelHeight <= 0 )
642 wxRect rect( GetColLeft( col ), 0, GetColWidth( col ), m_colLabelHeight );
648 wxDCBrushChanger setBrush( dc, m_colLabelWin->GetBackgroundColour() );
649 wxDCPenChanger setPen( dc, m_colLabelWin->GetBackgroundColour() );
650 dc.DrawRectangle( rect.Inflate( 1 ) );
656 dc.SetFont( GetLabelFont() );
659 GetColLabelAlignment( &hAlign, &vAlign );
660 const int orient = GetColLabelTextOrientation();
663 hAlign = wxALIGN_LEFT;
665 if( hAlign == wxALIGN_LEFT )
668 rend.DrawLabel( *
this, dc, GetColLabelValue( col ), rect, hAlign, vAlign, orient );
674 if( GetRowHeight( row ) <= 0 || m_rowLabelWidth <= 0 )
677 wxRect rect( 0, GetRowTop( row ), m_rowLabelWidth, GetRowHeight( row ) );
683 wxDCBrushChanger setBrush( dc, m_colLabelWin->GetBackgroundColour() );
684 wxDCPenChanger setPen( dc, m_colLabelWin->GetBackgroundColour() );
685 dc.DrawRectangle( rect.Inflate( 1 ) );
691 dc.SetFont( GetLabelFont() );
694 GetRowLabelAlignment(&hAlign, &vAlign);
696 if( hAlign == wxALIGN_LEFT )
699 rend.DrawLabel( *
this, dc, GetRowLabelValue( row ), rect, hAlign, vAlign, wxHORIZONTAL );
705 if( !IsCellEditControlEnabled() )
708 HideCellEditControl();
711 m_cellEditCtrlEnabled =
false;
713 int row = m_currentCellCoords.GetRow();
714 int col = m_currentCellCoords.GetCol();
716 wxString oldval = GetCellValue( row, col );
719 wxGridCellAttr* attr = GetCellAttr( row, col );
720 wxGridCellEditor*
editor = attr->GetEditor(
this, row, col );
722 editor->EndEdit( row, col,
this, oldval, &newval );
733 if( !IsCellEditControlEnabled() )
736 if( !aQuietMode && SendEvent( wxEVT_GRID_EDITOR_HIDDEN ) == -1 )
739 HideCellEditControl();
742 m_cellEditCtrlEnabled =
false;
744 int row = m_currentCellCoords.GetRow();
745 int col = m_currentCellCoords.GetCol();
747 wxString oldval = GetCellValue( row, col );
750 wxGridCellAttr* attr = GetCellAttr( row, col );
751 wxGridCellEditor*
editor = attr->GetEditor(
this, row, col );
753 bool changed =
editor->EndEdit( row, col,
this, oldval, &newval );
760 if( !aQuietMode && SendEvent( wxEVT_GRID_CELL_CHANGING, newval ) == -1 )
763 editor->ApplyEdit( row, col,
this );
768 if( !aQuietMode && SendEvent( wxEVT_GRID_CELL_CHANGED, oldval ) == -1 )
771 SetCellValue( row, col, oldval );
788 auto [row, editCol] = aAdder();
792 MakeCellVisible( row, std::max( editCol, 0 ) );
793 SetGridCursor( row, std::max( editCol, 0 ) );
797 EnableCellEditControl(
true );
798 ShowCellEditControl();
815 const std::function<
void(
int row )>& aDeleter )
817 wxArrayInt selectedRows = GetSelectedRows();
819 auto addSelectedRow = [&](
int row )
821 for(
size_t i = 0; i < selectedRows.size(); ++i )
823 if( selectedRows[i] == row )
827 selectedRows.push_back( row );
830 wxGridCellCoordsArray topLeft = GetSelectionBlockTopLeft();
831 wxGridCellCoordsArray botRight = GetSelectionBlockBottomRight();
833 for(
size_t i = 0; i < std::min( topLeft.Count(), botRight.Count() ); ++i )
835 for(
int row = topLeft[i].GetRow(); row <= botRight[i].GetRow(); ++row )
836 addSelectedRow( row );
839 wxGridCellCoordsArray cells = GetSelectedCells();
841 for(
size_t i = 0; i < cells.Count(); ++i )
842 addSelectedRow( cells[i].GetRow() );
844 if( selectedRows.empty() && GetGridCursorRow() >= 0 )
845 selectedRows.push_back( GetGridCursorRow() );
847 if( selectedRows.empty() )
850 for(
int row : selectedRows )
852 if( !aFilter( row ) )
861 [](
int* first,
int* second )
863 return *second - *first;
866 int nextSelRow = selectedRows.back() - 1;
868 if( nextSelRow >= 0 )
870 GoToCell( nextSelRow, GetGridCursorCol() );
871 SetGridCursor( nextSelRow, GetGridCursorCol() );
874 for(
int row : selectedRows )
881 for(
int col = 0; col < GetNumberCols(); ++col )
883 wxString temp = GetCellValue( aRowA, col );
884 SetCellValue( aRowA, col, GetCellValue( aRowB, col ) );
885 SetCellValue( aRowB, col, temp );
902 const std::function<
void(
int row )>& aMover )
907 int i = GetGridCursorRow();
909 if( i > 0 && aFilter( i ) )
913 SetGridCursor( i - 1, GetGridCursorCol() );
914 MakeCellVisible( GetGridCursorRow(), GetGridCursorCol() );
935 const std::function<
void(
int row )>& aMover )
940 int i = GetGridCursorRow();
942 if( i + 1 < GetNumberRows() && aFilter( i ) )
946 SetGridCursor( i + 1, GetGridCursorCol() );
947 MakeCellVisible( GetGridCursorRow(), GetGridCursorCol() );
980 wxString stringValue = GetCellValue( aRow, aCol );
986 m_eval->SetDefaultUnits( cellUnits );
988 if(
m_eval->Process( stringValue ) )
989 stringValue =
m_eval->Result();
998 wxString stringValue = GetCellValue( aRow, aCol );
1004 m_eval->SetDefaultUnits( cellUnits );
1007 stringValue =
m_eval->Result();
1023 SetCellValue( aRow, aCol,
getUnitsProvider( aCol )->StringFromValue( aValue,
true, cellDataType ) );
1036 SetCellValue( aRow, aCol,
getUnitsProvider( aCol )->StringFromOptionalValue( aValue,
true, cellDataType ) );
1054 size = GetRowLabelSize();
1056 for(
int row = 0; aContents && row < GetNumberRows(); row++ )
1057 size = std::max( size,
int( GetTextExtent( GetRowLabelValue( row ) + wxS(
"M" ) ).x ) );
1062 size = GetColSize( aCol );
1070 size = std::max( size,
int( GetTextExtent( GetColLabelValue( aCol ) + wxS(
"M" ) ).x ) );
1073 for(
int row = 0; aContents && row < GetNumberRows(); row++ )
1076 if( GetTable()->CanGetValueAs( row, aCol, wxGRID_VALUE_STRING ) )
1077 size = std::max( size, GetTextExtent( GetCellValue( row, aCol ) + wxS(
"M" ) ).x );
1079 size = std::max( size, GetTextExtent(
"MM" ).x );
1089 int line_height = int( GetTextExtent(
"Mj" ).y ) + 3;
1090 int row_height = GetColLabelSize();
1091 int initial_row_height = row_height;
1096 for(
int col = 0; col < GetNumberCols(); col++ )
1098 int nl_count = GetColLabelValue( col ).Freq(
'\n' );
1103 if( row_height < line_height * ( nl_count+1 ) )
1104 row_height += line_height * nl_count;
1110 if( initial_row_height != row_height )
1127 const int colCount = GetNumberCols();
1129 for(
int ii = 0; ii < GetNumberCols(); ++ii )
1134 wxASSERT_MSG(
m_flexibleCol < colCount,
"Flexible column index does not exist in grid" );
1136 Bind( wxEVT_UPDATE_UI,
1137 [
this]( wxUpdateUIEvent& aEvent )
1144 [
this]( wxSizeEvent& aEvent )
1151 Bind( wxEVT_GRID_CELL_CHANGED,
1152 [
this]( wxGridEvent& aEvent )
1164 const int width = GetSize().GetX() - wxSystemSettings::GetMetric( wxSYS_VSCROLL_X );
1166 std::optional<int> flexibleMinWidth;
1170 if( GetColSize( colIndex ) != 0 )
1172 AutoSizeColumn( colIndex );
1173 const int colSize = GetColSize( colIndex );
1175 int minWidthScaled = FromDIP( minWidth );
1176 SetColSize( colIndex, std::max( minWidthScaled, colSize ) );
1179 flexibleMinWidth = minWidthScaled;
1184 int nonFlexibleWidth = 0;
1186 for(
int i = 0; i < GetNumberCols(); ++i )
1189 nonFlexibleWidth += GetColSize( i );
1193 SetColSize(
m_flexibleCol, std::max( flexibleMinWidth.value_or( 0 ), width - nonFlexibleWidth ) );
1204 const int width = aEvent.GetSize().GetX();
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
A color representation with 4 components: red, green, blue, alpha.
wxColour ToColour() const
COLOR4D Mix(const COLOR4D &aColor, double aFactor) const
Return a color that is mixed with the input by a factor.
Icon provider for the "standard" row indicators, for example in layer selection lists.
static const wxString NullUiString
The string that is used in the UI to represent a null value.
std::optional< int > OptionalValueFromString(const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
Converts aTextValue in aUnits to internal units used by the frame.
wxString StringFromOptionalValue(std::optional< int > aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
Converts an optional aValue in internal units into a united string.
EDA_UNITS GetUserUnits() const
static EDA_DATA_TYPE GetTypeFromUnits(const EDA_UNITS aUnits)
Gets the inferred type from the given units.
wxString StringFromValue(double aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
Converts aValue in internal units into a united string.
int ValueFromString(const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
Converts aTextValue in aUnits to internal units used by the frame.
Attribute provider that provides attributes (or modifies the existing attribute) to alternate a row c...
WX_GRID_ALT_ROW_COLOR_PROVIDER(const wxColor &aBaseColor)
wxGridCellAttr * GetAttr(int row, int col, wxGridCellAttr::wxAttrKind kind) const override
wxGridCellAttrPtr m_attrEven
void UpdateColors(const wxColor &aBaseColor)
void DrawBorder(const wxGrid &grid, wxDC &dc, wxRect &rect) const override
wxGridCellAttr * enhanceAttr(wxGridCellAttr *aInputAttr, int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind)
int GetVisibleWidth(int aCol, bool aHeader=true, bool aContents=true, bool aKeep=false)
Calculate the specified column based on the actual size of the text on screen.
void onGridCellSelect(wxGridEvent &aEvent)
std::map< int, int > m_autosizedCols
void SetLabelFont(const wxFont &aFont)
Hide wxGrid's SetLabelFont() because for some reason on MSW it's a one-shot and subsequent calls to i...
void onDPIChanged(wxDPIChangedEvent &event)
void ShowHideColumns(const wxString &shownColumns)
Show/hide the grid columns based on a tokenized string of shown column indexes.
void OnMoveRowUp(const std::function< void(int row)> &aMover)
std::map< int, UNITS_PROVIDER * > m_unitsProviders
void SetTable(wxGridTableBase *table, bool aTakeOwnership=false)
Hide wxGrid's SetTable() method with one which doesn't mess up the grid column widths when setting th...
void DestroyTable(wxGridTableBase *aTable)
Work-around for a bug in wxGrid which crashes when deleting the table if the cell edit control was no...
std::unordered_map< int, std::pair< EDA_UNITS, EDA_DATA_TYPE > > m_autoEvalColsUnits
void SetAutoEvalColUnits(int col, EDA_UNITS aUnit, EDA_DATA_TYPE aUnitType)
Set the unit and unit data type to use for a given column.
bool CancelPendingChanges()
void SetColLabelSize(int aHeight)
Hide wxGrid's SetColLabelSize() method with one which makes sure the size is tall enough for the syst...
static int CapHeightToVisibleRows(int aMinHeight, int aHeaderHeight, const std::vector< int > &aRowHeights, int aMaxRows)
Height of aMaxRows data rows plus the column-label header, never more than aMinHeight.
void SwapRows(int aRowA, int aRowB)
These aren't that tricky, but might as well share code.
std::pair< EDA_UNITS, EDA_DATA_TYPE > getColumnUnits(int aCol) const
Returns the units and data type associated with a given column.
void SetUnitValue(int aRow, int aCol, int aValue)
Set a unitized cell's value.
WX_GRID(wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxWANTS_CHARS, const wxString &name=wxGridNameStr)
int GetUnitValue(int aRow, int aCol)
Apply standard KiCad unit and eval services to a numeric cell.
std::vector< int > m_autoEvalCols
UNITS_PROVIDER * getUnitsProvider(int aCol) const
std::map< std::pair< int, int >, std::pair< wxString, wxString > > m_evalBeforeAfter
void SetMinVisibleRows(wxWindow *aDialog, int aMinRows)
Floor this grid at aMinRows visible rows and grow aDialog so it opens tall enough to show every curre...
void DrawCornerLabel(wxDC &dc) override
A re-implementation of wxGrid::DrawCornerLabel which draws flat borders.
ROW_ICON_PROVIDER * m_rowIconProvider
void onCellEditorHidden(wxGridEvent &aEvent)
void SetupColumnAutosizer(int aFlexibleCol)
Set autosize behaviour using wxFormBuilder column widths as minimums, with a single specified growabl...
void RecomputeGridWidths()
void OnMoveRowDown(const std::function< void(int row)> &aMover)
void onGridColMove(wxGridEvent &aEvent)
void SetOptionalUnitValue(int aRow, int aCol, std::optional< int > aValue)
Set a unitized cell's optional value.
void onSizeEvent(wxSizeEvent &aEvent)
void onCellEditorShown(wxGridEvent &aEvent)
void EnsureColLabelsVisible()
Ensure the height of the row displaying the column labels is enough, even if labels are multiline tex...
void OnDeleteRows(const std::function< void(int row)> &aDeleter)
Handles a row deletion event.
wxString GetShownColumnsAsString()
Get a tokenized string containing the shown column indexes.
void OnAddRow(const std::function< std::pair< int, int >()> &aAdder)
void DrawRowLabel(wxDC &dc, int row) override
A re-implementation of wxGrid::DrawRowLabel which draws flat borders.
std::bitset< 64 > GetShownColumns()
static void CellEditorSetMargins(wxTextEntryBase *aEntry)
A helper function to set OS-specific margins for text-based cell editors.
std::optional< int > GetOptionalUnitValue(int aRow, int aCol)
Apply standard KiCad unit and eval services to a numeric cell.
void EnableAlternateRowColors(bool aEnable=true)
Enable alternate row highlighting, where every odd row has a different background color than the even...
void SetUnitsProvider(UNITS_PROVIDER *aProvider, int aCol=0)
Set a EUNITS_PROVIDER to enable use of unit- and eval-based Getters.
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
std::unique_ptr< NUMERIC_EVALUATOR > m_eval
void DrawColLabel(wxDC &dc, int col) override
A re-implementation of wxGrid::DrawColLabel which left-aligns the first column and draws flat borders...
static void CellEditorTransformSizeRect(wxRect &aRect)
A helper function to tweak sizes of text-based cell editors depending on OS.
EDA_DATA_TYPE
The type of unit.
KICOMMON_API wxFont GetControlFont(wxWindow *aWindow)
const int c_IndicatorSizeDIP
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
PGM_BASE & Pgm()
The global program "get" accessor.
Functions to provide common constants and other functions to assist in making a consistent UI.
wxColour getBorderColour()
#define MIN_GRIDCELL_MARGIN