Eingedrückte Buttons?

  • Hallo liebe AutoIt-Community!

    Ich habe folgende Frage:
    Ist es möglich Buttons so zu erzeugen, dass sie bei einem Klick "eingedrückt" werden und nur wieder "normal" werden, wenn ein anderer Button aus der Gruppe ausgewählt wird? (ungefähr wie Radioboxen).

    Ich hab mir die Stile von Buttons angeschaut, aber nichts brauchbares gefunden...

    Gibt es eine UDF oder so ähnlich dazu?

    Einmal editiert, zuletzt von MatthiasG. (2. März 2009 um 16:21)

  • Hi,
    ein Beispiel:

    Spoiler anzeigen
    [autoit]


    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

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

    $Form1_1 = GUICreate("Big Checkbox", 210, 180, 300, 233)
    ;i normale Checkbox
    $Checkbox0 = GUICtrlCreateCheckbox("Checkbox basic", 30, 10, 150, 35)
    ;i Checkbox color
    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
    $Checkbox1 = GUICtrlCreateCheckbox("Checkbox color", 30, 50, 150, 35)
    GUICtrlSetColor(-1, 0xFF0000) ;i rot
    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 7)
    ;i grosse Checkbox Schriftart und Grösse anders
    $Checkbox2 = GUICtrlCreateCheckbox("Grosse Checkbox", 30, 90, 150, 35, BitOR($BS_CHECKBOX,$BS_AUTOCHECKBOX,$BS_PUSHLIKE,$WS_TABSTOP))
    GUICtrlSetFont(-1, 12, 400, 0, "Wingdings")
    ;i grosse Checkbox mit Icon
    $Checkbox3 = GUICtrlCreateCheckbox("&s", 30, 130, 150, 35, BitOR($BS_ICON, $BS_PUSHLIKE))
    GUICtrlSetImage(-1, "shell32.dll", 7)

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

    GUISetState(@SW_SHOW)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    EndSwitch
    WEnd

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

    ;i ENDE

    [/autoit]


    Viel Erfolg ! :)

  • $BS_PUSHLIKE ist der Style für die Radioboxen:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <ButtonConstants.au3>

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

    Opt('MustDeclareVars', 1)

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

    Example()

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

    Func Example()
    Local $radio_1, $radio_2, $radio_3, $msg

    GUICreate("My GUI group") ; will create a dialog box that when displayed is centered

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

    GUICtrlCreateGroup("Group 1", 190, 60, 90, 200)
    $radio_1 = GUICtrlCreateRadio("Radio 1", 210, 90, 60, 30,$BS_PUSHLIKE)
    $radio_2 = GUICtrlCreateRadio("Radio 2", 210, 120, 60, 30,$BS_PUSHLIKE)
    $radio_2 = GUICtrlCreateRadio("Radio 3", 210, 150, 60, 30,$BS_PUSHLIKE)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    GUICtrlCreateButton("Normal", 10,10, 60, 30)

    GUISetState() ; will display an empty dialog box

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

    ; Run the GUI until the dialog is closed
    While 1
    $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    EndFunc ;==>Example

    [/autoit]
  • Danke! Das ist so ungefähr das, was ich gesucht habe :thumbup:
    Edit: Danke Progandy, das ist genau das, was ich gescuht habe! :D