IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
#endif
-bool wxChoice::MSWCommand(const WXUINT param, const WXWORD WXUNUSED(id))
+bool wxChoice::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
{
if (param == CBN_SELCHANGE)
{
- wxCommandEvent event(wxEVENT_TYPE_CHOICE_COMMAND, m_windowId);
+ wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId);
event.SetInt(GetSelection());
event.SetEventObject(this);
event.SetString(copystring(GetStringSelection()));
else return FALSE;
}
-bool wxChoice::Create(wxWindow *parent, const wxWindowID id,
+bool wxChoice::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
- const int n, const wxString choices[],
- const long style,
+ int n, const wxString choices[],
+ long style,
const wxValidator& validator,
const wxString& name)
{
no_strings ++;
}
-void wxChoice::Delete(const int n)
+void wxChoice::Delete(int n)
{
no_strings = (int)SendMessage((HWND) GetHWND(), CB_DELETESTRING, n, 0);
}
return (int)SendMessage((HWND) GetHWND(), CB_GETCURSEL, 0, 0);
}
-void wxChoice::SetSelection(const int n)
+void wxChoice::SetSelection(int n)
{
SendMessage((HWND) GetHWND(), CB_SETCURSEL, n, 0);
}
#endif
}
-wxString wxChoice::GetString(const int n) const
+wxString wxChoice::GetString(int n) const
{
int len = (int)SendMessage((HWND) GetHWND(), CB_GETLBTEXT, n, (long)wxBuffer);
wxBuffer[len] = 0;
return wxString(wxBuffer);
}
-void wxChoice::SetSize(const int x, const int y, const int width, const int height, const int sizeFlags)
+void wxChoice::SetSize(int x, int y, int width, int height, int sizeFlags)
{
int currentX, currentY;
GetPosition(¤tX, ¤tY);
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
y1 = currentY;
+ AdjustForParentClientOrigin(x1, y1, sizeFlags);
+
// If we're prepared to use the existing size, then...
if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO))
{
control_width = (float)100.0;
else
{
- float len, ht;
+ int len, ht;
float longest = (float)0.0;
int i;
for (i = 0; i < no_strings; i++)
MoveWindow((HWND) GetHWND(), x1, y1,
(int)control_width, (int)control_height, TRUE);
-
-/*
-#if WXWIN_COMPATIBILITY
- GetEventHandler()->OldOnSize(width, height);
-#else
- wxSizeEvent event(wxSize(width, height), m_windowId);
- event.eventObject = this;
- GetEventHandler()->ProcessEvent(event);
-#endif
-*/
}
-WXHBRUSH wxChoice::OnCtlColor(const WXHDC pDC, const WXHWND pWnd, const WXUINT nCtlColor,
+WXHBRUSH wxChoice::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
return 0;