X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f7dd07f64d344e5b84c8dbe278ce4ad9da2a3c67..404b319a85dadd7decf7a5a5331020520031a41c:/src/msw/tooltip.cpp diff --git a/src/msw/tooltip.cpp b/src/msw/tooltip.cpp index 853b96ac63..349998f1d5 100644 --- a/src/msw/tooltip.cpp +++ b/src/msw/tooltip.cpp @@ -397,7 +397,7 @@ void wxToolTip::DoAddHWND(WXHWND hWnd) // NMTTDISPINFO struct -- and setting the tooltip here we can have tooltips // of any length ti.hwnd = hwnd; - ti.lpszText = const_cast(m_text.wx_str()); + ti.lpszText = wxMSW_CONV_LPTSTR(m_text); if ( !SendTooltipMessage(GetToolTipCtrl(), TTM_ADDTOOL, &ti) ) { @@ -442,7 +442,7 @@ void wxToolTip::DoAddHWND(WXHWND hWnd) const wxString token = tokenizer.GetNextToken(); SIZE sz; - if ( !::GetTextExtentPoint32(hdc, token.wx_str(), + if ( !::GetTextExtentPoint32(hdc, token.t_str(), token.length(), &sz) ) { wxLogLastError(wxT("GetTextExtentPoint32")); @@ -484,7 +484,7 @@ void wxToolTip::DoAddHWND(WXHWND hWnd) // replace the '\n's with spaces because otherwise they appear as // unprintable characters in the tooltip string m_text.Replace(wxT("\n"), wxT(" ")); - ti.lpszText = const_cast(m_text.wx_str()); + ti.lpszText = wxMSW_CONV_LPTSTR(m_text); if ( !SendTooltipMessage(GetToolTipCtrl(), TTM_ADDTOOL, &ti) ) { @@ -502,7 +502,7 @@ void wxToolTip::SetWindow(wxWindow *win) // add the window itself if ( m_window ) { - AddOtherWindow(m_window->GetHWND()); + DoAddHWND(m_window->GetHWND()); } #if !defined(__WXUNIVERSAL__) // and all of its subcontrols (e.g. radio buttons in a radiobox) as well @@ -561,7 +561,7 @@ void wxToolTip::DoSetTip(WXHWND hWnd) ti.lpszText = const_cast(wxT("")); (void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, &ti); - ti.lpszText = const_cast(m_text.wx_str()); + ti.lpszText = wxMSW_CONV_LPTSTR(m_text); (void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, &ti); }