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:
|
||||
OnVerticalNavigation(event, +1);
|
||||
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:
|
||||
OnLeftKey(event);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user