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 | cbb80f09c04b0c245e31b3c1bd327c6cdd6f9a80 (patch) | |
| tree | 169a8432961db40768dae8ce4f2ab466d907c6a5 /win32/PlatWin.cxx | |
| parent | bf9adaf7f82732929f00336421536812805cdf8c (diff) | |
| download | scintilla-mirror-cbb80f09c04b0c245e31b3c1bd327c6cdd6f9a80.tar.gz | |
Backport: Feature [feature-requests:1345]. Use ListBox_ macros in preference to LB_
messages. Modify types to match.
Backport of changeset 8111:d15f7fe3467b.
Diffstat (limited to 'win32/PlatWin.cxx')
| -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 1df56e58c..e9856a629 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -2132,7 +2132,7 @@ int ListBoxX::CaretFromEdge() { } void ListBoxX::Clear() { - ::SendMessage(lb, LB_RESETCONTENT, 0, 0); + ListBox_ResetContent(lb); maxItemCharacters = 0; widestItem = nullptr; lti.Clear(); @@ -2153,13 +2153,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 @@ -2319,8 +2319,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); } @@ -2527,10 +2527,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); } } } @@ -2583,7 +2583,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(); } @@ -2726,11 +2726,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; |
