#include "wx/tooltip.h"
#ifndef WX_PRECOMP
+ #include "wx/msw/wrapcctl.h" // include <commctrl.h> "properly"
#include "wx/app.h"
#include "wx/control.h"
#include "wx/combobox.h"
#include "wx/tokenzr.h"
#include "wx/msw/private.h"
-// include <commctrl.h> "properly"
-#include "wx/msw/wrapcctl.h"
-
// VZ: normally, the trick with subclassing the tooltip control and processing
// TTM_WINDOWFROMPOINT should work but, somehow, it doesn't. I leave the
// code here for now (but it's not compiled) in case we need it later.
// NMTTDISPINFO struct -- and setting the tooltip here we can have tooltips
// of any length
ti.hwnd = hwnd;
- ti.lpszText = (wxChar *)m_text.c_str(); // const_cast
+ ti.lpszText = (wxChar *)m_text.wx_str(); // const_cast
if ( !SendTooltipMessage(GetToolTipCtrl(), TTM_ADDTOOL, &ti) )
{
while (token.length())
{
SIZE sz;
- if ( !::GetTextExtentPoint32(hdc, token, token.length(), &sz) )
+ if ( !::GetTextExtentPoint32(hdc, token.wx_str(), token.length(), &sz) )
{
wxLogLastError(wxT("GetTextExtentPoint32"));
}
if ( sz.cx > max )
max = sz.cx;
-
+
token = tokenizer.GetNextToken();
}
// replace the '\n's with spaces because otherwise they appear as
// unprintable characters in the tooltip string
m_text.Replace(_T("\n"), _T(" "));
- ti.lpszText = (wxChar *)m_text.c_str(); // const_cast
+ ti.lpszText = (wxChar *)m_text.wx_str(); // const_cast
if ( !SendTooltipMessage(GetToolTipCtrl(), TTM_ADDTOOL, &ti) )
{
{
// update the tip text shown by the control
wxToolInfo ti(GetHwndOf(m_window));
- ti.lpszText = (wxChar *)m_text.c_str();
+ ti.lpszText = (wxChar *)m_text.wx_str();
(void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, &ti);
}