KiCad PCB EDA Suite
grid_tricks.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) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
5  * Copyright (C) 2012-18 KiCad Developers, see change_log.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include <grid_tricks.h>
26 #include <wx/tokenzr.h>
27 #include <wx/clipbrd.h>
28 #include <wx/log.h>
30 
31 
32 // It works for table data on clipboard for an Excel spreadsheet,
33 // why not us too for now.
34 #define COL_SEP wxT( '\t' )
35 #define ROW_SEP wxT( '\n' )
36 
37 
39  m_grid( aGrid )
40 {
41  m_sel_row_start = 0;
42  m_sel_col_start = 0;
43  m_sel_row_count = 0;
44  m_sel_col_count = 0;
45 
46  aGrid->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( GRID_TRICKS::onGridCellLeftClick ), NULL, this );
47  aGrid->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( GRID_TRICKS::onGridCellLeftDClick ), NULL, this );
48  aGrid->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( GRID_TRICKS::onGridCellRightClick ), NULL, this );
49  aGrid->Connect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( GRID_TRICKS::onGridLabelRightClick ), NULL, this );
50  aGrid->Connect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( GRID_TRICKS::onGridLabelLeftClick ), NULL, this );
51  aGrid->Connect( GRIDTRICKS_FIRST_ID, GRIDTRICKS_LAST_ID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GRID_TRICKS::onPopupSelection ), NULL, this );
52  aGrid->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( GRID_TRICKS::onKeyDown ), NULL, this );
53  aGrid->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( GRID_TRICKS::onUpdateUI ), NULL, this );
54 }
55 
56 
57 bool GRID_TRICKS::toggleCell( int aRow, int aCol, bool aPreserveSelection )
58 {
59  auto renderer = m_grid->GetCellRenderer( aRow, aCol );
60  bool isCheckbox = ( dynamic_cast<wxGridCellBoolRenderer*>( renderer ) != nullptr );
61  renderer->DecRef();
62 
63  if( isCheckbox )
64  {
65  if( !aPreserveSelection )
66  m_grid->ClearSelection();
67 
68  m_grid->SetGridCursor( aRow, aCol );
69 
70  wxGridTableBase* model = m_grid->GetTable();
71 
72  if( model->CanGetValueAs( aRow, aCol, wxGRID_VALUE_BOOL )
73  && model->CanSetValueAs( aRow, aCol, wxGRID_VALUE_BOOL ) )
74  {
75  model->SetValueAsBool( aRow, aCol, !model->GetValueAsBool( aRow, aCol ) );
76  }
77  else // fall back to string processing
78  {
79  if( model->GetValue( aRow, aCol ) == wxT( "1" ) )
80  model->SetValue( aRow, aCol, wxT( "0" ) );
81  else
82  model->SetValue( aRow, aCol, wxT( "1" ) );
83  }
84 
85  // Mac needs this for the keyboard events; Linux appears to always need it.
86  m_grid->ForceRefresh();
87 
88  // Let any clients know
89  wxGridEvent event( m_grid->GetId(), wxEVT_GRID_CELL_CHANGED, m_grid, aRow, aCol );
90  event.SetString( model->GetValue( aRow, aCol ) );
91  m_grid->GetEventHandler()->ProcessEvent( event );
92 
93  return true;
94  }
95 
96  return false;
97 }
98 
99 
100 bool GRID_TRICKS::showEditor( int aRow, int aCol )
101 {
102  if( m_grid->GetGridCursorRow() != aRow || m_grid->GetGridCursorCol() != aCol )
103  m_grid->SetGridCursor( aRow, aCol );
104 
105  if( m_grid->IsEditable() && !m_grid->IsReadOnly( aRow, aCol ) )
106  {
107  m_grid->ClearSelection();
108 
109  if( m_grid->GetSelectionMode() == wxGrid::wxGridSelectRows )
110  {
111  wxArrayInt rows = m_grid->GetSelectedRows();
112 
113  if( rows.size() != 1 || rows.Item( 0 ) != aRow )
114  m_grid->SelectRow( aRow );
115  }
116 
117  // For several reasons we can't enable the control here. There's the whole
118  // SetInSetFocus() issue/hack in wxWidgets, and there's also wxGrid's MouseUp
119  // handler which doesn't notice it's processing a MouseUp until after it has
120  // disabled the editor yet again. So we re-use wxWidgets' slow-click hack,
121  // which is processed later in the MouseUp handler.
122  //
123  // It should be pointed out that the fact that it's wxWidgets' hack doesn't
124  // make it any less of a hack. Be extra careful with any modifications here.
125  // See, in particular, https://bugs.launchpad.net/kicad/+bug/1817965.
127 
128  return true;
129  }
130 
131  return false;
132 }
133 
134 
135 void GRID_TRICKS::onGridCellLeftClick( wxGridEvent& aEvent )
136 {
137  int row = aEvent.GetRow();
138  int col = aEvent.GetCol();
139 
140  // Don't make users click twice to toggle a checkbox or edit a text cell
141  if( !aEvent.GetModifiers() )
142  {
143  if( toggleCell( row, col ) )
144  return;
145 
146  if( showEditor( row, col ) )
147  return;
148  }
149 
150  aEvent.Skip();
151 }
152 
153 
154 void GRID_TRICKS::onGridCellLeftDClick( wxGridEvent& aEvent )
155 {
156  if( !handleDoubleClick( aEvent ) )
157  onGridCellLeftClick( aEvent );
158 }
159 
160 
161 bool GRID_TRICKS::handleDoubleClick( wxGridEvent& aEvent )
162 {
163  // Double-click processing must be handled by specific sub-classes
164  return false;
165 }
166 
167 
169 {
170  wxGridCellCoordsArray topLeft = m_grid->GetSelectionBlockTopLeft();
171  wxGridCellCoordsArray botRight = m_grid->GetSelectionBlockBottomRight();
172 
173  wxArrayInt cols = m_grid->GetSelectedCols();
174  wxArrayInt rows = m_grid->GetSelectedRows();
175 
176  if( topLeft.Count() && botRight.Count() )
177  {
178  m_sel_row_start = topLeft[0].GetRow();
179  m_sel_col_start = topLeft[0].GetCol();
180 
181  m_sel_row_count = botRight[0].GetRow() - m_sel_row_start + 1;
182  m_sel_col_count = botRight[0].GetCol() - m_sel_col_start + 1;
183  }
184  else if( cols.Count() )
185  {
186  m_sel_col_start = cols[0];
187  m_sel_col_count = cols.Count();
188  m_sel_row_start = 0;
189  m_sel_row_count = m_grid->GetNumberRows();
190  }
191  else if( rows.Count() )
192  {
193  m_sel_col_start = 0;
194  m_sel_col_count = m_grid->GetNumberCols();
195  m_sel_row_start = rows[0];
196  m_sel_row_count = rows.Count();
197  }
198  else
199  {
200  m_sel_row_start = m_grid->GetGridCursorRow();
201  m_sel_col_start = m_grid->GetGridCursorCol();
202  m_sel_row_count = m_sel_row_start >= 0 ? 1 : 0;
203  m_sel_col_count = m_sel_col_start >= 0 ? 1 : 0;
204  }
205 }
206 
207 
209 {
210  wxMenu menu;
211 
212  showPopupMenu( menu );
213 }
214 
215 
216 void GRID_TRICKS::onGridLabelLeftClick( wxGridEvent& aEvent )
217 {
219 
220  aEvent.Skip();
221 }
222 
223 
225 {
226  wxMenu menu;
227 
228  for( int i = 0; i < m_grid->GetNumberCols(); ++i )
229  {
230  int id = GRIDTRICKS_FIRST_SHOWHIDE + i;
231  menu.AppendCheckItem( id, m_grid->GetColLabelValue( i ) );
232  menu.Check( id, m_grid->IsColShown( i ) );
233  }
234 
235  m_grid->PopupMenu( &menu );
236 }
237 
238 
239 void GRID_TRICKS::showPopupMenu( wxMenu& menu )
240 {
241  menu.Append( GRIDTRICKS_ID_CUT, _( "Cut" ) + "\tCtrl+X", _( "Clear selected cells placing original contents on clipboard" ) );
242  menu.Append( GRIDTRICKS_ID_COPY, _( "Copy" ) + "\tCtrl+C", _( "Copy selected cells to clipboard" ) );
243  menu.Append( GRIDTRICKS_ID_PASTE, _( "Paste" ) + "\tCtrl+V", _( "Paste clipboard cells to matrix at current cell" ) );
244  menu.Append( GRIDTRICKS_ID_DELETE, _( "Delete" ) + "\tDel", _( "Delete selected cells" ) );
245  menu.Append( GRIDTRICKS_ID_SELECT, _( "Select All" ) + "\tCtrl+A", _( "Select all cells" ) );
246 
247  getSelectedArea();
248 
249  // if nothing is selected, disable cut, copy and delete.
251  {
252  menu.Enable( GRIDTRICKS_ID_CUT, false );
253  menu.Enable( GRIDTRICKS_ID_COPY, false );
254  menu.Enable( GRIDTRICKS_ID_DELETE, false );
255  }
256 
257  menu.Enable( GRIDTRICKS_ID_PASTE, false );
258 
259  wxLogNull doNotLog; // disable logging of failed clipboard actions
260 
261  if( wxTheClipboard->Open() )
262  {
263  if( wxTheClipboard->IsSupported( wxDF_TEXT ) )
264  menu.Enable( GRIDTRICKS_ID_PASTE, true );
265 
266  wxTheClipboard->Close();
267  }
268 
269  m_grid->PopupMenu( &menu );
270 }
271 
272 
273 void GRID_TRICKS::onPopupSelection( wxCommandEvent& event )
274 {
275  doPopupSelection( event );
276 }
277 
278 
279 void GRID_TRICKS::doPopupSelection( wxCommandEvent& event )
280 {
281  int menu_id = event.GetId();
282 
283  // assume getSelectedArea() was called by rightClickPopupMenu() and there's
284  // no way to have gotten here without that having been called.
285 
286  switch( menu_id )
287  {
288  case GRIDTRICKS_ID_CUT:
289  cutcopy( true, true );
290  break;
291 
292  case GRIDTRICKS_ID_COPY:
293  cutcopy( true, false );
294  break;
295 
297  cutcopy( false, true );
298  break;
299 
300  case GRIDTRICKS_ID_PASTE:
301  paste_clipboard();
302  break;
303 
305  m_grid->SelectAll();
306  break;
307 
308  default:
309  if( menu_id >= GRIDTRICKS_FIRST_SHOWHIDE )
310  {
311  int col = menu_id - GRIDTRICKS_FIRST_SHOWHIDE;
312 
313  if( m_grid->IsColShown( col ) )
314  m_grid->HideCol( col );
315  else
316  m_grid->ShowCol( col );
317  }
318  }
319 }
320 
321 
322 void GRID_TRICKS::onKeyDown( wxKeyEvent& ev )
323 {
324  if( ev.GetModifiers() == wxMOD_CONTROL && ev.GetKeyCode() == 'A' )
325  {
326  m_grid->SelectAll();
327  return;
328  }
329  else if( ev.GetModifiers() == wxMOD_CONTROL && ev.GetKeyCode() == 'C' )
330  {
331  getSelectedArea();
332  cutcopy( true, false );
333  return;
334  }
335  else if( ev.GetModifiers() == wxMOD_CONTROL && ev.GetKeyCode() == 'V' )
336  {
337  getSelectedArea();
338  paste_clipboard();
339  return;
340  }
341  else if( ev.GetModifiers() == wxMOD_CONTROL && ev.GetKeyCode() == 'X' )
342  {
343  getSelectedArea();
344  cutcopy( true, true );
345  return;
346  }
347  else if( !ev.GetModifiers() && ev.GetKeyCode() == WXK_DELETE )
348  {
349  getSelectedArea();
350  cutcopy( false, true );
351  return;
352  }
353 
354  // space-bar toggling of checkboxes
355  if( ev.GetKeyCode() == ' ' )
356  {
357  bool retVal = false;
358 
359  // If only rows can be selected, only toggle the first cell in a row
360  if( m_grid->GetSelectionMode() == wxGrid::wxGridSelectRows )
361  {
362  wxArrayInt rowSel = m_grid->GetSelectedRows();
363 
364  for( unsigned int rowInd = 0; rowInd < rowSel.GetCount(); rowInd++ )
365  {
366  retVal |= toggleCell( rowSel[rowInd], 0, true );
367  }
368  }
369 
370  // If only columns can be selected, only toggle the first cell in a column
371  else if( m_grid->GetSelectionMode() == wxGrid::wxGridSelectColumns )
372  {
373  wxArrayInt colSel = m_grid->GetSelectedCols();
374 
375  for( unsigned int colInd = 0; colInd < colSel.GetCount(); colInd++ )
376  {
377  retVal |= toggleCell( 0, colSel[colInd], true );
378  }
379  }
380 
381  // If the user can select the individual cells, toggle each cell selected
382  else if( m_grid->GetSelectionMode() == wxGrid::wxGridSelectCells )
383  {
384  wxArrayInt rowSel = m_grid->GetSelectedRows();
385  wxArrayInt colSel = m_grid->GetSelectedCols();
386  wxGridCellCoordsArray cellSel = m_grid->GetSelectedCells();
387  wxGridCellCoordsArray topLeft = m_grid->GetSelectionBlockTopLeft();
388  wxGridCellCoordsArray botRight = m_grid->GetSelectionBlockBottomRight();
389 
390  // Iterate over every individually selected cell and try to toggle it
391  for( unsigned int cellInd = 0; cellInd < cellSel.GetCount(); cellInd++ )
392  {
393  retVal |= toggleCell( cellSel[cellInd].GetRow(), cellSel[cellInd].GetCol(), true );
394  }
395 
396  // Iterate over every column and try to toggle each cell in it
397  for( unsigned int colInd = 0; colInd < colSel.GetCount(); colInd++ )
398  {
399  for( int row = 0; row < m_grid->GetNumberRows(); row++ )
400  {
401  retVal |= toggleCell( row, colSel[colInd], true );
402  }
403  }
404 
405  // Iterate over every row and try to toggle each cell in it
406  for( unsigned int rowInd = 0; rowInd < rowSel.GetCount(); rowInd++ )
407  {
408  for( int col = 0; col < m_grid->GetNumberCols(); col++ )
409  {
410  retVal |= toggleCell( rowSel[rowInd], col, true );
411  }
412  }
413 
414  // Iterate over the selection blocks
415  for( unsigned int blockInd = 0; blockInd < topLeft.GetCount(); blockInd++ )
416  {
417  wxGridCellCoords start = topLeft[blockInd];
418  wxGridCellCoords end = botRight[blockInd];
419 
420  for( int row = start.GetRow(); row <= end.GetRow(); row++ )
421  {
422  for( int col = start.GetCol(); col <= end.GetCol(); col++ )
423  {
424  retVal |= toggleCell( row, col, true );
425  }
426  }
427  }
428  }
429  else
430  {
431  }
432 
433  // Return if there were any cells toggled
434  if( retVal )
435  return;
436  }
437 
438  // ctrl-tab for exit grid
439 #ifdef __APPLE__
440  bool ctrl = ev.RawControlDown();
441 #else
442  bool ctrl = ev.ControlDown();
443 #endif
444 
445  if( ctrl && ev.GetKeyCode() == WXK_TAB )
446  {
447  wxWindow* test = m_grid->GetNextSibling();
448 
449  if( !test )
450  test = m_grid->GetParent()->GetNextSibling();
451 
452  while( test && !test->IsTopLevel() )
453  {
454  test->SetFocus();
455 
456  if( test->HasFocus() )
457  break;
458 
459  if( !test->GetChildren().empty() )
460  test = test->GetChildren().front();
461  else if( test->GetNextSibling() )
462  test = test->GetNextSibling();
463  else
464  {
465  while( test )
466  {
467  test = test->GetParent();
468 
469  if( test && test->IsTopLevel() )
470  {
471  break;
472  }
473  else if( test && test->GetNextSibling() )
474  {
475  test = test->GetNextSibling();
476  break;
477  }
478  }
479  }
480  }
481 
482  return;
483  }
484 
485  ev.Skip( true );
486 }
487 
488 
490 {
491  wxLogNull doNotLog; // disable logging of failed clipboard actions
492 
493  if( wxTheClipboard->Open() )
494  {
495  if( wxTheClipboard->IsSupported( wxDF_TEXT ) )
496  {
497  wxTextDataObject data;
498 
499  wxTheClipboard->GetData( data );
500 
501  paste_text( data.GetText() );
502  }
503 
504  wxTheClipboard->Close();
505  m_grid->ForceRefresh();
506  }
507 }
508 
509 
510 void GRID_TRICKS::paste_text( const wxString& cb_text )
511 {
512  wxGridTableBase* tbl = m_grid->GetTable();
513 
514  const int cur_row = m_grid->GetGridCursorRow();
515  const int cur_col = m_grid->GetGridCursorCol();
516  int start_row;
517  int end_row;
518  int start_col;
519  int end_col;
520  bool is_selection = false;
521 
522  if( cur_row < 0 || cur_col < 0 )
523  {
524  wxBell();
525  return;
526  }
527 
528  if( m_grid->GetSelectionMode() == wxGrid::wxGridSelectRows )
529  {
530  if( m_sel_row_count > 1 )
531  is_selection = true;
532  }
533  else
534  {
535  if( m_grid->IsSelection() )
536  is_selection = true;
537  }
538 
539  wxStringTokenizer rows( cb_text, ROW_SEP, wxTOKEN_RET_EMPTY );
540 
541  // If selection of cells is present
542  // then a clipboard pastes to selected cells only.
543  if( is_selection )
544  {
545  start_row = m_sel_row_start;
546  end_row = m_sel_row_start + m_sel_row_count;
547  start_col = m_sel_col_start;
548  end_col = m_sel_col_start + m_sel_col_count;
549  }
550  // Otherwise, paste whole clipboard
551  // starting from cell with cursor.
552  else
553  {
554  start_row = cur_row;
555  end_row = cur_row + rows.CountTokens();
556 
557  if( end_row > tbl->GetNumberRows() )
558  end_row = tbl->GetNumberRows();
559 
560  start_col = cur_col;
561  end_col = start_col; // end_col actual value calculates later
562  }
563 
564  for( int row = start_row; row < end_row; ++row )
565  {
566  // If number of selected rows bigger than count of rows in
567  // the clipboard, paste from the clipboard again and again
568  // while end of the selection is reached.
569  if( !rows.HasMoreTokens() )
570  rows.SetString( cb_text, ROW_SEP, wxTOKEN_RET_EMPTY );
571 
572  wxString rowTxt = rows.GetNextToken();
573 
574  wxStringTokenizer cols( rowTxt, COL_SEP, wxTOKEN_RET_EMPTY );
575 
576  if( !is_selection )
577  {
578  end_col = cur_col + cols.CountTokens();
579 
580  if( end_col > tbl->GetNumberCols() )
581  end_col = tbl->GetNumberCols();
582  }
583 
584  for( int col = start_col; col < end_col; ++col )
585  {
586  // If number of selected columns bigger than count of columns in
587  // the clipboard, paste from the clipboard again and again while
588  // end of the selection is reached.
589  if( !cols.HasMoreTokens() )
590  cols.SetString( rowTxt, COL_SEP, wxTOKEN_RET_EMPTY );
591 
592  wxString cellTxt = cols.GetNextToken();
593 
594  if( tbl->CanSetValueAs( row, col, wxGRID_VALUE_STRING ) )
595  {
596  tbl->SetValue( row, col, cellTxt );
597 
598  wxGridEvent evt( m_grid->GetId(), wxEVT_GRID_CELL_CHANGED, m_grid, row, col );
599  m_grid->GetEventHandler()->ProcessEvent( evt );
600  }
601  }
602  }
603 }
604 
605 
606 void GRID_TRICKS::cutcopy( bool doCopy, bool doDelete )
607 {
608  wxLogNull doNotLog; // disable logging of failed clipboard actions
609 
610  if( doCopy && !wxTheClipboard->Open() )
611  return;
612 
613  wxGridTableBase* tbl = m_grid->GetTable();
614  wxString txt;
615 
616  // fill txt with a format that is compatible with most spreadsheets
617  for( int row = m_sel_row_start; row < m_sel_row_start + m_sel_row_count; ++row )
618  {
619  for( int col = m_sel_col_start; col < m_sel_col_start + m_sel_col_count; ++col )
620  {
621  txt += tbl->GetValue( row, col );
622 
623  if( col < m_sel_col_start + m_sel_col_count - 1 ) // that was not last column
624  txt += COL_SEP;
625 
626  if( doDelete )
627  {
628  if( tbl->CanSetValueAs( row, col, wxGRID_VALUE_STRING ) )
629  tbl->SetValue( row, col, wxEmptyString );
630  }
631  }
632 
633  txt += ROW_SEP;
634  }
635 
636  if( doCopy )
637  {
638  wxTheClipboard->SetData( new wxTextDataObject( txt ) );
639  wxTheClipboard->Close();
640  }
641 
642  if( doDelete )
643  m_grid->ForceRefresh();
644 }
645 
646 
647 void GRID_TRICKS::onUpdateUI( wxUpdateUIEvent& event )
648 {
649  // Respect ROW selectionMode when moving cursor
650 
651  if( m_grid->GetSelectionMode() == wxGrid::wxGridSelectRows )
652  {
653  int cursorRow = m_grid->GetGridCursorRow();
654  bool cursorInSelectedRow = false;
655 
656  for( int row : m_grid->GetSelectedRows() )
657  {
658  if( row == cursorRow )
659  {
660  cursorInSelectedRow = true;
661  break;
662  }
663  }
664 
665  if( !cursorInSelectedRow && cursorRow >= 0 )
666  m_grid->SelectRow( cursorRow );
667  }
668 }
void onGridLabelLeftClick(wxGridEvent &event)
void getSelectedArea()
Puts the selected area into a sensible rectangle of m_sel_{row,col}_{start,count} above.
int m_sel_row_count
Definition: grid_tricks.h:87
void onGridCellLeftClick(wxGridEvent &event)
void onGridCellRightClick(wxGridEvent &event)
virtual bool handleDoubleClick(wxGridEvent &aEvent)
int m_sel_col_start
Definition: grid_tricks.h:86
GRID_TRICKS(WX_GRID *aGrid)
Definition: grid_tricks.cpp:38
void onGridCellLeftDClick(wxGridEvent &event)
WX_GRID * m_grid
I don't own the grid, but he owns me.
Definition: grid_tricks.h:81
virtual void paste_text(const wxString &cb_text)
void onPopupSelection(wxCommandEvent &event)
int m_sel_col_count
Definition: grid_tricks.h:88
bool toggleCell(int aRow, int aCol, bool aPreserveSelection=false)
Definition: grid_tricks.cpp:57
bool showEditor(int aRow, int aCol)
#define NULL
virtual void cutcopy(bool doCopy, bool doDelete)
int m_sel_row_start
Definition: grid_tricks.h:85
virtual void paste_clipboard()
void onUpdateUI(wxUpdateUIEvent &event)
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:182
void onGridLabelRightClick(wxGridEvent &event)
#define ROW_SEP
Definition: grid_tricks.cpp:35
virtual void doPopupSelection(wxCommandEvent &event)
virtual void showPopupMenu(wxMenu &menu)
#define _(s)
Definition: 3d_actions.cpp:33
#define COL_SEP
Definition: grid_tricks.cpp:34
void onKeyDown(wxKeyEvent &ev)
void ShowEditorOnMouseUp()
WxWidgets has a bunch of bugs in its handling of wxGrid mouse events which close cell editors right a...
Definition: wx_grid.h:99