X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7f1a9dd7f05c0f5d81f368f0b0bfc8a918cbdd2f..85d8df29aa7c2de9ea92d13adeff46d5ed854d58:/src/msw/listctrl.cpp diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 90c122a4cc..2486ceef12 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -350,7 +350,7 @@ bool wxListCtrl::Create(wxWindow *parent, if ( !CreateControl(parent, id, pos, size, style, validator, name) ) return false; - if ( !MSWCreateControl(WC_LISTVIEW, _T(""), pos, size) ) + if ( !MSWCreateControl(WC_LISTVIEW, wxEmptyString, pos, size) ) return false; // explicitly say that we want to use Unicode because otherwise we get ANSI @@ -671,17 +671,15 @@ int wxListCtrl::GetColumnWidth(int col) const // Sets the column width bool wxListCtrl::SetColumnWidth(int col, int width) { - int col2 = col; if ( m_windowStyle & wxLC_LIST ) - col2 = -1; + col = 0; - int width2 = width; - if ( width2 == wxLIST_AUTOSIZE) - width2 = LVSCW_AUTOSIZE; - else if ( width2 == wxLIST_AUTOSIZE_USEHEADER) - width2 = LVSCW_AUTOSIZE_USEHEADER; + if ( width == wxLIST_AUTOSIZE) + width = LVSCW_AUTOSIZE; + else if ( width == wxLIST_AUTOSIZE_USEHEADER) + width = LVSCW_AUTOSIZE_USEHEADER; - return ListView_SetColumnWidth(GetHwnd(), col2, width2) != 0; + return ListView_SetColumnWidth(GetHwnd(), col, width) != 0; } // Gets the number of items that can fit vertically in the @@ -728,8 +726,7 @@ bool wxListCtrl::GetItem(wxListItem& info) const if ( info.m_mask & wxLIST_MASK_STATE ) { lvItem.mask |= LVIF_STATE; - // the other bits are hardly interesting anyhow - lvItem.stateMask = LVIS_SELECTED | LVIS_FOCUSED; + wxConvertToMSWFlags(0, info.m_stateMask, lvItem); } bool success = ListView_GetItem((HWND)GetHWND(), &lvItem) != 0; @@ -2385,6 +2382,21 @@ void wxListCtrl::OnPaint(wxPaintEvent& event) } } +WXLRESULT +wxListCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) +{ +#ifdef WM_PRINT + if ( nMsg == WM_PRINT ) + { + // we should bypass our own WM_PRINT handling as we don't handle + // PRF_CHILDREN flag, so leave it to the native control itself + return MSWDefWindowProc(nMsg, wParam, lParam); + } +#endif // WM_PRINT + + return wxControl::MSWWindowProc(nMsg, wParam, lParam); +} + // ---------------------------------------------------------------------------- // virtual list controls // ----------------------------------------------------------------------------