// wxComboBox callbacks
// ----------------------------------------------------------------------------
-long wxComboBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
+WXLRESULT wxComboBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
// handle WM_CTLCOLOR messages from our EDIT control to be able to set its
// colour correctly (to be the same as our own one)
WXHWND hwnd;
UnpackCtlColor(wParam, lParam, &nCtlColor, &hdc, &hwnd);
- return OnCtlColor(hdc, hwnd, nCtlColor, nMsg, wParam, lParam);
+ return (WXLRESULT)OnCtlColor(hdc, hwnd, nCtlColor, nMsg, wParam, lParam);
}
return wxChoice::MSWWindowProc(nMsg, wParam, lParam);
validator, name) )
return FALSE;
- // we shouldn't call SetValue() for an empty read only combobox as it would
- // (correctly) thro an assert and is otherwise useless anyhow
- if ( n || !HasFlag(wxCB_READONLY) )
+ // we shouldn't call SetValue() for an empty string because this would
+ // (correctly) result in an assert with a read only combobox and is useless
+ // for the other ones anyhow
+ if ( !value.empty() )
SetValue(value);
// a (not read only) combobox is, in fact, 2 controls: the combobox itself
toChar = -1;
}
- if (
-#ifdef __WIN32__
- SendMessage(hWnd, CB_SETEDITSEL, (WPARAM)0, (LPARAM)MAKELONG(fromChar, toChar))
-#else // Win16
- SendMessage(hWnd, CB_SETEDITSEL, (WPARAM)fromChar, (LPARAM)toChar)
-#endif
- == CB_ERR )
+ if ( SendMessage(hWnd, CB_SETEDITSEL, (WPARAM)0, (LPARAM)MAKELONG(fromChar, toChar)) == CB_ERR )
{
wxLogDebug(_T("CB_SETEDITSEL failed"));
}