+// ----------------------------------------------------------------------------
+// client data
+// ----------------------------------------------------------------------------
+
+void wxChoice::DoSetItemClientData( int n, void* clientData )
+{
+ if ( ::SendMessage(GetHwnd(), CB_SETITEMDATA,
+ n, (LPARAM)clientData) == CB_ERR )
+ {
+ wxLogLastError(wxT("CB_SETITEMDATA"));
+ }
+}
+
+void* wxChoice::DoGetItemClientData( int n ) const
+{
+ LPARAM rc = SendMessage(GetHwnd(), CB_GETITEMDATA, n, 0);
+ if ( rc == CB_ERR )
+ {
+ wxLogLastError(wxT("CB_GETITEMDATA"));
+
+ // unfortunately, there is no way to return an error code to the user
+ rc = (LPARAM) NULL;
+ }
+
+ return (void *)rc;
+}
+
+void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
+{
+ DoSetItemClientData(n, clientData);
+}
+
+wxClientData* wxChoice::DoGetItemClientObject( int n ) const
+{
+ return (wxClientData *)DoGetItemClientData(n);
+}
+
+// ----------------------------------------------------------------------------
+// wxMSW specific helpers
+// ----------------------------------------------------------------------------
+
+void wxChoice::DoMoveWindow(int x, int y, int width, int height)
+{
+ // here is why this is necessary: if the width is negative, the combobox
+ // window proc makes the window of the size width*height instead of
+ // interpreting height in the usual manner (meaning the height of the drop
+ // down list - usually the height specified in the call to MoveWindow()
+ // will not change the height of combo box per se)
+ //
+ // this behaviour is not documented anywhere, but this is just how it is
+ // here (NT 4.4) and, anyhow, the check shouldn't hurt - however without
+ // the check, constraints/sizers using combos may break the height
+ // constraint will have not at all the same value as expected
+ if ( width < 0 )
+ return;
+
+ wxControl::DoMoveWindow(x, y, width, height);
+}
+