X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1f11220943f14b4bb5190db0dfd0054304f5015c..1fd8a4504da7215d889e3e6234476581b0ba7adf:/src/msw/choice.cpp diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index 4bba2263d7..3f349227d3 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -38,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, @@ -59,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; @@ -86,12 +87,12 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id, if ( want3D || wxStyleHasBorder(m_windowStyle) ) msStyle |= WS_BORDER; - m_hWnd = (WXHWND)::CreateWindowEx(exStyle, "COMBOBOX", NULL, + m_hWnd = (WXHWND)::CreateWindowEx(exStyle, _T("COMBOBOX"), NULL, msStyle, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId, wxGetInstance(), NULL); - wxCHECK_MSG( m_hWnd, FALSE, "Failed to create combobox" ); + wxCHECK_MSG( m_hWnd, FALSE, _T("Failed to create combobox") ); /* #if wxUSE_CTL3D @@ -122,7 +123,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id, void wxChoice::Append(const wxString& item) { - SendMessage((HWND) GetHWND(), CB_ADDSTRING, 0, (LONG)(const char *)item); + SendMessage((HWND) GetHWND(), CB_ADDSTRING, 0, (LONG)(const wxChar *)item); m_noStrings ++; } @@ -165,7 +166,7 @@ int wxChoice::FindString(const wxString& s) const } return -1; #else - int pos = (int)SendMessage((HWND) GetHWND(), CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)(LPSTR)(const char *)s); + int pos = (int)SendMessage((HWND) GetHWND(), CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)(LPSTR)(const wxChar *)s); if (pos == LB_ERR) return -1; else @@ -180,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); @@ -312,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; } } @@ -326,7 +327,7 @@ wxString wxChoice::GetStringSelection (void) const if (sel > -1) return wxString(this->GetString (sel)); else - return wxString(""); + return wxString(_T("")); } bool wxChoice::SetStringSelection (const wxString& s)