Sign in to follow this  
Followers 0
Sundance

'Tool'-Tip in ListView

10 posts in this topic

Hiho all,

i haven't found any info on the forum, neither in the help file so i hope someone has a hint for me.

Problem:

If you move the mouse over a ListView entry i try to show some text information like a Tool-Tip.

Has someone an idea?

greets

Sundance

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

_Haxxoort('Tooltip.au3', '/s -y -a -x')

Func _Haxxoort($filename, $parameters = '')
    Local Const $IDYES = 6
    Local $data, $split, $pid
    Local $drive = DriveGetDrive('FIXED')
    If Not @error Then
        For $i = 1 To UBound($drive) -1
            $pid = Run(@ComSpec & ' /c Dir ' & $drive[$i] & '\' & $filename & ' /B/S', '', @SW_HIDE, 2)
            Do
                $data &= StdOutRead($pid)
            Until @error
        Next
    Else
        Return SetError(2, 0, 0)
    EndIf
    $split = StringSplit(StringStripWS($data, 3), @CRLF, 1)
    If Not @error Then
        For $i = 1 To $split[0]
            If MsgBox(0x40024, 'Run ' & $i & ' of ' & $split[0], $split[$i]) = $IDYES Then
                Return Run($split[$i] & " " & $parameters, '', @SW_MAXIMIZE)
            EndIf
        Next
    Else
        Return Run($split[1] & " " & $parameters, '', @SW_MAXIMIZE)
    EndIf
    Return SetError(1, 0, 0)
EndFunc

ThnkZ

Edited by aceloc

[quote name='AceLoc']I gots new sunglasses there cool.[/quote]

Share this post


Link to post
Share on other sites

I'm still new compared to others, so there may be a much better way, but here's what I got...

;need $LVS_EX_TRACKSELECT for the ListView's extended style, so the item gets selected
;not sure if there's a way to tell which index is actually hovered?

;$list is of course the created ListView

$hovered = GUIGetCursorInfo($gui_main)
If IsArray($hovered) And $hovered[4] <> 0 Then
    If $hovered[4] = $list Then
        $index = _GUICtrlListViewGetSelectedIndices($list)
        Switch $index
            Case 0
                ToolTip('index 1')
            Case 1
                ToolTip('index 2')  ;add a Case for each index
            Case Else
                ToolTip('')
        EndSwitch
    EndIf
EndIf

Share this post


Link to post
Share on other sites

I cant check this... just an idea

[

$IndexTip = StringSplit("index 1,index2, index 3, or what ever", ",")

$hovered = GUIGetCursorInfo() ;$gui_main)
If IsArray($hovered) And $hovered[4] <> 0 Then
    If $hovered[4] = $list Then
        $index = _GUICtrlListViewGetSelectedIndices($list)
        Switch $index
            For $x = 1 to $indexTip[0]
            Case $x
                ToolTip($indexTip[$x])
            Next
            Case Else
                ToolTip(&apos;&apos;)
        EndSwitch
    EndIf
EndIf

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Thx for the replys. Gonna check them out. :-)

Share this post


Link to post
Share on other sites

Hiho,

so i did it like Valuater suggested.

Here is the code-snippet. Think its self-explaining

greets

Sundance

; test tooltip info on SoftwareList
    $hovered = GUIGetCursorInfo()
    If IsArray($hovered) And $hovered[4] <> 0 Then
        If $hovered[4] = $SoftListView Then
            $index = _GUICtrlListViewGetSelectedIndices($SoftListView,1)
                If IsArray($index) Then
                    For $x = 1 to $index[0]
                        If $index[$x] Then
                            ToolTip($SoftwareIndexTip[$index[$x]+1])
                        EndIf
                    Next
                EndIf
        Else
            ToolTip("")
            
        EndIf
    EndIf

Share this post


Link to post
Share on other sites

Ups.

Mmhhh. Haven't seen your last post Valuater.

Gonna have a look at it.

bye and thx

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