diff options
author | Neil <nyamatongwe@gmail.com> | 2020-04-05 08:54:46 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2020-04-05 08:54:46 +1000 |
commit | e72c4af1c604bce533c68488cdb5802b461ec179 (patch) | |
tree | 2568f452a4245b686fa2df636b1d2c53545f228f | |
parent | a7398db7f9a0f27c7a9e21d4a692d5c6d8ba3533 (diff) | |
download | scintilla-mirror-e72c4af1c604bce533c68488cdb5802b461ec179.tar.gz |
Feature [feature-requests:1345]. Use ListBox_ macros in preference to LB_
messages. Modify types to match.
-rw-r--r-- | win32/PlatWin.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index e2a220e35..2206c026e 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -2536,7 +2536,7 @@ int ListBoxX::CaretFromEdge() { } void ListBoxX::Clear() { - ::SendMessage(lb, LB_RESETCONTENT, 0, 0); + ListBox_ResetContent(lb); maxItemCharacters = 0; widestItem = nullptr; lti.Clear(); @@ -2557,13 +2557,13 @@ void ListBoxX::Select(int n) { // selected states SetRedraw(false); CentreItem(n); - ::SendMessage(lb, LB_SETCURSEL, n, 0); + ListBox_SetCurSel(lb, n); OnSelChange(); SetRedraw(true); } int ListBoxX::GetSelection() { - return static_cast<int>(::SendMessage(lb, LB_GETCURSEL, 0, 0)); + return ListBox_GetCurSel(lb); } // This is not actually called at present @@ -2723,8 +2723,8 @@ void ListBoxX::SetList(const char *list, char separator, char typesep) { // Finally populate the listbox itself with the correct number of items const int count = lti.Count(); ::SendMessage(lb, LB_INITSTORAGE, count, 0); - for (int j=0; j<count; j++) { - ::SendMessage(lb, LB_ADDSTRING, 0, j+1); + for (intptr_t j=0; j<count; j++) { + ListBox_AddItemData(lb, j+1); } SetRedraw(true); } @@ -2931,10 +2931,10 @@ void ListBoxX::CentreItem(int n) { const POINT extent = GetClientExtent(); const int visible = extent.y/ItemHeight(); if (visible < Length()) { - const LRESULT top = ::SendMessage(lb, LB_GETTOPINDEX, 0, 0); + const int top = ListBox_GetTopIndex(lb); const int half = (visible - 1) / 2; if (n > (top + half)) - ::SendMessage(lb, LB_SETTOPINDEX, n - half , 0); + ListBox_SetTopIndex(lb, n - half); } } } @@ -2987,7 +2987,7 @@ LRESULT PASCAL ListBoxX::ControlWndProc(HWND hWnd, UINT iMessage, WPARAM wParam, const LRESULT lResult = ::SendMessage(hWnd, LB_ITEMFROMPOINT, 0, lParam); const int item = LOWORD(lResult); if (HIWORD(lResult) == 0 && item >= 0) { - ::SendMessage(hWnd, LB_SETCURSEL, item, 0); + ListBox_SetCurSel(hWnd, item); if (lbx) { lbx->OnSelChange(); } @@ -3130,11 +3130,11 @@ LRESULT ListBoxX::WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam linesToScroll = 3; } linesToScroll *= (wheelDelta / WHEEL_DELTA); - LRESULT top = ::SendMessage(lb, LB_GETTOPINDEX, 0, 0) + linesToScroll; + int top = ListBox_GetTopIndex(lb) + linesToScroll; if (top < 0) { top = 0; } - ::SendMessage(lb, LB_SETTOPINDEX, top, 0); + ListBox_SetTopIndex(lb, top); // update wheel delta residue if (wheelDelta >= 0) wheelDelta = wheelDelta % WHEEL_DELTA; |