wxT("Unknown flag in wxTreeCtrl::DoExpand") );
// A hidden root can be neither expanded nor collapsed.
- if ( (HITEM(item) == TVI_ROOT) && (m_windowStyle & wxTR_HIDE_ROOT) )
- {
- // No action will be taken.
- return;
- }
+ wxCHECK_RET( !(m_windowStyle & wxTR_HIDE_ROOT) || (HITEM(item) != TVI_ROOT),
+ wxT("Can't expand/collapse hidden root node!") )
// TreeView_Expand doesn't send TVN_ITEMEXPAND(ING) messages, so we must
// emulate them. This behaviour has changed slightly with comctl32.dll
m_textCtrl->SetHWND((WXHWND)hWnd);
m_textCtrl->SubclassWin((WXHWND)hWnd);
+ // set wxTE_PROCESS_ENTER style for the text control to force it to process
+ // the Enter presses itself, otherwise they could be stolen from it by the
+ // dialog navigation code
+ m_textCtrl->
+ SetWindowStyle(m_textCtrl->GetWindowStyle() | wxTE_PROCESS_ENTER);
+
return m_textCtrl;
}
eventType = wxEVT_COMMAND_TREE_KEY_DOWN;
TV_KEYDOWN *info = (TV_KEYDOWN *)lParam;
- // we pass 0 as last CreateKeyEvent() parameter because we
+ // we pass 0 as 2 last CreateKeyEvent() parameters because we
// don't have access to the real key press flags here - but as
// it is only used to determin wxKeyEvent::m_altDown flag it's
// not too bad
event.m_evtKey = CreateKeyEvent(wxEVT_KEY_DOWN,
- wxCharCodeMSWToWX(info->wVKey),
- 0);
+ wxCharCodeMSWToWX(info->wVKey));
// a separate event for Space/Return
if ( !wxIsCtrlDown() && !wxIsShiftDown() &&