Sign in to follow this  
Followers 0
Ibrahim

ToolTip () Problem

7 posts in this topic




I wouldn't quote me on this, but I'm fairly certain it is not possible (or perhaps just not easy) to do so. I seem to recall looking into that in the past.


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

can i use fonts and colors in the tooltip function

Its not possible to do so from within AutoIt.. I am not aware of any way to do it even otherwise... And I've never seen any application do it.

Unless the tooltips are javascript generated within web pages...

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

can i use fonts and colors in the tooltip function

Manually - Display properties, Appearance,Advanced, Tooltip.

This will change the font and colour of tooltips including tray tooltips.

It must be possible to do in Autoit, and it is possible in some other languages, but I would make another gui with the style $WS_POPUP and add labels in the font you want.

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

#6 ·  Posted (edited)

thank u guys can u post a sample script of the $WS_POPUP style gui

If you move the mouse cursor over the button the tooltip will appear. After 5 seconds it will disappear unless you click on the first line of the 'tooltip'.

#include <guiconstants.au3>
$main = GUICreate("Wtooltip")
$but1 = GUICtrlCreateButton("exit", 20, 20, 120, 20)
$but2 = GUICtrlCreateButton("nothing",20,60,120,20)
GUISetState()
#region set tooltip bits
$butpos = ControlGetPos("Wtooltip", "", $but1)
$windowpos = WinGetPos("Wtooltip")
$c = WinGetClientSize("Wtooltip")
$border = ($windowpos[2] - $c[0]) / 2;window border width
$Titleht = $windowpos[3] - $c[1] - $border;window title height
Global $xoffset = $butpos[0] + $butpos[2] / 2 + $border;centre of button from edge of window
Global $yoffset = +$butpos[1] + $butpos[3] / 2 + $Titleht;from top of window
Global $td = 0;timer
Global $visibleTime = 3000;8 seconds
#endregion set tooltip bits

While 1
   $msg = GUIGetMsg()
   If $msg = $GUI_EVENT_CLOSE Then ExitLoop
   
   $gid = GUIGetCursorInfo($main)
    $wp = WinGetPos("Wtooltip")
   switch $gid[4]
    case $but1
        ibtip($wp[0] + $xoffset, $wp[1] + $yoffset)
    case $but2
        ToolTip("over the button 2",$wp[0]+$xoffset,$wp[1] + $yoffset + 40,"title",1,1)
    case Else
        Tooltip("")
    EndSwitch
    
WEnd


Func ibtip($ix, $iy)
   $g1 = GUICreate("nnn", 200, 100, $ix, $iy, $ws_popup)
   GUISetBkColor(0xffffdd, $g1)
   GUISetFont(20, 400, 0, "Ariel", $g1)
   $ll = GUICtrlCreateLabel("First line", 10, 10, 160, 35)
   GUICtrlSetColor(-1, 0xff0000)
   GUICtrlCreateLabel("Second line", 10, 40, 160, 35)
   GUICtrlSetFont(-1,18,600,0,"Times New Roman")
   GUISetState()
   $t1 = TimerInit()
   While TimerDiff($t1) < $visibleTime
      
      If GUIGetMsg() = $ll Then
         MsgBox(0, 'you clicked on', "first line")
         ExitLoop
      EndIf
      
   WEnd
   GUIDelete($g1)
   Return
EndFunc   ;==>ibtip
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

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  
Followers 0