Hover-Funktion in Liste

  • Moin community, könnt ihr mir vielleicht sagen wie ich in List1 eine Hover Funktion rein machen kann, wenn ich mit der Maus über die Links/Einträge gehe

    Hab es bis jetzt nur in Lables hingekriegt, weiß aber nicht wie es bei Listen geht

    Vielleicht weiß einer wie man das in Listen bewerkstelligen kann, danke schon mal im voraus

    mfg Mainstream

    Hier das Script

    Spoiler anzeigen
    [autoit]

    Global $a_Inhalt[9][4] = [ _
    ["Google", "Inhalt #1", "List3 #1", "www.google.de"], _
    ["Youtube", "Inhalt #2", "List3 #2", "www.youtube.com"], _
    [3, "Inhalt #3", "List3 #3"], _
    [4, "Inhalt #4", "List3 #4"], _
    [5, "Inhalt #5", "List3 #5"], _
    [6, "Inhalt #6", "List3 #6"], _
    [7, "Inhalt #7", "List3 #7"], _
    [8, "Inhalt #8", "List3 #8"], _
    [9, "Inhalt #9", "List3 #9"]]

    [/autoit] [autoit][/autoit] [autoit]

    $h_Gui = GUICreate ("", 650, 250)
    $h_List1 = GUICtrlCreateList ("", 10, 10, 160, 160)
    $h_List2 = GUICtrlCreateList ("", 180, 10, 160, 160)
    $h_List3 = GUICtrlCreateList ("", 350, 10, 160, 160)

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To UBound ($a_Inhalt) - 1
    GUICtrlSetData ($h_List1, $a_Inhalt[$i][0])
    Next

    [/autoit] [autoit][/autoit] [autoit]

    $h_Go = GUICtrlCreateButton("Go", 10, 200, 50, 26)

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState (@SW_SHOW, $h_Gui)

    [/autoit] [autoit][/autoit] [autoit]

    While True
    Switch GUIGetMsg ()
    Case -3
    Exit
    Case $h_List1
    $s_Read = GUICtrlRead ($h_List1)
    For $i = 0 To UBound ($a_Inhalt) - 1
    If $s_Read = $a_Inhalt[$i][0] Then
    GUICtrlSetData ($h_List2, "")
    GUICtrlSetData ($h_List2, $a_Inhalt[$i][1])
    GUICtrlSetData ($h_List3, "")
    GUICtrlSetData ($h_List3, $a_Inhalt[$i][2])
    ExitLoop
    EndIf
    Next
    Case $h_Go
    $s_Read = GUICtrlRead ($h_List1)
    For $i = 0 To UBound ($a_Inhalt) - 1
    If $s_Read = $a_Inhalt[$i][0] Then ExitLoop ShellExecute ($a_Inhalt[$i][3])
    Next
    EndSwitch
    WEnd

    [/autoit]

    Einmal editiert, zuletzt von Mainstream (6. Juni 2012 um 22:04)

  • Wie soll das denn dann aussehen?

    Edit: So in etwa? Wenns nicht passt musst du die beiden 12 verändern oder ganz wegnehmen.

    Spoiler anzeigen
    [autoit]

    #include <GuiListBox.au3>

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Opt("MouseCoordMode", 2)

    [/autoit] [autoit][/autoit] [autoit]

    Global $iIndexLast
    Global $a_Inhalt[9][4] = [ _
    ["Google", "Inhalt #1", "List3 #1", "www.google.de"], _
    ["Youtube", "Inhalt #2", "List3 #2", "www.youtube.com"], _
    [3, "Inhalt #3", "List3 #3"], _
    [4, "Inhalt #4", "List3 #4"], _
    [5, "Inhalt #5", "List3 #5"], _
    [6, "Inhalt #6", "List3 #6"], _
    [7, "Inhalt #7", "List3 #7"], _
    [8, "Inhalt #8", "List3 #8"], _
    [9, "Inhalt #9", "List3 #9"]]

    [/autoit] [autoit][/autoit] [autoit]

    $h_Gui = GUICreate("", 650, 250)
    $h_List1 = GUICtrlCreateList("", 10, 10, 160, 160)
    $h_List2 = GUICtrlCreateList("", 180, 10, 160, 160)
    $h_List3 = GUICtrlCreateList("", 350, 10, 160, 160)

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To UBound($a_Inhalt) - 1
    GUICtrlSetData($h_List1, $a_Inhalt[$i][0])
    Next

    [/autoit] [autoit][/autoit] [autoit]

    $h_Go = GUICtrlCreateButton("Go", 10, 200, 50, 26)

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW, $h_Gui)

    [/autoit] [autoit][/autoit] [autoit]

    While True
    $iIndex = _GUICtrlListBox_ItemFromPoint($h_List1, MouseGetPos(0) - 12, MouseGetPos(1) - 12)
    If $iIndexLast <> $iIndex Then
    $iIndexLast = $iIndex
    _GUICtrlListBox_SetCurSel($h_List1, $iIndex)
    EndIf

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Switch GUIGetMsg()
    Case -3
    Exit
    Case $h_List1
    $s_Read = GUICtrlRead($h_List1)
    For $i = 0 To UBound($a_Inhalt) - 1
    If $s_Read = $a_Inhalt[$i][0] Then
    GUICtrlSetData($h_List2, "")
    GUICtrlSetData($h_List2, $a_Inhalt[$i][1])
    GUICtrlSetData($h_List3, "")
    GUICtrlSetData($h_List3, $a_Inhalt[$i][2])
    ExitLoop
    EndIf
    Next
    Case $h_Go
    $s_Read = GUICtrlRead($h_List1)
    For $i = 0 To UBound($a_Inhalt) - 1
    If $s_Read = $a_Inhalt[$i][0] Then ExitLoop ShellExecute($a_Inhalt[$i][3])
    Next
    EndSwitch
    WEnd

    [/autoit]

    Einmal editiert, zuletzt von m-obi (6. Juni 2012 um 14:12)

  • Ja mit dem Hover geht es jetzt, aber wenn ich zum beispiel auf Google und dann auf dem "Go" Button klicke werde ich nicht mehr zu Google weitergeleitet... was aber vohrher noch ging

    Man sieht leider auch nicht mehr das man auf ein Link/Eintrag geklickt hat, wird nicht mehr Farblich gekennzeichnet/hervorgehoben wie es im Script vorher war... wenn man mit der Maus auf ein Eintrag geklickt hat

  • So?

    Spoiler anzeigen
    [autoit]

    #include <GuiListBox.au3>
    #include <GUIConstantsEx.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt("MouseCoordMode", 2)

    [/autoit] [autoit][/autoit] [autoit]

    Global $iIndexLast, $aGGCI, $xClicked
    Global $a_Inhalt[9][4] = [["Google", "Inhalt #1", "List3 #1", "www.google.de"], _
    ["Youtube", "Inhalt #2", "List3 #2", "www.youtube.com"], _
    [3, "Inhalt #3", "List3 #3"], _
    [4, "Inhalt #4", "List3 #4"], _
    [5, "Inhalt #5", "List3 #5"], _
    [6, "Inhalt #6", "List3 #6"], _
    [7, "Inhalt #7", "List3 #7"], _
    [8, "Inhalt #8", "List3 #8"], _
    [9, "Inhalt #9", "List3 #9"]]

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $h_Gui = GUICreate("", 650, 250)
    $h_List1 = GUICtrlCreateList("", 10, 10, 160, 160)
    $h_List2 = GUICtrlCreateList("", 180, 10, 160, 160)
    $h_List3 = GUICtrlCreateList("", 350, 10, 160, 160)
    For $i = 0 To UBound($a_Inhalt) - 1
    GUICtrlSetData($h_List1, $a_Inhalt[$i][0])
    Next
    $h_Go = GUICtrlCreateButton("Go", 10, 200, 50, 26)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While True
    $aGGCI = GUIGetCursorInfo()
    If $aGGCI[4] = $h_List1 And Not $xClicked And $aGGCI[2] Then $xClicked = True

    [/autoit] [autoit][/autoit] [autoit]

    $iIndex = _GUICtrlListBox_ItemFromPoint($h_List1, MouseGetPos(0) - 12, MouseGetPos(1) - 12)
    If $iIndexLast <> $iIndex And Not $xClicked Then
    $iIndexLast = $iIndex
    _GUICtrlListBox_SetCurSel($h_List1, $iIndex)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If $iIndex = -1 And $xClicked Then $iIndexLast = -1

    [/autoit] [autoit][/autoit] [autoit]

    If $iIndexLast = -1 And $iIndex <> -1 And $xClicked Then $xClicked = False

    [/autoit] [autoit][/autoit] [autoit]

    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    Exit
    Case $h_List1
    $s_Read = GUICtrlRead($h_List1)
    For $i = 0 To UBound($a_Inhalt) - 1
    If $s_Read = $a_Inhalt[$i][0] Then
    GUICtrlSetData($h_List2, "")
    GUICtrlSetData($h_List2, $a_Inhalt[$i][1])
    GUICtrlSetData($h_List3, "")
    GUICtrlSetData($h_List3, $a_Inhalt[$i][2])
    ExitLoop
    EndIf
    Next
    Case $h_Go
    $s_Read = GUICtrlRead($h_List1)
    For $i = 0 To UBound($a_Inhalt) - 1
    If $s_Read = $a_Inhalt[$i][0] Then ExitLoop ShellExecute($a_Inhalt[$i][3])
    Next
    EndSwitch
    WEnd

    [/autoit]
  • @m-obi, ich habe die letzten Stunden auch versucht es hinzukriegen... aber ohne erfolg, mit mein Anfänger-Kenntnissen hätte ich bestimmt noch ewig gebraucht ne lösung zu finden, prima hab großen dank du hast mir sehr damit geholfen

    mfg Mainstream