Seite 1 von 2
Balloontips Automatisch einblenden?
Verfasst: 11.09.2004 13:23
von Lukaso
Hallo,
gibt es eine möglichkeit, Balloontips Automatisch bei einem Ereigniss aufpoppen zu lassen, und nach einer bestimmten zeit wieder verschwinden zu lassen? Nich dass ich extra mit der Maus drüber Fahren muss!
Danke
MFG Lukaso
Verfasst: 11.09.2004 19:15
von Lukaso
Kann mir keiner Helfen?

Verfasst: 11.09.2004 19:37
von Zaphod
es gibt auf jeden fall die möglichkeit, aber wie das geht hab ich keine ahnung.
Verfasst: 11.09.2004 21:03
von Falko
Vielleicht geht ja hiermit.
Der VisualDesigner erzeugt eine Procedure mit den BalloonTips, wenn man sie im Projekt mit einhakt. In dieser sind Strukturen enthalten, die man evt. abändern könnte.
Mehr habe ich auch noch nicht damit probiert.
Hab den Teil mal rauskopiert:
Code: Alles auswählen
; PureBasic Visual Designer v3.90 build 1360
; BalloonTip Constants
#TOOLTIP_NO_ICON = 0
#TOOLTIP_INFO_ICON = 1
#TOOLTIP_WARNING_ICON = 2
#TOOLTIP_ERROR_ICON = 3
Procedure BalloonTip(WindowID, Gadget, Text$ , Title$, Icon)
ToolTip=CreateWindowEx_(0,"ToolTips_Class32","",#WS_POPUP | #TTS_NOPREFIX | #TTS_BALLOON,0,0,0,0,WindowID(WindowID),0,GetModuleHandle_(0),0)
SendMessage_(ToolTip,#TTM_SETTIPTEXTCOLOR,GetSysColor_(#COLOR_INFOTEXT),0)
SendMessage_(ToolTip,#TTM_SETTIPBKCOLOR,GetSysColor_(#COLOR_INFOBK),0)
SendMessage_(ToolTip,#TTM_SETMAXTIPWIDTH,0,180)
Balloon.TOOLINFO\cbSize=SizeOf(TOOLINFO)
Balloon\uFlags=#TTF_IDISHWND | #TTF_SUBCLASS
Balloon\hWnd=GadgetID(Gadget)
Balloon\uId=GadgetID(Gadget)
Balloon\lpszText=@Text$
SendMessage_(ToolTip, #TTM_ADDTOOL, 0, Balloon)
If Title$ > ""
SendMessage_(ToolTip, #TTM_SETTITLE, Icon, @Title$)
EndIf
EndProcedure
MfG Falko
Verfasst: 11.09.2004 21:44
von Lukaso
Hallo,
den Source-Schnippsel habe ich auch schon vor mir, versuche schon Seit heute morgen irgendwie, das teil zu mlaufen zu bringen, stöberen schon im MS-SDK, aber bis jetzt ohne erfolg!
MfG Lukaso
Verfasst: 11.09.2004 22:48
von Lukaso
Habe gerade volgendes gefunden:
http://www.softgames.de/forum/viewtopic ... ht=balloon
Nur leider in der Falschen Sprache
Und Blicken tuh ichs auch ned

Verfasst: 12.09.2004 20:19
von sbehrens
Hi Lukaso,
könnte man nicht notfalls einfach ein ChildWindow aufmachen, oder ein "geskintes" Window? Ich finde das wäre gar keine so schlechte Idee, sieht doch bestimmt auch besser aus als diese langweiligen Balloon-Tips? Diesen Code in der anderen Sprache kappe ich auch kein bisschen :P
mfG
Basti
Verfasst: 13.09.2004 14:35
von ChaOsKid
Hi Lukaso,
die andere sprache ist delphi,
das kann ich zwar etwas,
aber meine übersetzung wollte nicht funktionieren...
ich hab mal mit den tooltips rumgespielt,
und jetzt kann ich einen tooltip auf befehl aufpopen lassen
aber er popt leider immer am mauscursor auf...
Code: Alles auswählen
OpenWindow(0,0,0,200,100,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"Tooltip")
CreateGadgetList(WindowID(0))
ButtonGadget(1, 30, 30, 50, 20, "Aus")
ToolTip=CreateWindowEx_(0,"ToolTips_Class32","",#WS_POPUP | #TTS_NOPREFIX,0,0,0,0,WindowID(WindowID),0,GetModuleHandle_(0),0)
Balloon.TOOLINFO\cbSize=SizeOf(TOOLINFO)
Balloon\uFlags=#TTF_IDISHWND | #TTF_SUBCLASS
Balloon\uID=GadgetID(1)
Balloon\lpszText=@"Test Text"
SendMessage_(ToolTip, #TTM_ADDTOOL, 0, Balloon)
on = 1
Repeat
Select WindowEvent()
Case #PB_Event_Gadget
Select EventGadgetID()
Case 1
If on
SendMessage_(ToolTip, #TTM_TRACKACTIVATE, 1, Balloon)
SetGadgetText(1, "Aus")
on = 0
Else
SendMessage_(ToolTip, #TTM_TRACKACTIVATE, 0, Balloon)
SetGadgetText(1, "Ein")
on = 1
EndIf
EndSelect
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
Delay(20)
Until Quit
mfG
ChaOsKid
Verfasst: 13.09.2004 15:35
von Lukaso
Hallo,
@ChaOsKid
Danke, brinkt mich ein ganzen stück weiter, jetzt nur noch das Problem, dass es auf einer bestimmten Koordinate angezeigt werden soll.
@pTi
Wäre auch möglich, aber ich Denke, dass mir der Balloon ToolTip in Windows viel Arbeit abnehem könnte
@all
Das mit dem Positionieren, sollte laut PSDK möglich sein:
uFlags
Flags that control the ToolTip display. This member can be a combination of the following values:
TTF_ABSOLUTE
Version 4.70. Positions the ToolTip window at the same coordinates provided by TTM_TRACKPOSITION. This flag must be used with the TTF_TRACK flag.
TTF_CENTERTIP
Centers the ToolTip window below the tool specified by the uId member.
TTF_IDISHWND
Indicates that the uId member is the window handle to the tool. If this flag is not set, uId is the tool's identifier.
TTF_PARSELINKS
Version 6.00. Indicates that links in the tooltip text should be parsed.
Note that Comctl32.dll version 6 is not redistributable but it is included in Microsoft® Windows® XP or later. To use Comctl32.dll version 6, specify it in a manifest. For more information on manifests, see Using Windows XP Visual Styles.
TTF_RTLREADING
Indicates that the ToolTip text will be displayed in the opposite direction to the text in the parent window.
TTF_SUBCLASS
Indicates that the ToolTip control should subclass the tool's window to intercept messages, such as WM_MOUSEMOVE. If this flag is not set, you must use the TTM_RELAYEVENT message to forward messages to the ToolTip control. For a list of messages that a ToolTip control processes, see TTM_RELAYEVENT.
TTF_TRACK
Version 4.70. Positions the ToolTip window next to the tool to which it corresponds and moves the window according to coordinates supplied by the TTM_TRACKPOSITION messages. You must activate this type of tool using the TTM_TRACKACTIVATE message.
TTF_TRANSPARENT
Version 4.70. Causes the ToolTip control to forward mouse event messages to the parent window. This is limited to mouse events that occur within the bounds of the ToolTip window.
Wie oben geschrieben, soll mann mit "TTM_TRACKPOSITION", die Position angeben können wenn bei uFlags TTF_TRACK & TTF_ABSOLUTE eingetragen sind, habe ich versucht, bekomme aber immer die Fehlermeldung dass, die Konstante #TTF_TRACK & #TTF_ABSOLUTE nicht gefunden wurden!
MFG Lukaso
Verfasst: 13.09.2004 16:16
von ChaOsKid
das mit #TTM_TRACKPOSITION hab ich auch ausprobiert
allerdings wollte das nicht so wie ich....
wenn ich
Code: Alles auswählen
SendMessage_(ToolTip, #TTM_TRACKPOSITION, 0, WindowMouseX()<<16 + WindowMouseY())
nach dem repeat einfüge, dann folgt der tooltip dem mauscursor
aber nur im fenster.....
hier hab ich noch ein paar konstanten gefunden:
Code: Alles auswählen
;Tooltip Window Constants
#TTS_NOPREFIX = $2
#TTF_TRANSPARENT = $100
#TTF_CENTERTIP = $2
#TTM_ADDTOOLA = (#WM_USER + 4)
#TTM_ACTIVATE = #WM_USER + 1
#TTM_UPDATETIPTEXTA = (#WM_USER + 12)
#TTM_SETMAXTIPWIDTH = (#WM_USER + 24)
#TTM_SETTIPBKCOLOR = (#WM_USER + 19)
#TTM_SETTIPTEXTCOLOR = (#WM_USER + 20)
#TTM_SETTITLE = (#WM_USER + 32)
#TTS_BALLOON = $40
#TTS_ALWAYSTIP = $1
#TTF_ABSOLUTE = $80
#TTF_SUBCLASS = $10
#TTF_TRACK = $20
#TTF_IDISHWND = $1
#TTDT_AUTOPOP = 2
#TTDT_INITIAL = 3
#TTM_SETDELAYTIME = (#WM_USER + 3)
#TTM_TRACKACTIVATE = #WM_USER + 17
#TTM_TRACKPOSITION = #WM_USER + 18
#WS_POPUP = $80000000