static void COMBOEX_DumpInput (COMBOBOXEXITEMW const *input)
{
- TRACE("input - mask=%08x, iItem=%d, pszText=%p, cchTM=%d, iImage=%d\n",
+ TRACE("input - mask=%08x, iItem=%ld, pszText=%p, cchTM=%d, iImage=%d\n",
input->mask, input->iItem, input->pszText, input->cchTextMax,
input->iImage);
if (input->mask & CBEIF_TEXT)
}
-static void COMBOEX_CopyItem (CBE_ITEMDATA *item, COMBOBOXEXITEMW *cit)
+static void COMBOEX_CopyItem (const CBE_ITEMDATA *item, COMBOBOXEXITEMW *cit)
{
if (cit->mask & CBEIF_TEXT) {
/*
}
-static CBE_ITEMDATA * COMBOEX_FindItem(COMBOEX_INFO *infoPtr, INT index)
+static CBE_ITEMDATA * COMBOEX_FindItem(const COMBOEX_INFO *infoPtr, INT_PTR index)
{
CBE_ITEMDATA *item;
INT i;
/* *** CBEM_xxx message support *** */
-static UINT COMBOEX_GetListboxText(COMBOEX_INFO *infoPtr, int n, LPWSTR buf)
+static UINT COMBOEX_GetListboxText(COMBOEX_INFO *infoPtr, INT_PTR n, LPWSTR buf)
{
CBE_ITEMDATA *item;
LPCWSTR str;
}
-static INT COMBOEX_DeleteItem (COMBOEX_INFO *infoPtr, INT index)
+static INT COMBOEX_DeleteItem (COMBOEX_INFO *infoPtr, INT_PTR index)
{
- TRACE("(index=%d)\n", index);
+ TRACE("(index=%ld)\n", index);
/* if item number requested does not exist then return failure */
if ((index >= infoPtr->nb_items) || (index < 0)) return CB_ERR;
}
-static BOOL COMBOEX_GetItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
+static BOOL COMBOEX_GetItemW (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
{
- INT index = cit->iItem;
+ INT_PTR index = cit->iItem;
CBE_ITEMDATA *item;
TRACE("(...)\n");
}
-static BOOL COMBOEX_GetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
+static BOOL COMBOEX_GetItemA (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
{
COMBOBOXEXITEMW tmpcit;
static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW const *cit)
{
- INT index;
+ INT_PTR index;
CBE_ITEMDATA *item;
NMCOMBOBOXEXW nmcit;
static BOOL COMBOEX_SetItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
{
- INT index = cit->iItem;
+ INT_PTR index = cit->iItem;
CBE_ITEMDATA *item;
if (TRACE_ON(comboex)) COMBOEX_DumpInput (cit);
/* now search from after starting loc and wrapping back to start */
for(i=start+1; i<count; i++) {
CBE_ITEMDATA *item = get_item_data(infoPtr, i);
+ if ((LRESULT)item == CB_ERR) continue;
if (cmptext(COMBOEX_GetText(infoPtr, item), str) == 0) return i;
}
for(i=0; i<=start; i++) {
CBE_ITEMDATA *item = get_item_data(infoPtr, i);
+ if ((LRESULT)item == CB_ERR) continue;
if (cmptext(COMBOEX_GetText(infoPtr, item), str) == 0) return i;
}
return CB_ERR;
}
-static DWORD_PTR COMBOEX_GetItemData (COMBOEX_INFO *infoPtr, INT index)
+static DWORD_PTR COMBOEX_GetItemData (COMBOEX_INFO *infoPtr, INT_PTR index)
{
CBE_ITEMDATA const *item1;
CBE_ITEMDATA const *item2;
}
-static INT COMBOEX_SetCursel (COMBOEX_INFO *infoPtr, INT index)
+static INT COMBOEX_SetCursel (COMBOEX_INFO *infoPtr, INT_PTR index)
{
CBE_ITEMDATA *item;
INT sel;
if (!(item = COMBOEX_FindItem(infoPtr, index)))
return SendMessageW (infoPtr->hwndCombo, CB_SETCURSEL, index, 0);
- TRACE("selecting item %d text=%s\n", index, debugstr_txt(item->pszText));
+ TRACE("selecting item %ld text=%s\n", index, debugstr_txt(item->pszText));
infoPtr->selected = index;
sel = (INT)SendMessageW (infoPtr->hwndCombo, CB_SETCURSEL, index, 0);
}
-static DWORD_PTR COMBOEX_SetItemData (COMBOEX_INFO *infoPtr, INT index, DWORD_PTR data)
+static DWORD_PTR COMBOEX_SetItemData (COMBOEX_INFO *infoPtr, INT_PTR index, DWORD_PTR data)
{
CBE_ITEMDATA *item1;
CBE_ITEMDATA const *item2;
}
-static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam)
{
LRESULT lret;
INT command = HIWORD(wParam);
CBE_ITEMDATA *item = 0;
WCHAR wintext[520];
- INT cursel, n, oldItem;
+ INT cursel, n;
+ INT_PTR oldItem;
NMCBEENDEDITW cbeend;
DWORD oldflags;
HWND parent = infoPtr->hwndNotify;
*/
oldItem = SendMessageW (infoPtr->hwndCombo, CB_GETCURSEL, 0, 0);
if (!(item = COMBOEX_FindItem(infoPtr, oldItem))) {
- ERR("item %d not found. Problem!\n", oldItem);
+ ERR("item %ld not found. Problem!\n", oldItem);
break;
}
infoPtr->selected = oldItem;
/* now draw the text */
if (!IsWindowVisible (infoPtr->hwndEdit)) {
- nbkc = GetSysColor ((dis->itemState & ODS_SELECTED) ?
- COLOR_HIGHLIGHT : COLOR_WINDOW);
+ nbkc = (dis->itemState & ODS_SELECTED) ?
+ comctl32_color.clrHighlight : comctl32_color.clrWindow;
bkc = SetBkColor (dis->hDC, nbkc);
- ntxc = GetSysColor ((dis->itemState & ODS_SELECTED) ?
- COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT);
+ ntxc = (dis->itemState & ODS_SELECTED) ?
+ comctl32_color.clrHighlightText : comctl32_color.clrWindowText;
txc = SetTextColor (dis->hDC, ntxc);
x = xbase + xioff;
y = dis->rcItem.top +
}
+static LRESULT COMBOEX_SetRedraw(COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+{
+ LRESULT ret = DefWindowProcW( infoPtr->hwndSelf, WM_SETREDRAW, wParam, lParam );
+ if (wParam) RedrawWindow( infoPtr->hwndSelf, NULL, 0, RDW_INVALIDATE|RDW_ERASE|RDW_ALLCHILDREN );
+ return ret;
+}
+
+
static LRESULT COMBOEX_WindowPosChanging (COMBOEX_INFO *infoPtr, WINDOWPOS *wp)
{
RECT cbx_wrect, cbx_crect, cb_wrect;
* The following was determined by traces of the native
*/
hDC = (HDC) wParam;
- obkc = SetBkColor (hDC, GetSysColor (COLOR_WINDOW));
+ obkc = SetBkColor (hDC, comctl32_color.clrWindow);
GetClientRect (hwnd, &rect);
TRACE("erasing (%s)\n", wine_dbgstr_rect(&rect));
ExtTextOutW (hDC, 0, 0, ETO_OPAQUE, &rect, 0, 0, 0);
hwnd, uMsg, wParam, lParam);
case WM_KEYDOWN: {
- INT oldItem, selected, step = 1;
+ INT_PTR oldItem, selected, step = 1;
CBE_ITEMDATA *item;
switch ((INT)wParam)
oldItem = SendMessageW (infoPtr->hwndCombo, CB_GETCURSEL, 0, 0);
InvalidateRect (infoPtr->hwndCombo, 0, 0);
if (!(item = COMBOEX_FindItem(infoPtr, oldItem))) {
- ERR("item %d not found. Problem!\n", oldItem);
+ ERR("item %ld not found. Problem!\n", oldItem);
break;
}
infoPtr->selected = oldItem;
if (selected != -1) {
cmp_func_t cmptext = get_cmp_func(infoPtr);
item = COMBOEX_FindItem (infoPtr, selected);
- TRACE("handling VK_RETURN, selected = %d, selected_text=%s\n",
+ TRACE("handling VK_RETURN, selected = %ld, selected_text=%s\n",
selected, debugstr_txt(item->pszText));
TRACE("handling VK_RETURN, edittext=%s\n",
debugstr_w(edit_text));
* The following was determined by traces of the native
*/
hDC = (HDC) wParam;
- obkc = SetBkColor (hDC, GetSysColor (COLOR_WINDOW));
+ obkc = SetBkColor (hDC, comctl32_color.clrWindow);
GetClientRect (hwnd, &rect);
TRACE("erasing (%s)\n", wine_dbgstr_rect(&rect));
ExtTextOutW (hDC, 0, 0, ETO_OPAQUE, &rect, 0, 0, 0);
LPCWSTR lastwrk;
cmp_func_t cmptext = get_cmp_func(infoPtr);
- INT selected = SendMessageW (infoPtr->hwndCombo,
- CB_GETCURSEL, 0, 0);
+ INT_PTR selected = SendMessageW (infoPtr->hwndCombo,
+ CB_GETCURSEL, 0, 0);
/* lstrlenW( lastworkingURL ) */
lastwrk = COMBOEX_GetText(infoPtr, item);
}
- TRACE("handling EN_CHANGE, selected = %d, selected_text=%s\n",
+ TRACE("handling EN_CHANGE, selected = %ld, selected_text=%s\n",
selected, debugstr_w(lastwrk));
TRACE("handling EN_CHANGE, edittext=%s\n",
debugstr_w(edit_text));
/* Window messages passed to parent */
case WM_COMMAND:
- return COMBOEX_Command (infoPtr, wParam, lParam);
+ return COMBOEX_Command (infoPtr, wParam);
case WM_NOTIFY:
if (infoPtr->NtfUnicode)
case WM_SIZE:
return COMBOEX_Size (infoPtr, LOWORD(lParam), HIWORD(lParam));
+ case WM_SETREDRAW:
+ return COMBOEX_SetRedraw(infoPtr, wParam, lParam);
+
case WM_WINDOWPOSCHANGING:
return COMBOEX_WindowPosChanging (infoPtr, (WINDOWPOS *)lParam);
SetFocus(infoPtr->hwndCombo);
return 0;
+ case WM_SYSCOLORCHANGE:
+ COMCTL32_RefreshSysColors();
+ return 0;
+
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n",uMsg,wParam,lParam);