Make TAB behaviour in wxGrid more configurable.

Allow making TAB/Shift-TAB wrap to the next/previous row or going to the
next/previous control when the cursor is at the end/beginning of the current
row easily.

Also add wxEVT_GRID_TABBING event to allow customizing TAB behaviour even
further.

Update the sample to show the different possible standard behaviours and a
stupid example of a custom one (it would be probably more useful to implement
something a tad more realistic, e.g. tabbing to the next non-empty cell).

Closes #14711.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72672 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-10-13 22:55:18 +00:00
parent ac6a837eed
commit 1dc17bcafb
6 changed files with 193 additions and 20 deletions

View File

@@ -42,6 +42,8 @@ class GridFrame : public wxFrame
void SetNativeColHeader ( wxCommandEvent& );
void SetCustomColHeader( wxCommandEvent& );
void SetDefaultColHeader( wxCommandEvent& );
void SetTabBehaviour( wxCommandEvent& );
void SetTabCustomHandler( wxCommandEvent& );
void ToggleGridLines( wxCommandEvent& );
void AutoSizeCols( wxCommandEvent& );
void CellOverflow( wxCommandEvent& );
@@ -102,6 +104,8 @@ class GridFrame : public wxFrame
void OnSetHighlightWidth(wxCommandEvent&);
void OnSetROHighlightWidth(wxCommandEvent&);
void OnGridCustomTab(wxGridEvent& event);
public:
GridFrame();
~GridFrame();
@@ -140,6 +144,10 @@ public:
ID_COLDEFAULTHEADER,
ID_COLNATIVEHEADER,
ID_COLCUSTOMHEADER,
ID_TAB_STOP,
ID_TAB_WRAP,
ID_TAB_LEAVE,
ID_TAB_CUSTOM,
ID_GRIDLINECOLOUR,
ID_INSERTROW,
ID_INSERTCOL,