KiCad PCB EDA Suite
Loading...
Searching...
No Matches
wx_grid.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2018-2023 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 3
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include <wx/tokenzr.h>
25#include <wx/dc.h>
26#include <wx/settings.h>
27
28#include <widgets/wx_grid.h>
29#include <widgets/ui_common.h>
30#include <algorithm>
31#include <core/kicad_algo.h>
32#include <gal/color4d.h>
33
34#define MIN_GRIDCELL_MARGIN 3
35
36
38{
39 KIGFX::COLOR4D bg = wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK );
40 KIGFX::COLOR4D fg = wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER );
41 KIGFX::COLOR4D border = fg.Mix( bg, 0.50 );
42 return border.ToColour();
43}
44
45
46class WX_GRID_CORNER_HEADER_RENDERER : public wxGridCornerHeaderRendererDefault
47{
48public:
49 void DrawBorder( const wxGrid& grid, wxDC& dc, wxRect& rect ) const override
50 {
51 wxDCBrushChanger SetBrush( dc, *wxTRANSPARENT_BRUSH );
52 wxDCPenChanger SetPen( dc, wxPen( getBorderColour(), 1 ) );
53
54 rect.SetTop( rect.GetTop() + 1 );
55 rect.SetLeft( rect.GetLeft() + 1 );
56 rect.SetBottom( rect.GetBottom() - 1 );
57 rect.SetRight( rect.GetRight() - 1 );
58 dc.DrawRectangle( rect );
59 }
60};
61
62
63class WX_GRID_COLUMN_HEADER_RENDERER : public wxGridColumnHeaderRendererDefault
64{
65public:
66 void DrawBorder( const wxGrid& grid, wxDC& dc, wxRect& rect ) const override
67 {
68 wxDCBrushChanger SetBrush( dc, *wxTRANSPARENT_BRUSH );
69 wxDCPenChanger SetPen( dc, wxPen( getBorderColour(), 1 ) );
70
71 rect.SetTop( rect.GetTop() + 1 );
72 rect.SetLeft( rect.GetLeft() );
73 rect.SetBottom( rect.GetBottom() - 1 );
74 rect.SetRight( rect.GetRight() - 1 );
75 dc.DrawRectangle( rect );
76 }
77};
78
79
80class WX_GRID_ROW_HEADER_RENDERER : public wxGridRowHeaderRendererDefault
81{
82public:
83 void DrawBorder( const wxGrid& grid, wxDC& dc, wxRect& rect ) const override
84 {
85 wxDCBrushChanger SetBrush( dc, *wxTRANSPARENT_BRUSH );
86 wxDCPenChanger SetPen( dc, wxPen( getBorderColour(), 1 ) );
87
88 rect.SetTop( rect.GetTop() + 1 );
89 rect.SetLeft( rect.GetLeft() + 1 );
90 rect.SetBottom( rect.GetBottom() - 1 );
91 rect.SetRight( rect.GetRight() );
92 dc.DrawRectangle( rect );
93 }
94};
95
96
97WX_GRID::WX_GRID( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
98 long style, const wxString& name ) :
99 wxGrid( parent, id, pos, size, style, name ),
100 m_weOwnTable( false )
101{
102 SetDefaultCellOverflow( false );
103
104 // Make sure the GUI font scales properly
105 SetDefaultCellFont( KIUI::GetControlFont( this ) );
107
108 if( GetColLabelSize() > 0 )
109 SetColLabelSize( GetColLabelSize() + 4 );
110
111 Connect( wxEVT_DPI_CHANGED, wxDPIChangedEventHandler( WX_GRID::onDPIChanged ), nullptr, this );
112 Connect( wxEVT_GRID_EDITOR_SHOWN, wxGridEventHandler( WX_GRID::onCellEditorShown ), nullptr, this );
113 Connect( wxEVT_GRID_EDITOR_HIDDEN, wxGridEventHandler( WX_GRID::onCellEditorHidden ), nullptr, this );
114}
115
116
118{
119 if( m_weOwnTable )
120 DestroyTable( GetTable() );
121
122 Disconnect( wxEVT_DPI_CHANGED, wxDPIChangedEventHandler( WX_GRID::onDPIChanged ), nullptr, this );
123
124}
125
126
127void WX_GRID::onDPIChanged(wxDPIChangedEvent& aEvt)
128{
131#ifndef __WXMAC__
132 aEvt.Skip();
133#endif
134}
135
136
137void WX_GRID::SetColLabelSize( int aHeight )
138{
139 if( aHeight == 0 )
140 {
141 wxGrid::SetColLabelSize( 0 );
142 return;
143 }
144
145 // Correct wxFormBuilder height for large fonts
146 int minHeight = GetLabelFont().GetPixelSize().y + 2 * MIN_GRIDCELL_MARGIN;
147 wxGrid::SetColLabelSize( std::max( aHeight, minHeight ) );
148}
149
150
151void WX_GRID::SetLabelFont( const wxFont& aFont )
152{
153 wxGrid::SetLabelFont( KIUI::GetControlFont( this ) );
154}
155
156
157void WX_GRID::SetTable( wxGridTableBase* aTable, bool aTakeOwnership )
158{
159 // wxGrid::SetTable() messes up the column widths from wxFormBuilder so we have to save
160 // and restore them.
161 int numberCols = GetNumberCols();
162 int* formBuilderColWidths = new int[numberCols];
163
164 for( int i = 0; i < numberCols; ++i )
165 formBuilderColWidths[ i ] = GetColSize( i );
166
167 wxGrid::SetTable( aTable );
168
169 // wxGrid::SetTable() may change the number of columns, so prevent out-of-bounds access
170 // to formBuilderColWidths
171 numberCols = std::min( numberCols, GetNumberCols() );
172
173 for( int i = 0; i < numberCols; ++i )
174 {
175 // correct wxFormBuilder width for large fonts and/or long translations
176 int headingWidth = GetTextExtent( GetColLabelValue( i ) ).x + 2 * MIN_GRIDCELL_MARGIN;
177
178 SetColSize( i, std::max( formBuilderColWidths[ i ], headingWidth ) );
179 }
180
181 delete[] formBuilderColWidths;
182
183 Connect( wxEVT_GRID_COL_MOVE, wxGridEventHandler( WX_GRID::onGridColMove ), nullptr, this );
184 Connect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( WX_GRID::onGridCellSelect ), nullptr, this );
185
186 m_weOwnTable = aTakeOwnership;
187}
188
189
190void WX_GRID::onGridCellSelect( wxGridEvent& aEvent )
191{
192 // Highlight the selected cell.
193 // Calling SelectBlock() allows a visual effect when cells are selected by tab or arrow keys.
194 // Otherwise, one cannot really know what actual cell is selected.
195 int row = aEvent.GetRow();
196 int col = aEvent.GetCol();
197
198 if( row >= 0 && col >= 0 )
199 SelectBlock( row, col, row, col, false );
200}
201
202
203void WX_GRID::onCellEditorShown( wxGridEvent& aEvent )
204{
205 if( alg::contains( m_autoEvalCols, aEvent.GetCol() ) )
206 {
207 int row = aEvent.GetRow();
208 int col = aEvent.GetCol();
209
210 const std::pair<wxString, wxString>& beforeAfter = m_evalBeforeAfter[ { row, col } ];
211
212 if( GetCellValue( row, col ) == beforeAfter.second )
213 SetCellValue( row, col, beforeAfter.first );
214 }
215}
216
217
218void WX_GRID::onCellEditorHidden( wxGridEvent& aEvent )
219{
220 if( alg::contains( m_autoEvalCols, aEvent.GetCol() ) )
221 {
222 UNITS_PROVIDER* unitsProvider = m_unitsProviders[ aEvent.GetCol() ];
223
224 if( !unitsProvider )
225 unitsProvider = m_unitsProviders.begin()->second;
226
227 m_eval->SetDefaultUnits( unitsProvider->GetUserUnits() );
228
229 int row = aEvent.GetRow();
230 int col = aEvent.GetCol();
231
232 CallAfter(
233 [this, row, col, unitsProvider]()
234 {
235 wxString stringValue = GetCellValue( row, col );
236
237 if( m_eval->Process( stringValue ) )
238 {
239 int val = unitsProvider->ValueFromString( m_eval->Result() );
240 wxString evalValue = unitsProvider->StringFromValue( val, true );
241
242 if( stringValue != evalValue )
243 {
244 SetCellValue( row, col, evalValue );
245 m_evalBeforeAfter[ { row, col } ] = { stringValue, evalValue };
246 }
247 }
248 } );
249 }
250
251 aEvent.Skip();
252}
253
254
255void WX_GRID::DestroyTable( wxGridTableBase* aTable )
256{
257 // wxGrid's destructor will crash trying to look up the cell attr if the edit control
258 // is left open. Normally it's closed in Validate(), but not if the user hit Cancel.
259 CommitPendingChanges( true /* quiet mode */ );
260
261 Disconnect( wxEVT_GRID_COL_MOVE, wxGridEventHandler( WX_GRID::onGridColMove ), nullptr, this );
262 Disconnect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( WX_GRID::onGridCellSelect ), nullptr, this );
263
264 wxGrid::SetTable( nullptr );
265 delete aTable;
266}
267
268
270{
271 wxString shownColumns;
272
273 for( int i = 0; i < GetNumberCols(); ++i )
274 {
275 if( IsColShown( i ) )
276 {
277 if( shownColumns.Length() )
278 shownColumns << wxT( " " );
279
280 shownColumns << i;
281 }
282 }
283
284 return shownColumns;
285}
286
287
289{
290 std::bitset<64> shownColumns;
291
292 for( int ii = 0; ii < GetNumberCols(); ++ii )
293 shownColumns[ii] = IsColShown( ii );
294
295 return shownColumns;
296}
297
298
299void WX_GRID::ShowHideColumns( const wxString& shownColumns )
300{
301 for( int i = 0; i < GetNumberCols(); ++i )
302 HideCol( i );
303
304 wxStringTokenizer shownTokens( shownColumns );
305
306 while( shownTokens.HasMoreTokens() )
307 {
308 long colNumber;
309 shownTokens.GetNextToken().ToLong( &colNumber );
310
311 if( colNumber >= 0 && colNumber < GetNumberCols() )
312 ShowCol( (int) colNumber );
313 }
314}
315
316
317void WX_GRID::ShowHideColumns( const std::bitset<64>& aShownColumns )
318{
319 for( int ii = 0; ii < GetNumberCols(); ++ ii )
320 {
321 if( aShownColumns[ii] )
322 ShowCol( ii );
323 else
324 HideCol( ii );
325 }
326}
327
328
330{
331 if( m_nativeColumnLabels )
332 wxGrid::DrawCornerLabel( dc );
333
334 wxRect rect( wxSize( m_rowLabelWidth, m_colLabelHeight ) );
335
337
338 // It is reported that we need to erase the background to avoid display
339 // artifacts, see #12055.
340 {
341 wxDCBrushChanger setBrush( dc, m_colLabelWin->GetBackgroundColour() );
342 wxDCPenChanger setPen( dc, m_colLabelWin->GetBackgroundColour() );
343 dc.DrawRectangle( rect.Inflate( 1 ) );
344 }
345
346 rend.DrawBorder( *this, dc, rect );
347}
348
349
350void WX_GRID::DrawColLabel( wxDC& dc, int col )
351{
352 if( m_nativeColumnLabels )
353 wxGrid::DrawColLabel( dc, col );
354
355 if( GetColWidth( col ) <= 0 || m_colLabelHeight <= 0 )
356 return;
357
358 wxRect rect( GetColLeft( col ), 0, GetColWidth( col ), m_colLabelHeight );
359
361
362 // It is reported that we need to erase the background to avoid display
363 // artifacts, see #12055.
364 {
365 wxDCBrushChanger setBrush( dc, m_colLabelWin->GetBackgroundColour() );
366 wxDCPenChanger setPen( dc, m_colLabelWin->GetBackgroundColour() );
367 dc.DrawRectangle( rect.Inflate( 1 ) );
368 }
369
370 rend.DrawBorder( *this, dc, rect );
371
372 // Make sure fonts get scaled correctly on GTK HiDPI monitors
373 dc.SetFont( GetLabelFont() );
374
375 int hAlign, vAlign;
376 GetColLabelAlignment( &hAlign, &vAlign );
377 const int orient = GetColLabelTextOrientation();
378
379 if( col == 0 )
380 hAlign = wxALIGN_LEFT;
381
382 if( hAlign == wxALIGN_LEFT )
383 rect.SetLeft( rect.GetLeft() + MIN_GRIDCELL_MARGIN );
384
385 rend.DrawLabel( *this, dc, GetColLabelValue( col ), rect, hAlign, vAlign, orient );
386}
387
388
389void WX_GRID::DrawRowLabel( wxDC& dc, int row )
390{
391 if ( GetRowHeight( row ) <= 0 || m_rowLabelWidth <= 0 )
392 return;
393
394 wxRect rect( 0, GetRowTop( row ), m_rowLabelWidth, GetRowHeight( row ) );
395
396 static WX_GRID_ROW_HEADER_RENDERER rend;
397
398 // It is reported that we need to erase the background to avoid display
399 // artifacts, see #12055.
400 {
401 wxDCBrushChanger setBrush( dc, m_colLabelWin->GetBackgroundColour() );
402 wxDCPenChanger setPen( dc, m_colLabelWin->GetBackgroundColour() );
403 dc.DrawRectangle( rect.Inflate( 1 ) );
404 }
405
406 rend.DrawBorder( *this, dc, rect );
407
408 // Make sure fonts get scaled correctly on GTK HiDPI monitors
409 dc.SetFont( GetLabelFont() );
410
411 int hAlign, vAlign;
412 GetRowLabelAlignment(&hAlign, &vAlign);
413
414 if( hAlign == wxALIGN_LEFT )
415 rect.SetLeft( rect.GetLeft() + MIN_GRIDCELL_MARGIN );
416
417 rend.DrawLabel( *this, dc, GetRowLabelValue( row ), rect, hAlign, vAlign, wxHORIZONTAL );
418}
419
420
422{
423 if( !IsCellEditControlEnabled() )
424 return true;
425
426 HideCellEditControl();
427
428 // do it after HideCellEditControl()
429 m_cellEditCtrlEnabled = false;
430
431 int row = m_currentCellCoords.GetRow();
432 int col = m_currentCellCoords.GetCol();
433
434 wxString oldval = GetCellValue( row, col );
435 wxString newval;
436
437 wxGridCellAttr* attr = GetCellAttr( row, col );
438 wxGridCellEditor* editor = attr->GetEditor( this, row, col );
439
440 editor->EndEdit( row, col, this, oldval, &newval );
441
442 editor->DecRef();
443 attr->DecRef();
444
445 return true;
446}
447
448
449bool WX_GRID::CommitPendingChanges( bool aQuietMode )
450{
451 if( !IsCellEditControlEnabled() )
452 return true;
453
454 if( !aQuietMode && SendEvent( wxEVT_GRID_EDITOR_HIDDEN ) == -1 )
455 return false;
456
457 HideCellEditControl();
458
459 // do it after HideCellEditControl()
460 m_cellEditCtrlEnabled = false;
461
462 int row = m_currentCellCoords.GetRow();
463 int col = m_currentCellCoords.GetCol();
464
465 wxString oldval = GetCellValue( row, col );
466 wxString newval;
467
468 wxGridCellAttr* attr = GetCellAttr( row, col );
469 wxGridCellEditor* editor = attr->GetEditor( this, row, col );
470
471 bool changed = editor->EndEdit( row, col, this, oldval, &newval );
472
473 editor->DecRef();
474 attr->DecRef();
475
476 if( changed )
477 {
478 if( !aQuietMode && SendEvent( wxEVT_GRID_CELL_CHANGING, newval ) == -1 )
479 return false;
480
481 editor->ApplyEdit( row, col, this );
482
483 // for compatibility reasons dating back to wx 2.8 when this event
484 // was called wxEVT_GRID_CELL_CHANGE and wxEVT_GRID_CELL_CHANGING
485 // didn't exist we allow vetoing this one too
486 if( !aQuietMode && SendEvent( wxEVT_GRID_CELL_CHANGED, oldval ) == -1 )
487 {
488 // Event has been vetoed, set the data back.
489 SetCellValue( row, col, oldval );
490 return false;
491 }
492 }
493
494 return true;
495}
496
497
498void WX_GRID::SetUnitsProvider( UNITS_PROVIDER* aProvider, int aCol )
499{
500 m_unitsProviders[ aCol ] = aProvider;
501
502 if( !m_eval )
503 m_eval = std::make_unique<NUMERIC_EVALUATOR>( aProvider->GetUserUnits() );
504}
505
506
507int WX_GRID::GetUnitValue( int aRow, int aCol )
508{
509 UNITS_PROVIDER* unitsProvider = m_unitsProviders[ aCol ];
510
511 if( !unitsProvider )
512 unitsProvider = m_unitsProviders.begin()->second;
513
514 wxString stringValue = GetCellValue( aRow, aCol );
515
516 if( alg::contains( m_autoEvalCols, aCol ) )
517 {
518 m_eval->SetDefaultUnits( unitsProvider->GetUserUnits() );
519
520 if( m_eval->Process( stringValue ) )
521 stringValue = m_eval->Result();
522 }
523
524 return unitsProvider->ValueFromString( stringValue );
525}
526
527
528void WX_GRID::SetUnitValue( int aRow, int aCol, int aValue )
529{
530 UNITS_PROVIDER* unitsProvider = m_unitsProviders[ aCol ];
531
532 if( !unitsProvider )
533 unitsProvider = m_unitsProviders.begin()->second;
534
535 SetCellValue( aRow, aCol, unitsProvider->StringFromValue( aValue, true ) );
536}
537
538
539void WX_GRID::onGridColMove( wxGridEvent& aEvent )
540{
541 // wxWidgets won't move an open editor, so better just to close it
542 CommitPendingChanges( true );
543}
544
545
546int WX_GRID::GetVisibleWidth( int aCol, bool aHeader, bool aContents, bool aKeep )
547{
548 int size = 0;
549
550 if( aCol < 0 )
551 {
552 if( aKeep )
553 size = GetRowLabelSize();
554
555 for( int row = 0; aContents && row < GetNumberRows(); row++ )
556 size = std::max( size, int( GetTextExtent( GetRowLabelValue( row ) + wxS( "M" ) ).x ) );
557 }
558 else
559 {
560 if( aKeep )
561 size = GetColSize( aCol );
562
563 // 'M' is generally the widest character, so we buffer the column width by default to
564 // ensure we don't write a continuous line of text at the column header
565 if( aHeader )
566 {
568
569 size = std::max( size, int( GetTextExtent( GetColLabelValue( aCol ) + wxS( "M" ) ).x ) );
570 }
571
572 for( int row = 0; aContents && row < GetNumberRows(); row++ )
573 {
574 // If we have text, get the size. Otherwise, use a placeholder for the checkbox
575 if( GetTable()->CanGetValueAs( row, aCol, wxGRID_VALUE_STRING ) )
576 size = std::max( size, GetTextExtent( GetCellValue( row, aCol ) + wxS( "M" ) ).x );
577 else
578 size = std::max( size, GetTextExtent( "MM" ).x );
579 }
580 }
581
582 return size;
583}
584
585
587{
588 int line_height = int( GetTextExtent( "Mj" ).y ) + 3;
589 int row_height = GetColLabelSize();
590 int initial_row_height = row_height;
591
592 // Headers can be multiline. Fix the Column Label Height to show the full header
593 // However GetTextExtent does not work on multiline strings,
594 // and do not return the full text height (only the height of one line)
595 for( int col = 0; col < GetNumberCols(); col++ )
596 {
597 int nl_count = GetColLabelValue( col ).Freq( '\n' );
598
599 if( nl_count )
600 {
601 // Col Label height must be able to show nl_count+1 lines
602 if( row_height < line_height * ( nl_count+1 ) )
603 row_height += line_height * nl_count;
604 }
605 }
606
607 // Update the column label size, but only if needed, to avoid generating useless
608 // and perhaps annoying UI events when the size does not change
609 if( initial_row_height != row_height )
610 SetColLabelSize( row_height );
611}
const char * name
Definition: DXF_plotter.cpp:57
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
wxColour ToColour() const
Definition: color4d.cpp:220
COLOR4D Mix(const COLOR4D &aColor, double aFactor) const
Return a color that is mixed with the input by a factor.
Definition: color4d.h:295
wxString StringFromValue(double aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Converts aValue in internal units into a united string.
int ValueFromString(const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Converts aTextValue in aUnits to internal units used by the frame.
EDA_UNITS GetUserUnits() const
void DrawBorder(const wxGrid &grid, wxDC &dc, wxRect &rect) const override
Definition: wx_grid.cpp:66
void DrawBorder(const wxGrid &grid, wxDC &dc, wxRect &rect) const override
Definition: wx_grid.cpp:49
void DrawBorder(const wxGrid &grid, wxDC &dc, wxRect &rect) const override
Definition: wx_grid.cpp:83
int GetVisibleWidth(int aCol, bool aHeader=true, bool aContents=true, bool aKeep=false)
Calculates the specified column based on the actual size of the text on screen.
Definition: wx_grid.cpp:546
void onGridCellSelect(wxGridEvent &aEvent)
Definition: wx_grid.cpp:190
~WX_GRID() override
Definition: wx_grid.cpp:117
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...
Definition: wx_grid.cpp:151
bool m_weOwnTable
Definition: wx_grid.h:178
void onDPIChanged(wxDPIChangedEvent &event)
Definition: wx_grid.cpp:127
void ShowHideColumns(const wxString &shownColumns)
Show/hide the grid columns based on a tokenized string of shown column indexes.
Definition: wx_grid.cpp:299
std::map< int, UNITS_PROVIDER * > m_unitsProviders
Definition: wx_grid.h:180
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...
Definition: wx_grid.cpp:157
void DestroyTable(wxGridTableBase *aTable)
Work-around for a bug in wxGrid which crashes when deleting the table if the cell edit control was no...
Definition: wx_grid.cpp:255
bool CancelPendingChanges()
Definition: wx_grid.cpp:421
void SetColLabelSize(int aHeight)
Hide wxGrid's SetColLabelSize() method with one which makes sure the size is tall enough for the syst...
Definition: wx_grid.cpp:137
void SetUnitValue(int aRow, int aCol, int aValue)
Set a unitized cell's value.
Definition: wx_grid.cpp:528
WX_GRID(wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxWANTS_CHARS, const wxString &name=wxGridNameStr)
Definition: wx_grid.cpp:97
int GetUnitValue(int aRow, int aCol)
Apply standard KiCad unit and eval services to a numeric cell.
Definition: wx_grid.cpp:507
std::vector< int > m_autoEvalCols
Definition: wx_grid.h:182
std::map< std::pair< int, int >, std::pair< wxString, wxString > > m_evalBeforeAfter
Definition: wx_grid.h:184
void DrawCornerLabel(wxDC &dc) override
A re-implementation of wxGrid::DrawCornerLabel which draws flat borders.
Definition: wx_grid.cpp:329
void onCellEditorHidden(wxGridEvent &aEvent)
Definition: wx_grid.cpp:218
void onGridColMove(wxGridEvent &aEvent)
Definition: wx_grid.cpp:539
void onCellEditorShown(wxGridEvent &aEvent)
Definition: wx_grid.cpp:203
void EnsureColLabelsVisible()
Ensure the height of the row displaying the column labels is enough, even if labels are multiline tex...
Definition: wx_grid.cpp:586
wxString GetShownColumnsAsString()
Get a tokenized string containing the shown column indexes.
Definition: wx_grid.cpp:269
void DrawRowLabel(wxDC &dc, int row) override
A re-implementation of wxGrid::DrawRowLabel which draws flat borders.
Definition: wx_grid.cpp:389
std::bitset< 64 > GetShownColumns()
Definition: wx_grid.cpp:288
void SetUnitsProvider(UNITS_PROVIDER *aProvider, int aCol=0)
Set a UNITS_PROVIDER to enable use of unit- and eval-based Getters.
Definition: wx_grid.cpp:498
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:449
std::unique_ptr< NUMERIC_EVALUATOR > m_eval
Definition: wx_grid.h:181
void DrawColLabel(wxDC &dc, int col) override
A re-implementation of wxGrid::DrawColLabel which left-aligns the first column and draws flat borders...
Definition: wx_grid.cpp:350
wxFont GetControlFont(wxWindow *aWindow)
Definition: ui_common.cpp:166
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Definition: kicad_algo.h:99
Functions to provide common constants and other functions to assist in making a consistent UI.
wxColour getBorderColour()
Definition: wx_grid.cpp:37
#define MIN_GRIDCELL_MARGIN
Definition: wx_grid.cpp:34