DropDown mit grossen Bildern

  • Hallo zusammen

    Ich möchte für ein Projekt ein DropDown Menü erstellen, in welchem ich Bilder (und Text) habe und auswählen kann.
    Das geht evtl. irgendwie mit der _GUICtrlComboBoxEx, aber da hatte ich bisher kein Glück, bzw. nur mit Bildgrössen bis 64x64. (Leider habe ich den Quellcode zu meiner Schande schon wieder gelöscht)

    Ich möchte nämlich wirklich richtig grosse Bilder da rein packen. Die Bilder sind später im JPG Format vorhanden. Die Bilder im DropDown sollen so ca. 1280x1280 Pixel gross sein.
    (Der "Monitor" besteht aus einer 6x4 Matrix mit jeweils 80" Cubes; Also eine Art Grossbild Videoleinwand)

    Also so etwas wie das hier, nur grösser: autoit.de/wcf/attachment/15693/!
    Danke für Eure Ideen.
    Veronesi

  • Ich denke, es ist das einfachste, wenn ich einfach eine zweite GUI mache.
    Den folgenden Code habe ich hauptsächlich aus der Hilfe zusammen kopiert.
    Somit sollte es funktionieren.

    Spoiler anzeigen
    [autoit]

    #include <WindowsConstants.au3>
    #Include <GuiScrollBars.au3>
    #include <ScrollBarConstants.au3>
    #include <GUIConstantsEx.au3>

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

    Opt("GUIOnEventMode", 1)
    HotKeySet("{ESC}", "_Exit")

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

    Global $hGUISelect = GUICreate("Choose one Addon", 800, 600, -1, -1)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    GUICtrlCreatePic("1.jpg", 10, 10, 400, 400)
    GUICtrlCreatePic("2.jpg", 10, 420, 400, 400)
    GUICtrlCreatePic("3.jpg", 10, 830, 400, 400)
    GUISetState(@SW_SHOW, $hGUISelect)
    _GUIScrollBars_Init($hGUISelect, -1, 77)
    GUIRegisterMsg($WM_VSCROLL, "WM_VSCROLL")

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

    While True
    Sleep(5000)
    WEnd

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

    Func WM_VSCROLL($hWnd, $Msg, $wParam, $lParam)
    #forceref $Msg, $wParam, $lParam
    Local $nScrollCode = BitAND($wParam, 0x0000FFFF)
    Local $index = -1, $yChar, $yPos
    Local $Min, $Max, $Page, $Pos, $TrackPos

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

    For $x = 0 To UBound($aSB_WindowInfo) - 1
    If $aSB_WindowInfo[$x][0] = $hWnd Then
    $index = $x
    $yChar = $aSB_WindowInfo[$index][3]
    ExitLoop
    EndIf
    Next
    If $index = -1 Then Return 0

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

    ; Get all the vertial scroll bar information
    Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_VERT)
    $Min = DllStructGetData($tSCROLLINFO, "nMin")
    $Max = DllStructGetData($tSCROLLINFO, "nMax")
    $Page = DllStructGetData($tSCROLLINFO, "nPage")
    ; Save the position for comparison later on
    $yPos = DllStructGetData($tSCROLLINFO, "nPos")
    $Pos = $yPos
    $TrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos")

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

    Switch $nScrollCode
    Case $SB_TOP ; user clicked the HOME keyboard key
    DllStructSetData($tSCROLLINFO, "nPos", $Min)

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

    Case $SB_BOTTOM ; user clicked the END keyboard key
    DllStructSetData($tSCROLLINFO, "nPos", $Max)

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

    Case $SB_LINEUP ; user clicked the top arrow
    DllStructSetData($tSCROLLINFO, "nPos", $Pos - 1)

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

    Case $SB_LINEDOWN ; user clicked the bottom arrow
    DllStructSetData($tSCROLLINFO, "nPos", $Pos + 1)

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

    Case $SB_PAGEUP ; user clicked the scroll bar shaft above the scroll box
    DllStructSetData($tSCROLLINFO, "nPos", $Pos - $Page)

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

    Case $SB_PAGEDOWN ; user clicked the scroll bar shaft below the scroll box
    DllStructSetData($tSCROLLINFO, "nPos", $Pos + $Page)

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

    Case $SB_THUMBTRACK ; user dragged the scroll box
    DllStructSetData($tSCROLLINFO, "nPos", $TrackPos)
    EndSwitch

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

    ;~ // Set the position and then retrieve it. Due to adjustments
    ;~ // by Windows it may not be the same as the value set.

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

    DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS)
    _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO)
    _GUIScrollBars_GetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO)
    ;// If the position has changed, scroll the window and update it
    $Pos = DllStructGetData($tSCROLLINFO, "nPos")

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

    If ($Pos <> $yPos) Then
    _GUIScrollBars_ScrollWindow($hWnd, 0, $yChar * ($yPos - $Pos))
    $yPos = $Pos
    EndIf

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

    Return $GUI_RUNDEFMSG
    EndFunc ;==>WM_VSCROLL

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

    Func _Exit()
    Exit
    EndFunc

    [/autoit]

    Schade, dass das GUI nicht einfach mit dem Style $WS_VSCROLL funktioniert. Die ganze Funktion WM_VSCROLL ist doch sehr kompliziert!
    Gruss Veronesi