X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/233d02951f31484f8c26944fd4a44af0b0999276..09e48f0b1917db7e455f28c2c9ed661d39e9ab65:/src/msw/listctrl.cpp diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 6f8fe1c01a..3bd2d2cfa8 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -29,6 +29,8 @@ #pragma hdrstop #endif +#if wxUSE_LISTCTRL + #ifdef __WIN95__ #ifndef WX_PRECOMP @@ -45,7 +47,7 @@ #include "wx/msw/private.h" -#ifdef __GNUWIN32_OLD__ +#if ((defined(__GNUWIN32_OLD__) || defined(__TWIN32__)) && !defined(__CYGWIN10__)) #include "wx/msw/gnuwin32/extra.h" #else #include @@ -190,6 +192,10 @@ bool wxListCtrl::Create(wxWindow *parent, DWORD wstyle = WS_VISIBLE | WS_CHILD | WS_TABSTOP | LVS_SHAREIMAGELISTS | LVS_SHOWSELALWAYS; + + if ( m_windowStyle & wxCLIP_SIBLINGS ) + wstyle |= WS_CLIPSIBLINGS; + if ( wxStyleHasBorder(m_windowStyle) ) wstyle |= WS_BORDER; m_baseStyle = wstyle; @@ -1049,6 +1055,8 @@ wxTextCtrl* wxListCtrl::EditLabel(long item, wxClassInfo* textControlClass) { wxASSERT( (textControlClass->IsKindOf(CLASSINFO(wxTextCtrl))) ); + // VS: ListView_EditLabel requires that the list has focus. + SetFocus(); HWND hWnd = (HWND) ListView_EditLabel(GetHwnd(), item); if (m_textCtrl) @@ -1984,7 +1992,8 @@ static void wxConvertToMSWListItem(const wxListCtrl *ctrl, wxListItem& info, LV_ } else { - lvItem.pszText = WXSTRINGCAST info.m_text; + // pszText is not const, hence the cast + lvItem.pszText = (wxChar *)info.m_text.c_str(); if ( lvItem.pszText ) lvItem.cchTextMax = info.m_text.Length(); else @@ -2015,3 +2024,4 @@ wxListEvent::wxListEvent(wxEventType commandType, int id) #endif // __WIN95__ +#endif // wxUSE_LISTCTRL