X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f7dd07f64d344e5b84c8dbe278ce4ad9da2a3c67..4a2d030adfa836f6ada1830c9057170d053bcc64:/src/msw/tooltip.cpp diff --git a/src/msw/tooltip.cpp b/src/msw/tooltip.cpp index 853b96ac63..56aa27bad9 100644 --- a/src/msw/tooltip.cpp +++ b/src/msw/tooltip.cpp @@ -4,7 +4,6 @@ // Author: Vadim Zeitlin // Modified by: // Created: 31.01.99 -// RCS-ID: $Id$ // Copyright: (c) 1999 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -397,7 +396,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 +441,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 +483,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 +501,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 +560,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); }