But I run into a problem with Panelgadgets and Panes/Tab. How can I use tooltip with the independent Tabs/panes [Tab1, Tab2] etc
the Structure PB_Globals seems to have support for it, but I have no idea how to use it with Tooltip as It doesnt seem to have a way to tell exact Pane ID.
Code: Select all
EnableExplicit
#gadgets = 1
#Panes = 2
Structure PB_Globals
CurrentWindow.i
FirstOptionGadget.i
DefaultFont.i
*PanelStack
PanelStackIndex.l
PanelStackSize.l
ToolTipWindow.i
EndStructure
Import ""
PB_Object_GetThreadMemory(*Mem)
PB_Gadget_Globals
EndImport
Procedure ToolTipHandle(Flag.w)
Protected *PB_G.PB_Globals
*PB_G = PB_Object_GetThreadMemory(PB_Gadget_Globals)
Select Flag
Case #Gadgets
ProcedureReturn *PB_G\ToolTipWindow
Case #Panes
ProcedureReturn *PB_G\PanelStackIndex
EndSelect
EndProcedure
Define Null.i
Define ttip.i
If OpenWindow(0, 0, 0, 270, 200, "GadgetTooltip", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
PanelGadget(2,0,0,270,200)
AddGadgetItem(2, -1, "Tab1")
ButtonGadget(0, 10, 30, 250, 30, "Button with Tooltip-1")
GadgetToolTip(0, "Tooltip for Button and Now with More Lines 1")
ttip = ToolTipHandle(#gadgets)
SetWindowLongPtr_(ttip, #GWL_STYLE, GetWindowLongPtr_(ttip, #GWL_STYLE) | #TTS_ALWAYSTIP| #TTS_NOPREFIX| #WS_POPUP| #TTS_BALLOON &~ #WS_BORDER)
SetWindowTheme_(ttip, @null, @null)
SendMessage_(ttip,#TTM_SETMAXTIPWIDTH,0,100) ;Max tip width
AddGadgetItem(2, -1, "Tab2")
GadgetToolTip(2, "Tooltip for Button and Now with More Lines 3")
ttip = ToolTipHandle(#panes)
SetWindowLongPtr_(ttip, #GWL_STYLE, GetWindowLongPtr_(ttip, #GWL_STYLE) | #TTS_ALWAYSTIP| #TTS_NOPREFIX| #WS_POPUP| #TTS_BALLOON &~ #WS_BORDER)
SetWindowTheme_(ttip, @null, @null)
SendMessage_(ttip,#TTM_SETMAXTIPWIDTH,0,100) ;Max tip width
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf