Jump to content
Sign in to follow this  
jennico

help with balloon tip and close button

Recommended Posts

jennico

please can anyone point me the way to make a balloon tooltip with a close button ( that closes the tooltip when pressed ) ?

i could not find any working example for GUITolltip.au3 and rasim's UDF is not the right thing either.

thanks.

j.


Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites
jennico

bump. nobody knows ???


Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites
martin

bump. nobody knows ???

No, but if you add the style $TTS_CLOSE to the tooltip in rasim's udf, in the function _ToolTip_Create, you will get the close button.

BitOR($WS_POPUP, $TTS_ALWAYSTIP,$TTS_CLOSE)

which is a step closer maybe.

Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
rover

please can anyone point me the way to make a balloon tooltip with a close button ( that closes the tooltip when pressed ) ?

i could not find any working example for GUITolltip.au3 and rasim's UDF is not the right thing either.

thanks.

j.

Jennico

if you only need the single AutoIt ToolTip() and not the multiple tooltip tools of the UDF then

you can get a handle to a native AutoIt Tooltip() and use the tooltip UDF functions

below example adds close button, colour and custom icon to ToolTip()

NOTE: closing a Tooltip() does not destroy it,

the tooltip is Deactivated and hidden until Reactivated

or destroyed with _GUIToolTip_Destroy($hToolTip)

create the ToolTip() on first usage, get its handle and then re-use it

with the udf functions to hide/show,change text,colour,icon and destroy tooltip

if ToolTip() is called a second time then the previous handle is invalid and will crash udf tooltip functions.

Note: not documented in the help file for ToolTip(), but is for _GUIToolTip_SetTitle()

As of Windows XP SP2, tooltips support user icons

You can use an icon handle with option 5 of ToolTip()

Related link

change tooltip balloon orientation - Author: wraithdu

Create a ToolTip at any location, similar to AutoIt's ToolTip() function

http://www.autoitscript.com/forum/index.php?showtopic=86112

MSDN: Using ToolTip Controls

http://msdn.microsoft.com/en-us/library/bb760252.aspx

#include <GuiToolTip.au3>
#include <WinAPI.au3>
;#include <Constants.au3>
;#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Global Const $GWL_STYLE = 0xFFFFFFF0
Global Const $COLOR_INFOTEXT = 23
Global Const $COLOR_INFOBK = 24

Global $iIconID = 43
If @OSVersion == "WIN_VISTA" Then $iIconID = 51
Global $hIcon = _WinAPI_LoadShell32Icon($iIconID)

Global $iColTT_BK_BGR = _WinAPI_GetSysColor($COLOR_INFOBK)
Global $iColTT_Text_BGR = _WinAPI_GetSysColor($COLOR_INFOTEXT)

ToolTip("Native AutoIt Tooltip", @DesktopWidth / 2, @DesktopHeight / 2, "AutoIt ToolTip /w Custom Icon & Close Button", $hIcon, 1)
;_WinAPI_DestroyIcon($hIcon)
;destroy icon handle if not required for updating tooltip title
Local $hToolTip = WinGetHandle("[TITLE:Native AutoIt Tooltip; CLASS:tooltips_class32]", "") ; Text is Title for a tooltip
_WinAPI_SetWindowLong($hToolTip, $GWL_STYLE, BitOR(_WinAPI_GetWindowLong($hToolTip, $GWL_STYLE), $TTS_CLOSE))
_GUIToolTip_SetTipTextColor($hToolTip, 0xFFFFFF)
_GUIToolTip_SetTipBkColor($hToolTip, 0x985428)
_GUIToolTip_Update($hToolTip)

; Deactivate ToolTip
Sleep(3000)
_GUIToolTip_TrackActivate($hToolTip, False, 0, 0)
Sleep(2000)

; Reactivate ToolTip and optionally move to new position with _GUIToolTip_TrackPosition
_GUIToolTip_TrackActivate($hToolTip, True, 0, 0)
_GUIToolTip_TrackPosition($hToolTip, @DesktopWidth / 4, @DesktopHeight / 4)

;Icon must be updated with title or the icon is removed
;_GUIToolTip_GetTitleText() ;does not return title
_GUIToolTip_SetTitle($hToolTip, "AutoIt ToolTip/w Same Custom Icon & Close Button", $hIcon)
;update required if only title changed and UpdateTipText/SetTipTextColor/SetTipBkColor not run after
;_GUIToolTip_Update($hToolTip)

_GUIToolTip_UpdateTipText($hToolTip, 0, 0, _GUIToolTip_GetText($hToolTip, 0, 0) & " now with 50% more text")

_GUIToolTip_SetTipTextColor($hToolTip, 0x00D7FF) ;0x985428
_GUIToolTip_SetTipBkColor($hToolTip, -1) ;0xFFD700
Sleep(2000)
_GUIToolTip_SetTipTextColor($hToolTip, 0x985428)
_GUIToolTip_SetTipBkColor($hToolTip, 0xFFD700)
Sleep(2000)
_GUIToolTip_SetTipTextColor($hToolTip, $iColTT_Text_BGR)
_GUIToolTip_SetTipBkColor($hToolTip, $iColTT_BK_BGR)
Sleep(2000)

;tooltip is hidden, not closed on click
If _GUIToolTip_ToolExists($hToolTip) Then _GUIToolTip_Destroy($hToolTip)
_WinAPI_DestroyIcon($hIcon)

I see fascists...

Share this post


Link to post
Share on other sites
jennico

hi martin,

No, but if you add the style $TTS_CLOSE to the tooltip in rasim's udf, in the function _ToolTip_Create, you will get the close button.

i tried that, it shows the button, but the tooltip does not close when you click it. i guess, some kind of registermsg function would be necessary to do so.

thx anyway

@rover:

Jennico

if you only need the single AutoIt ToolTip() and not the multiple tooltip tools of the UDF then

you can get a handle to a native AutoIt Tooltip() and use the tooltip UDF functions

below example adds close button, colour and custom icon to ToolTip()

yes sir, that's exactly what i need !

thank you ! i remember i have read this thread before, but could not find it anymore.

very nice !

j. :D

Edited by jennico

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites
jennico

very interesting example.

the border color obviously changes with the text color.

i couldn't figure out how to use _GUIToolTip before.

j.


Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.