TomS:inSANE wrote:That's just not correct. Absence of CRLF-support and/or Multiline-Tooltips belongs to PB, not to windows.TomS wrote:It's not a bug in PB. Tooltips are provided and handled by the OS. Windows simply doesn't support it.
Just read the corresponding chapter in the MSDN:
The following code example (which uses the nice code from netmaestro to obtain the ToolTip handle)MSDN wrote:Implementing Multiline Tooltips
Multiline tooltips allow text to be displayed on more than one line. They are supported by version 4.70 and later of the common controls. Your application creates a multiline tooltip by sending a TTM_SETMAXTIPWIDTH message, specifying the width of the display rectangle.
demonstrates how to display a ToolTip created with the PureBasic function GadgetToolTip() and
display that TooltTip with 2 lines using a CR. You also could use #LF$ or #CRLF$ instead of #CR$:
Code: Select all
; ToolTipID() code from netmaestro
; http://www.purebasic.fr/english/viewtopic.php?t=36765&start=0
Procedure EnumProc(hwnd, lparam)
Shared ctrl
cn$ = Space(100)
GetClassName_(hwnd, @cn$, 99)
If UCase(cn$) = "TOOLTIPS_CLASS32"
With ti.TOOLINFO
\cbSize = SizeOf(TOOLINFO)
\hwnd = GetParent_(ctrl)
\uid = ctrl
EndWith
If SendMessage_(hwnd, #TTM_GETTOOLINFO, 0, @ti)
PokeI(lparam, hwnd)
ProcedureReturn 0
Else
ProcedureReturn 1
EndIf
Else
ProcedureReturn 1
EndIf
EndProcedure
ProcedureDLL.i ToolTipID(gadget)
Shared ctrl
ctrl = gadget
EnumWindows_(@EnumProc(),@TTID)
ProcedureReturn TTID
EndProcedure
OpenWindow(0, 1800, 400, 270, 100, "GadgetTooltip")
ButtonGadget(0, 10, 30, 250, 30, "Button with Tooltip")
GadgetToolTip(0, "Multiline Tooltip" + #CR$ + "with CR")
SendMessage_(ToolTipID(GadgetID(0)), #TTM_SETMAXTIPWIDTH, 0, 200)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow