progress als slider

  • Ich hab mal ein progress gesehen , der wie ein slider funktioniert hat, man hat auf ne bestimmte stelle geklickt und er ist dahingesprungen...
    Wie kann man sowas machen?
    Ich hab mir den kopf schon rauchig gedacht, mousegetpos ist zu umständlich...

    Jura

    Einmal editiert, zuletzt von JuraX (18. April 2010 um 09:04)

    • Offizieller Beitrag

    Oder das hier als Beispiel:

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    $hGui = GUICreate('Test', 400, 300)
    GUISetBkColor(0xCCCCCC)
    DllCall('uxtheme.dll', 'none', 'SetThemeAppProperties', 'int', 0)
    $hProgress = GUICtrlCreateProgress(10, 30, 350, 20)
    DllCall('uxtheme.dll', 'none', 'SetThemeAppProperties', 'int', 7)
    $hLabel = GUICtrlCreateLabel('0%', 365, 32, 35, 20)
    GUISetState()
    $aPos = ControlGetPos($hGui, '', $hProgress)

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

    While True
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    Exit
    Case $GUI_EVENT_PRIMARYUP
    $aInfo = GUIGetCursorInfo($hGui)
    If $aInfo[4] = $hProgress Then
    $iPercent = 100 / $aPos[2] * ($aInfo[0] - $aPos[0])
    GUICtrlSetData($hProgress, $iPercent)
    GUICtrlSetData($hLabel, Int($iPercent) & '%')
    EndIf
    EndSwitch
    WEnd

    [/autoit]