#pragma hdrstop
#endif
+#if wxUSE_CHOICE
+
#ifndef WX_PRECOMP
#include "wx/choice.h"
#include "wx/utils.h"
#include "wx/msw/private.h"
- IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
// ============================================================================
// implementation
if ( style & wxCB_SORT )
msStyle |= CBS_SORT;
+ if ( style & wxCLIP_SIBLINGS )
+ msStyle |= WS_CLIPSIBLINGS;
+
+
// Experience shows that wxChoice vs. wxComboBox distinction confuses
// quite a few people - try to help them
wxASSERT_MSG( !(style & wxCB_DROPDOWN) &&
#endif // Watcom/!Watcom
}
-void wxChoice::SetString(int n, const wxString& s)
+void wxChoice::SetString(int WXUNUSED(n), const wxString& WXUNUSED(s))
{
wxFAIL_MSG(wxT("not implemented"));
// 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);
+}
+
void wxChoice::DoSetSize(int x, int y,
- int width, int height,
+ int width, int WXUNUSED(height),
int sizeFlags)
{
// Ignore height parameter because height doesn't mean 'initially
return TRUE;
}
-WXHBRUSH wxChoice::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
+WXHBRUSH wxChoice::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
+#if wxUSE_CTL3D
WXUINT message,
WXWPARAM wParam,
- WXLPARAM lParam)
+ WXLPARAM lParam
+#else
+ WXUINT WXUNUSED(message),
+ WXWPARAM WXUNUSED(wParam),
+ WXLPARAM WXUNUSED(lParam)
+#endif
+ )
{
#if wxUSE_CTL3D
if ( m_useCtl3D )
return (WXHBRUSH)brush->GetResourceHandle();
}
-
+#endif // wxUSE_CHOICE