return ::CallWindowProc(CASTWNDPROC gs_wndprocEdit, hWnd, message, wParam, lParam);
}
-WXHBRUSH wxComboBox::OnCtlColor(WXHDC pDC,
- WXHWND WXUNUSED(pWnd),
- WXUINT WXUNUSED(nCtlColor),
- WXUINT WXUNUSED(message),
- WXWPARAM WXUNUSED(wParam),
- WXLPARAM WXUNUSED(lParam))
-{
- HDC hdc = (HDC)pDC;
- wxColour colBack = GetBackgroundColour();
-
- if (!IsEnabled())
- colBack = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
-
- ::SetBkColor(hdc, wxColourToRGB(colBack));
- ::SetTextColor(hdc, wxColourToRGB(GetForegroundColour()));
-
- wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBack, wxSOLID);
-
- return (WXHBRUSH)brush->GetResourceHandle();
-}
-
// ----------------------------------------------------------------------------
// wxComboBox callbacks
// ----------------------------------------------------------------------------
// colour correctly (to be the same as our own one)
switch ( nMsg )
{
- // we have to handle both: one for the normal case and the other for
- // wxCB_READONLY
- case WM_CTLCOLOREDIT:
- case WM_CTLCOLORSTATIC:
- WXWORD nCtlColor;
- WXHDC hdc;
- WXHWND hwnd;
- UnpackCtlColor(wParam, lParam, &nCtlColor, &hdc, &hwnd);
-
- return (WXLRESULT)OnCtlColor(hdc, hwnd, nCtlColor, nMsg, wParam, lParam);
-
case CB_SETCURSEL:
// Selection was set with SetSelection. Update the value too.
- if (wParam < 0 || wParam > GetCount())
+ if ((int)wParam > GetCount())
m_value = wxEmptyString;
else
m_value = GetString(wParam);
break;
-
}
return wxChoice::MSWWindowProc(nMsg, wParam, lParam);
}
}
+void wxComboBox::GetSelection(long* from, long* to) const
+{
+ DWORD dwStart, dwEnd;
+ ::SendMessage(GetHwnd(), CB_GETEDITSEL, (WPARAM)&dwStart, (LPARAM)&dwEnd);
+
+ *from = dwStart;
+ *to = dwEnd;
+}
+
+int wxComboBox::GetSelection() const
+{
+ return wxChoice::GetSelection();
+}
+
#endif // wxUSE_COMBOBOX