wxCONSTRUCTOR_5( wxListCtrl , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle )
/*
- TODO : Expose more information of a list's layout etc. via appropriate objects (à la NotebookPageInfo)
+ TODO : Expose more information of a list's layout etc. via appropriate objects (a la NotebookPageInfo)
*/
#else
IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxControl)
// GetTextColour will always return black
SetTextColour(GetDefaultAttributes().colFg);
+ if ( InReportView() )
+ MSWSetExListStyles();
+
+ return true;
+}
+
+void wxListCtrl::MSWSetExListStyles()
+{
// for comctl32.dll v 4.70+ we want to have some non default extended
// styles because it's prettier (and also because wxGTK does it like this)
- if ( InReportView() && wxApp::GetComCtl32Version() >= 470 )
+ if ( wxApp::GetComCtl32Version() >= 470 )
{
::SendMessage
(
LVS_EX_HEADERDRAGDROP
);
}
-
- return true;
}
WXDWORD wxListCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
if ( dwStyleOld != dwStyleNew )
{
::SetWindowLong(GetHwnd(), GWL_STYLE, dwStyleNew);
+
+ // if we switched to the report view, set the extended styles for
+ // it too
+ if ( !(dwStyleOld & LVS_REPORT) && (dwStyleNew & LVS_REPORT) )
+ MSWSetExListStyles();
}
}
}
{
if ( msg->message == WM_KEYDOWN )
{
- if ( msg->wParam == VK_RETURN )
+ // Only eat VK_RETURN if not being used by the application in
+ // conjunction with modifiers
+ if ( msg->wParam == VK_RETURN && !wxIsAnyModifierDown() )
{
- // We need VK_RETURN to generate wxEVT_COMMAND_LIST_ITEM_ACTIVATED,
- // but only if none of the modifiers is down. We'll let normal
- // accelerators handle those.
- if ( !wxIsCtrlDown() && !wxIsCtrlDown() &&
- !((HIWORD(msg->lParam) & KF_ALTDOWN) == KF_ALTDOWN))
+ // we need VK_RETURN to generate wxEVT_COMMAND_LIST_ITEM_ACTIVATED
return false;
}
}
-
return wxControl::MSWShouldPreProcessMessage(msg);
}
// focus event from here and the selection one
// below
event.SetEventType(eventType);
- (void)GetEventHandler()->ProcessEvent(event);
+ (void)HandleWindowEvent(event);
}
else // no focus event to send
{
event.SetEventType(eventType);
- bool processed = GetEventHandler()->ProcessEvent(event);
+ bool processed = HandleWindowEvent(event);
// post processing
// ---------------
int numCols = GetColumnCount();
int* indexArray = new int[numCols];
- BOOL rv = ListView_GetColumnOrderArray( GetHwnd(), numCols, indexArray );
- wxASSERT_MSG( rv == TRUE, _T("invalid column index array in OnPaint()") );
+ if ( !ListView_GetColumnOrderArray( GetHwnd(), numCols, indexArray) )
+ {
+ wxFAIL_MSG( _T("invalid column index array in OnPaint()") );
+ }
int x = itemRect.GetX();
for (int col = 0; col < numCols; col++)