Allow expanding/collapsing items from keyboard in generic wxDVC
Add the usual handlers for '-', '+' and '*' keys. The last one is especially convenient, as it does something that couldn't be easily done at all interactively before.
This commit is contained in:
@@ -4612,7 +4612,27 @@ void wxDataViewMainWindow::OnChar( wxKeyEvent &event )
|
|||||||
case WXK_DOWN:
|
case WXK_DOWN:
|
||||||
OnVerticalNavigation(event, +1);
|
OnVerticalNavigation(event, +1);
|
||||||
break;
|
break;
|
||||||
// Add the process for tree expanding/collapsing
|
|
||||||
|
case '+':
|
||||||
|
case WXK_ADD:
|
||||||
|
Expand(m_currentRow);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '*':
|
||||||
|
case WXK_MULTIPLY:
|
||||||
|
if ( !IsExpanded(m_currentRow) )
|
||||||
|
{
|
||||||
|
Expand(m_currentRow, true /* recursively */);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//else: fall through to Collapse()
|
||||||
|
wxFALLTHROUGH;
|
||||||
|
|
||||||
|
case '-':
|
||||||
|
case WXK_SUBTRACT:
|
||||||
|
Collapse(m_currentRow);
|
||||||
|
break;
|
||||||
|
|
||||||
case WXK_LEFT:
|
case WXK_LEFT:
|
||||||
OnLeftKey(event);
|
OnLeftKey(event);
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user