X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7cc98b3e3fbe91688e1ff8852a03e589aec5c866..d391a3451080638e6b1f2f24f92078d18c5ab9d8:/src/msw/listctrl.cpp diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 66a752db4c..afc8bb65ed 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -39,7 +39,7 @@ #include "wx/msw/private.h" -#ifdef __GNUWIN32__ +#if defined(__GNUWIN32__) && !defined(wxUSE_NORLANDER_HEADERS) #include "wx/msw/gnuwin32/extra.h" #else #include @@ -174,8 +174,7 @@ bool wxListCtrl::DoCreateControl(int x, int y, int w, int h) } #endif // ListView_SetExtendedListViewStyle - wxSystemSettings settings; - SetBackgroundColour(settings.GetSystemColour(wxSYS_COLOUR_WINDOW)); + SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW)); SetForegroundColour(GetParent()->GetForegroundColour()); SubclassWin(m_hWnd); @@ -192,10 +191,10 @@ void wxListCtrl::UpdateStyle() DWORD dwStyleNew = ConvertToMSWStyle(dummy, m_windowStyle); dwStyleNew |= m_baseStyle; - // Get the current window style. + // Get the current window style. DWORD dwStyleOld = ::GetWindowLong(GetHwnd(), GWL_STYLE); - // Only set the window style if the view bits have changed. + // Only set the window style if the view bits have changed. if ( dwStyleOld != dwStyleNew ) { ::SetWindowLong(GetHwnd(), GWL_STYLE, dwStyleNew); @@ -741,7 +740,7 @@ wxColour wxListCtrl::GetTextColour(void) const // Sets the text colour of the listview void wxListCtrl::SetTextColour(const wxColour& col) { - ListView_SetTextColor(GetHwnd(), PALETTERGB(col.Red(), col.Blue(), col.Green())); + ListView_SetTextColor(GetHwnd(), PALETTERGB(col.Red(), col.Green(), col.Blue())); } // Gets the index of the topmost visible item when in @@ -1231,13 +1230,21 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) event.m_col = hdr->iSubItem; break; } + case LVN_DELETEALLITEMS: - { - eventType = wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS; - // NM_LISTVIEW* hdr = (NM_LISTVIEW*)lParam; - event.m_itemIndex = -1; - break; - } + // what's the sense of generating a wxWin event for this when + // it's absolutely not portable? +#if 0 + eventType = wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS; + event.m_itemIndex = -1; +#endif // 0 + + // return TRUE to suppress all additional LVN_DELETEITEM + // notifications - this makes deleting all items from a list ctrl + // much faster + *result = TRUE; + return TRUE; + case LVN_DELETEITEM: { eventType = wxEVT_COMMAND_LIST_DELETE_ITEM; @@ -1561,6 +1568,7 @@ wxListEvent::wxListEvent(wxEventType commandType, int id) { m_code = 0; m_itemIndex = 0; + m_oldItemIndex = 0; m_col = 0; m_cancelled = FALSE; }