X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd3f686c274a264e89ea97505350a82c1134f307..c6eba8f8b204b0d722db0007e3e0d5e2d2d20085:/src/msw/choice.cpp diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index 9688accf39..cf0aec140e 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -22,6 +22,7 @@ #ifndef WX_PRECOMP #include "wx/choice.h" +#include "wx/utils.h" #endif #include "wx/msw/private.h" @@ -37,12 +38,13 @@ bool wxChoice::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId); event.SetInt(GetSelection()); event.SetEventObject(this); - event.SetString(copystring(GetStringSelection())); + event.SetString(GetStringSelection()); ProcessCommand(event); - delete[] event.GetString(); + return TRUE; } - else return FALSE; + else + return FALSE; } bool wxChoice::Create(wxWindow *parent, wxWindowID id, @@ -58,7 +60,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id, if (parent) parent->AddChild(this); SetBackgroundColour(parent->GetBackgroundColour()) ; SetForegroundColour(parent->GetForegroundColour()) ; - m_noStrings = n; + m_noStrings = 0; m_windowStyle = style; @@ -93,7 +95,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id, wxCHECK_MSG( m_hWnd, FALSE, "Failed to create combobox" ); /* -#if CTL3D +#if wxUSE_CTL3D if (want3D) { m_useCtl3D = TRUE; @@ -105,7 +107,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id, // Subclass again for purposes of dialog editing mode SubclassWin(m_hWnd); - SetFont(* parent->GetFont()); + SetFont(parent->GetFont()); int i; for (i = 0; i < n; i++) @@ -179,7 +181,7 @@ wxString wxChoice::GetString(int n) const return wxString(wxBuffer); } -void wxChoice::SetSize(int x, int y, int width, int height, int sizeFlags) +void wxChoice::DoSetSize(int x, int y, int width, int height, int sizeFlags) { int currentX, currentY; GetPosition(¤tX, ¤tY); @@ -204,7 +206,7 @@ void wxChoice::SetSize(int x, int y, int width, int height, int sizeFlags) int cx; // button font dimensions int cy; - wxGetCharSize(GetHWND(), &cx, &cy, GetFont()); + wxGetCharSize(GetHWND(), &cx, &cy, & this->GetFont()); int control_width, control_height; @@ -232,7 +234,7 @@ void wxChoice::SetSize(int x, int y, int width, int height, int sizeFlags) for (i = 0; i < m_noStrings; i++) { wxString str(GetString(i)); - GetTextExtent(str, &len, &ht, NULL, NULL,GetFont()); + GetTextExtent(str, &len, &ht, NULL, NULL, & this->GetFont()); if ( len > longest) longest = len; } @@ -311,7 +313,7 @@ long wxChoice::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) // with x = 65535 and y = 65535. // Filter out this nonsense. if (x == 65535 && y == 65535) - return Default(); + return 0; break; } }