diff options
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; | 
