1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. SEuBo

Beiträge von SEuBo

  • Controls in _GUICtrlTab_InsertItem einfügen

    • SEuBo
    • 25. Februar 2010 um 17:24

    Hatten wir vor ein paar tagen:
    https://autoit.de/index.php?page…0100#post140100

    Bau dir einfach eine eigene Funktion like:

    [autoit]

    Func _InsertTab(ByRef $hTabParent, $iIndex, $sName)
    _GUICtrlTab_InsertItem($hTabParent, $iIndex, $sName)
    _GUICtrlTab_SetCurFocus($hTabParent, -1) ; Auswahl aufheben
    _GUICtrlTab_SetCurFocus($hTabParent, $iIndex) ; 1 Tab wählen
    EndFunc ;==>_InsertTab

    [/autoit]
  • Array dimensionieren

    • SEuBo
    • 25. Februar 2010 um 14:24

    Im Prinzip ist das möglich. Du solltest aber abfangen, ob _FileCountLines dir nicht -1 zurück gibt. Daher kommt der Fehler nämlich.
    Lieber _FileCountLines in einer Variable zwischenspeichern, und dann erstmal auf einen Fehler überprüfen, bevor du den Array dimensionierst.

  • Buttonform ändern?

    • SEuBo
    • 25. Februar 2010 um 13:19

    Man muss auch wissen wie man die Sufu benutzt. Wenn ich mich ein einem Thread aufhalte und etwas suche, wird nur der Thread gesucht.
    Wenn ich ein Forum betrachte, wird nur das Forum durchsucht usw.

  • Zeit

    • SEuBo
    • 25. Februar 2010 um 12:17

    So kannst du es auch machen:

    [autoit]

    MsgBox(0, "", _MilliSecondsToTime(757575728))
    Func _MilliSecondsToTime($iMS)
    Local $iRetD = 0, $iRetH = 0, $iRetM = 0, $iRetS = 0, $iRetMs
    $iRetD = Floor($iMS / 86400000)
    $iMS = Mod($iMS, 86400000)
    $iRetH = Floor($iMS / 3600000)
    $iMS = Mod($iMS, 3600000)
    $iRetM = Floor($iMS / 60000)
    $iMS = Mod($iMS, 60000)
    $iRetS = Floor($iMS / 1000)
    $iMS = Mod($iMS, 1000)
    $iRetMs = StringLeft(StringFormat("%.2d", $iMS), 2)
    Return StringFormat("%.2d:%.2d:%.2d:%.2d:%.2d", $iRetD, $iRetH, $iRetM, $iRetS, $iRetMs)
    EndFunc ;==>_MilliSecondsToTime

    [/autoit]
  • Datumsausgabe

    • SEuBo
    • 25. Februar 2010 um 10:55

    Mir war langweilig, da hab ich ein paar alte Funktionen von mir zusammenkopiert:

    Spoiler anzeigen
    [autoit]

    #include <Date.au3>
    #include <GUIConstantsEx.au3>

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

    $hGUI = GUICreate("Form1", 235, 95, 200, 140)
    $hDate = GUICtrlCreateDate("", 10, 10, 220, 25, BitOR(0x04, 0x00))
    $hVal = GUICtrlCreateInput("1", 10, 40, 40, 20)
    GUICtrlCreateUpdown(-1)
    $hUni = GUICtrlCreateCombo("Tage", 60, 40, 85, 20, 0x0003)
    GUICtrlSetData(-1, "Wochen|Monate|Jahre|Jahrzehnte")
    $hDir = GUICtrlCreateCombo("Vor", 150, 40, 75, 20, 0x0003)
    GUICtrlSetData(-1, "Zurück")
    $hGO = GUICtrlCreateButton("Berechnen", 30, 65, 160, 25)
    GUISetState(@SW_SHOW)

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

    ;~ D - Add number of days To the given date
    ;~ M - Add number of months To the given date
    ;~ Y - Add number of years To the given date
    ;~ w - Add number of Weeks To the given date

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $hGO
    $sDir = GUICtrlRead($hDir)
    $sVal = GUICtrlRead($hVal) * (0 + ($sDir = "Vor") - ($sDir = "Zurück"))
    Global $sUni
    Switch GUICtrlRead($hUni)
    Case "Tage"
    $sUni = "D"
    Case "Wochen"
    $sUni = "w"
    Case "Monate"
    $sUni = "M"
    Case "Jahrzehnte"
    $sVal *= 10
    ContinueCase
    Case "Jahre"
    $sUni = "Y"
    EndSwitch
    ;~ ConsoleWrite(GUICtrlRead($hUni) & @TAB & $sUni & @TAB & $sVal & @TAB & GUICtrlRead($hDate) & @CRLF)
    MsgBox(0, "", _Int2Long(_DateAdd($sUni, $sVal, _DELongFormat2Int(GUICtrlRead($hDate)))))

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

    EndSwitch
    WEnd

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

    Func _DELongFormat2Int($sDate)
    ;Gibt ein Datum im deutschen Longformat in internationalem Format wieder
    Local $aMonth[13] = ["-", "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"]
    $aSplit = StringSplit($sDate, ",")
    If $aSplit[0] <> 1 Then
    $aSplit = StringSplit(StringTrimLeft($aSplit[2], 1), " ")
    For $i = 1 To 12
    If StringInStr($aSplit[2], $aMonth[$i]) Then $aSplit[2] = StringReplace($aSplit[2], $aMonth[$i], $i)
    Next
    $aSplit[1] = StringTrimRight($aSplit[1], 1)
    Return StringFormat("%04i/%02i/%02i", $aSplit[3], $aSplit[2], $aSplit[1])
    EndIf
    EndFunc ;==>_DELongFormat2Int
    Func _Int2Long($sDate)
    $_HGUI = GUICreate("")
    $_hDATE = GUICtrlCreateDate("", 20, 20)
    GUICtrlSetData($_hDATE, $sDate)
    $ret = GUICtrlRead($_hDATE)
    GUIDelete($_HGUI)
    Return $ret
    EndFunc ;==>_Int2Long

    [/autoit]
  • [Beispiel] Slide GUI

    • SEuBo
    • 25. Februar 2010 um 10:26
    Zitat von UEZ

    Nette Idee, aber bei Multimonitoren funzt es nicht richtig!

    Gruß,
    UEZ

    Das ist schade. Ich kann mir schon denken warum:
    Es gibt doch einen Bug bezüglich @DesktopHeight bei Multi-Monitoren, oder?
    Ich meine mich an eine Funktion zu erinnern, die die Gesamtauflösung zurückgegeben hat. Finde sie aber nicht mehr :S

  • GUIGetMsg aktion bei unbekannt möglich?

    • SEuBo
    • 25. Februar 2010 um 10:06
    Zitat von chip

    Also im Grunde sind es zwei Werte, einmal einen Wert "place" in der steht auf welcher Gui (sind mehrere) sich der Button befinden

    [autoit]

    @GUI_WinHandle

    [/autoit]
    Zitat von chip

    und als zweites einen Wert "action" indem die auszuführende Aktion angegebn ist.


    Kannst du das nicht über einen Array lösen?
    2D array, in dem Format Ctrl-ID|Action.
    In der OnEvent Funktion arbeitest du einfach mit _ArraySearch und suchst nach der @GUI_CtrlID

  • txt datei in listbox anzeigen

    • SEuBo
    • 25. Februar 2010 um 09:31
    Zitat von stinger2k

    nur komme ich nicht weiter mit dem das in der listbox columns erstellt werden

    Ganz einfach: ListView statt ListBox benutzen!

    //EDIT:
    Probier mal das hier:

    Spoiler anzeigen
    [autoit]

    #include <GuiListView.au3>
    #include <File.au3>
    #include <GuiEdit.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Version=beta
    #AutoIt3Wrapper_Icon=C:\WinSetupFromUSB\files\5_1.ico
    #AutoIt3Wrapper_Outfile=n:\esco.exe
    #AutoIt3Wrapper_Compression=3
    #AutoIt3Wrapper_UseX64=n
    #AutoIt3Wrapper_Res_Comment=Diese Software ist urheberrechtlich geschützt
    #AutoIt3Wrapper_Res_Description=esco - Schubstangenkonfigurator
    #AutoIt3Wrapper_Res_Fileversion=0.1.0.0
    #AutoIt3Wrapper_Res_LegalCopyright=(c) PMind Software
    #AutoIt3Wrapper_Res_Language=3079
    #AutoIt3Wrapper_Res_File_Add=n:\ESCO_2.l
    #AutoIt3Wrapper_Run_Obfuscator=y
    #endregion ;**** Directives created by AutoIt3Wrapper_GUI ****

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

    ;~ AutoItSetOption("GUIDataSeparatorChar",@TAB)
    AutoItSetOption("TrayIconHide", 1)
    FileInstall("N:\ESCO_2.l", @ScriptDir)
    _FileCreate(@ScriptDir & "\list.esc")
    Global $T1rech, $T1_1rech, $T2rech, $T3rech, $T4rech, $T5rech, $T1, $T1_1, $T2, $T3, $T4, $T5
    Global $FB, $FH, $GH, $Checkbox1, $Pos, $file, $line

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

    #region ### START Koda GUI section ### Form=
    $x = @DesktopWidth / 2 - 366
    $y = @DesktopHeight / 6
    $Form1 = GUICreate("esco - Schubstangenkonfigurator v0.1 beta", 732, 389, $x, $y)
    GUISetBkColor(0xFFFFFF)
    $Pic1 = GUICtrlCreatePic("N:\ESCO_2.l", 39, 9, 121, 40, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
    $Text_Progname = GUICtrlCreateLabel("Schubstangenkonfigurator (Roto T540-10 DK)", 180, 18, 632, 30)
    GUICtrlSetFont(-1, 16, 800, 0, "MS Reference Sans Serif")
    GUICtrlSetColor(-1, 0x000080)
    $Text_Beschr = GUICtrlCreateLabel("Schubstangen-Berechnung", 39, 66, 134, 17)
    $Text_Beschr2 = GUICtrlCreateLabel("Bitte geben Sie folgende Maße (mm) ein:", 39, 81, 200, 17)
    $Text_FB = GUICtrlCreateLabel("Flügelbreite: (FB)", 39, 114, 89, 17)
    $Text_FH = GUICtrlCreateLabel("Flügelhöhe: (FH)", 39, 147, 89, 17)
    $Text_GH = GUICtrlCreateLabel("Griffhöhe: (GH)", 39, 180, 89, 17)
    $Text_Pos = GUICtrlCreateLabel("Pos. (optional)", 39, 213, 71, 17)
    $Text_T1 = GUICtrlCreateLabel("T1", 285, 114, 17, 17)
    $Text_T2 = GUICtrlCreateLabel("T2", 447, 114, 17, 17)
    $Text_T3 = GUICtrlCreateLabel("T3", 285, 147, 17, 17)
    $Text_T4 = GUICtrlCreateLabel("T4", 447, 147, 17, 17)
    $Text_T5 = GUICtrlCreateLabel("T5", 285, 180, 17, 17)
    $Text_T1_1 = GUICtrlCreateLabel("T1.1", 441, 180, 26, 17)
    $Icon_Hinweis = GUICtrlCreateIcon("c:\windows\system32\shell32.dll", -78, 39, 261, 16, 16)
    $Text_Hw_Main = GUICtrlCreateLabel("Hinweis:", 57, 261, 44, 17)
    $Text_Hw1 = GUICtrlCreateLabel("Diese Software ist nur zum Testen, es wird keine Haftung für die Richtigkeit der Daten gegeben.", 120, 261, 457, 17)
    $Text_Hw2 = GUICtrlCreateLabel("Es wird empfohlen die Daten mit den Naturmaßen abzugleichen.", 120, 276, 306, 17)
    $Text_Hw3 = GUICtrlCreateLabel("Diese Software ist urheberrechtlich geschützt, Vervielfältigungen und Veränderungen ohne Zu-", 120, 294, 450, 17)
    $Text_Hw4 = GUICtrlCreateLabel("stimmung des Autors sind nicht erlaubt.", 120, 312, 187, 17)
    $Text_Hw5 = GUICtrlCreateLabel("Verwendete Namen und Logo´s - wie esco - sind Eigentum der jew. Rechteinhaber und unterlie-", 120, 330, 457, 17)
    $Text_Hw6 = GUICtrlCreateLabel("gen ebenso dem Urheberrecht.", 120, 345, 151, 17)
    $FB = GUICtrlCreateInput("", 138, 111, 121, 21, $ES_NUMBER)
    $FH = GUICtrlCreateInput("", 138, 144, 121, 21, $ES_NUMBER)
    $GH = GUICtrlCreateInput("", 138, 177, 121, 21, $ES_NUMBER)
    $Pos = GUICtrlCreateInput("", 138, 210, 121, 21, $ES_UPPERCASE)
    $Group1 = GUICtrlCreateGroup("Schubstangenlängen: (mm)", 273, 91, 328, 148)
    $T1 = GUICtrlCreateInput("", 303, 111, 121, 21, $ES_READONLY)
    $T2 = GUICtrlCreateInput("", 465, 111, 121, 21, $ES_READONLY)
    $T3 = GUICtrlCreateInput("", 303, 144, 121, 21, $ES_READONLY)
    $T4 = GUICtrlCreateInput("", 465, 144, 121, 21, $ES_READONLY)
    $T5 = GUICtrlCreateInput("", 303, 177, 121, 21, $ES_READONLY)
    $T1_1 = GUICtrlCreateInput("", 465, 177, 121, 21, $ES_READONLY)
    $Checkbox1 = GUICtrlCreateCheckbox("mit Einlassgetriebe:", 303, 213, 124, 17)
    GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
    GUICtrlSetState($Checkbox1, $GUI_DISABLE)

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

    $Berechnen = GUICtrlCreateButton("Berechnen", 612, 108, 87, 25, $WS_GROUP)
    $Abbrechen = GUICtrlCreateButton("Abbrechen", 612, 141, 87, 25, $WS_GROUP)
    $Drucken__ = GUICtrlCreateButton("Drucken", 612, 174, 87, 25, $WS_GROUP)
    $Listenansicht = GUICtrlCreateButton("Listenansicht", 612, 207, 87, 25, $WS_GROUP)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $FB
    If GUICtrlRead($FB) < 405 Then
    _GUICtrlEdit_ShowBalloonTip($FB, "Fehler", "Fensterbreite (FB) unter 405 mm nicht zulässig", $TTI_INFO)
    ContinueLoop
    EndIf
    If GUICtrlRead($FB) > 1600 Then
    _GUICtrlEdit_ShowBalloonTip($FB, "Fehler", "Fensterbreite (FB) über 1600 mm nicht zulässig", $TTI_INFO)
    ContinueLoop
    EndIf
    GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
    GUICtrlSetState($Checkbox1, $GUI_DISABLE)
    ;~ Send(@TAB)
    Case $FH
    If GUICtrlRead($FH) < 520 Then
    _GUICtrlEdit_ShowBalloonTip($FH, "Fehler", "Fensterhöhe (FH) unter 520 mm nicht zulässig", $TTI_INFO)
    ContinueLoop
    EndIf
    If GUICtrlRead($FH) > 2400 Then
    _GUICtrlEdit_ShowBalloonTip($FH, "Fehler", "Fensterhöhe (FH) über 2400 mm nicht zulässig", $TTI_INFO)
    ContinueLoop
    EndIf
    If GUICtrlRead($GH) < Round(GUICtrlRead($FH) / 3, 0) Then
    GUICtrlSetData($GH, "260")
    EndIf
    $ghdata = Round(GUICtrlRead($FH) / 3, 0)
    If $ghdata < 260 Then
    GUICtrlSetData($GH, "260")
    Else
    GUICtrlSetData($GH, $ghdata)
    EndIf
    GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
    GUICtrlSetState($Checkbox1, $GUI_DISABLE)
    ;~ Send(@TAB)
    Case $GH
    If GUICtrlRead($FH) - $GH - 175 < 0 Then
    _GUICtrlEdit_ShowBalloonTip($GH, "Fehler", "(GH) ist für diese (FH) nicht zulässig!", $TTI_ERROR)
    ContinueLoop
    EndIf
    If GUICtrlRead($GH) < 260 Then
    GUICtrlSetData($GH, "260")
    ;~ Send(@TAB)
    ContinueLoop
    EndIf
    If GUICtrlRead($GH) < 260 Then
    _GUICtrlEdit_ShowBalloonTip($GH, "Fehler", "Griffhöhe (GH) unter 260 mm nicht zulässig", $TTI_INFO)
    ContinueLoop
    EndIf
    If GUICtrlRead($GH) < Round(GUICtrlRead($FH) / 3, 0) Then
    _GUICtrlEdit_ShowBalloonTip($GH, "Fehler", "(GH) muss mindestens 1/3 der (FH) sein", $TTI_INFO)
    GUICtrlSetData($GH, "260")
    ContinueLoop
    EndIf
    GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
    GUICtrlSetState($Checkbox1, $GUI_DISABLE)
    ;~ Send(@TAB)

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

    Case $Pos
    ;~ Send(@TAB)
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Checkbox1
    rechnen()
    If GUICtrlRead($T2) < 0 Then _GUICtrlEdit_ShowBalloonTip($GH, "Fehler", "(GH) ist für diese (FH) nicht zulässig!", $TTI_ERROR)
    Case $Abbrechen
    Exit
    Case $Berechnen
    GUISetState($Berechnen, $GUI_FOCUS)
    If GUICtrlRead($GH) < 260 Then GUICtrlSetData($GH, "260")
    rechnen()

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

    If GUICtrlRead($GH) < Round(GUICtrlRead($FH) / 3, 0) Then
    _GUICtrlEdit_ShowBalloonTip($GH, "Fehler", "(GH) muss mindestens 1/3 der (FH) sein", $TTI_ERROR)
    ContinueLoop
    EndIf
    If GUICtrlRead($GH) = "" Then
    _GUICtrlEdit_ShowBalloonTip($GH, "Fehler", "(GH) keine Maße zum berechnen!", $TTI_ERROR)
    ContinueLoop
    EndIf
    If GUICtrlRead($FB) = "" Then
    _GUICtrlEdit_ShowBalloonTip($FB, "Fehler", "(FB) keine Maße zum berechnen!", $TTI_ERROR)
    ContinueLoop
    EndIf
    If GUICtrlRead($FH) = "" Then
    _GUICtrlEdit_ShowBalloonTip($FH, "Fehler", "(FH) keine Maße zum berechnen!", $TTI_ERROR)
    ContinueLoop
    EndIf
    If GUICtrlRead($T2) < 0 Then
    _GUICtrlEdit_ShowBalloonTip($GH, "Fehler", "(GH) ist für diese (FH) nicht zulässig!", $TTI_ERROR)
    ContinueLoop
    EndIf
    If GUICtrlRead($T2) < 0 Then _GUICtrlEdit_ShowBalloonTip($GH, "Fehler", "(GH) ist für diese (FH) nicht zulässig!", $TTI_ERROR)
    GUICtrlSetState($Checkbox1, $GUI_ENABLE)
    If GUICtrlRead($FH) - $GH - 175 < 0 Then
    _GUICtrlEdit_ShowBalloonTip($GH, "Fehler", "(GH) ist für diese (FH) nicht zulässig!", $TTI_ERROR)
    ContinueLoop
    EndIf
    write()
    Case $Drucken__
    Case $Listenansicht
    $test = _FileCountLines(@ScriptDir & "\list.esc")
    MsgBox(0, "", $test)
    $Form1_1 = GUICreate("Form1", 1044, 443, 342, 274)
    $Group1 = GUICtrlCreateGroup("Eingabeliste", 33, 24, 976, 391)
    GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x000080)
    $List1 = GUICtrlCreateListView("POS|T1|T2|T3|T4|T5|T1.1", 39, 54, 964, 338, 0)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)
    $line = FileRead(@ScriptDir & "\list.esc")
    $aTmp = StringRegExp($line, "(?:([\d\.]+)\s{2})?([\d\.]+)\s([\d\.]+)\s([\d\.]+)\s([\d\.]+)\s([\d\.]+)\s([\d\.]+)", 4)
    ;~ _ArrayDisplay($aTmp)
    $sAdd = ""
    For $i = 0 To UBound($aTmp) - 1
    $aDummy = $aTmp[$i]
    If UBound($aDummy) = 7 Then $sAdd = $aDummy[0]
    If UBound($aDummy) = 6 Then $sAdd = ""
    _GUICtrlListView_AddItem($List1, $sAdd)
    $iIndex = _GUICtrlListView_GetItemCount($List1)
    For $j = 1 To UBound($aDummy) - 1
    _GUICtrlListView_AddSubItem($List1, $iIndex - 1, $aDummy[$j], $j-1)
    Next
    Next
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    GUIDelete()
    ExitLoop
    Case $List1

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

    EndSwitch
    WEnd

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

    EndSwitch
    WEnd

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

    Func rechnen()
    If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
    $T1rech = GUICtrlRead($GH) - 222
    Else
    $T1rech = GUICtrlRead($GH) - 175
    EndIf
    If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
    $T2rech = GUICtrlRead($FH) - GUICtrlRead($GH) - 222
    Else
    $T2rech = GUICtrlRead($FH) - GUICtrlRead($GH) - 175
    EndIf
    If GUICtrlRead($FB) < 600 Then $T3rech = GUICtrlRead($FB) - 371
    If GUICtrlRead($FB) >= 600 Then $T3rech = GUICtrlRead($FB) - 539
    $T4rech = GUICtrlRead($FH) / 2 - 128
    $T5rech = GUICtrlRead($FB) / 2 - 94
    $T1_1rech = GUICtrlRead($FH) - 320
    GUICtrlSetData($T1, $T1rech)
    GUICtrlSetData($T2, $T2rech)
    GUICtrlSetData($T3, $T3rech)
    GUICtrlSetData($T4, $T4rech)
    GUICtrlSetData($T5, $T5rech)
    GUICtrlSetData($T1_1, $T1_1rech)
    EndFunc ;==>rechnen
    Func write()
    $file = FileOpen(@ScriptDir & "\list.esc", 1)
    If _FileCountLines(@ScriptDir & "\list.esc") < 1 Then
    FileWrite($file, "POS." & @TAB & @TAB & "T1" & @TAB & "T2" & @TAB & "T3" & @TAB & "T4" & @TAB & "T5" & @TAB & "T1.1" & @CRLF)
    FileWrite($file, "-------------------------------------------------------------" & @CRLF & @CRLF)
    EndIf
    FileWrite($file, GUICtrlRead($Pos) & @TAB & @TAB & GUICtrlRead($T1) & @TAB & GUICtrlRead($T2) & @TAB & GUICtrlRead($T3) & @TAB & GUICtrlRead($T4) & @TAB & GUICtrlRead($T5) & @TAB & GUICtrlRead($T1_1) & @CRLF)
    FileClose($file)
    EndFunc ;==>write

    [/autoit]
  • Button unterhalb von Childfenstern

    • SEuBo
    • 25. Februar 2010 um 08:50

    $WS_CHILD durch $WS_POPUP + $WS_EX_MDICHILD ersetzen.

    Spoiler anzeigen
    [autoit]

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

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

    #region ### START Koda GUI section ### Form=
    $Desktop = GUICreate("Desktop", @DesktopWidth, @DesktopHeight, 0, 0, BitOR($WS_POPUP, $WS_VISIBLE), BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE))
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

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

    GUICtrlCreateButton("Test", 100, 80, 60, 60, BitOR($BS_NOTIFY, $WS_GROUP, $WS_TABSTOP, $WS_VISIBLE, $BS_FLAT))

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

    #region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 625, 443, 192, 124, BitOR($WS_MINIMIZEBOX, $WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_GROUP, $WS_VISIBLE, $WS_BORDER, $WS_CLIPSIBLINGS), $WS_EX_MDICHILD, $Desktop)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

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

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

    [/autoit]

    //Edit: Ne, doch nicht :S

  • [Beispiel] Slide GUI

    • SEuBo
    • 25. Februar 2010 um 08:05
    Zitat von funkey

    Ich wußte gar nicht, dass es Autoit.at gibt 8| . Wieviele Foren will FirePanther denn noch eröffnen?!

    Zu deinem Skript: Funktioniert tadellos! :thumbup:
    Da gibt es aber irgendwo bereits eine tolle UDF für sowas, weiß leider nur nicht mehr wo und von wem.

    Scheint sein neustes Projekt zu sein. Wie viele er schon eröffnet hat / eröffnen will, kann ich dir nicht sagen. Ich kenne nur autoit.at.

    Sehr schön, dass es funktioniert. Vielleicht bau ich das auch in eine UDF ein. Sollte ja nicht allzu schwierig sein. Mir ging es in erster Linie darum, eine Funktion zu schreiben, die mit relativ wenig Code für alle 4 Richtungen funktioniert.

  • variables label

    • SEuBo
    • 25. Februar 2010 um 07:47

    Sorry, dass ich das nochmal ausgrabe, aber ich bin grade nochmal auf diesen Thread gestoßen, und mir fiel auf, dass die Funktion _Breaktext fehlerhaft gearbeitet hat.

    [autoit]

    Func _BreakText($sText, $iLen = 75)
    Return StringRegExpReplace($sText, "([\w\W]{0," & $iLen & "}\b)", "\1" & @CRLF)
    EndFunc ;==>_BreakText

    [/autoit]

    so funktioniert sie nun auch korrekt, und bricht den Text nicht mitten im Wort um.

  • [Beispiel] Slide GUI

    • SEuBo
    • 24. Februar 2010 um 23:43

    Hey, hatte das hier für AutoIt.at geschrieben, und dachte mir, dass es auch hier nicht fehl am Platze wäre.

    Die Funktionen _SlideWin() und _WinIsHovered sind natürlich ohne anpassung übernehmbar.

    /EDIT: Daraus ist auch vor ewiger Zeit mal eine UDF enstanden:
    https://autoit.de/index.php?page=Thread&amp;postID=145125

    Spoiler anzeigen
    [autoit]

    #include <Array.au3>
    #include <WindowsConstants.au3>
    HotKeySet("{ESC}", "_Exit") ; Set the Hotkey to exit.
    $hDLL = DllOpen("user32.dll") ; Open the DLL for _WinIsHovered() (faster with DLL-handle)

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

    $h_Left = GUICreate("SlideGUI left", 155, 350, -1, -1, -1, $WS_EX_TOPMOST)
    $_Button1 = GUICtrlCreateButton("Example Button", 40, 40, 100, 30)
    GUICtrlCreateEdit("Sample Edit...", 20, 90, 120, 200)
    $h_Right = GUICreate("SlideGUI Right", 155, 350, -1, -1, -1, $WS_EX_TOPMOST)
    GUICtrlCreateEdit("Sample Edit...", 20, 20, 150, 300)
    $h_Bottom = GUICreate("SlideGUI Bottom", 350, 155, -1, -1, -1, $WS_EX_TOPMOST)
    GUICtrlCreateCheckbox("Sample Checkbox", 40, 30)
    GUICtrlCreateCombo("Combo", 140, 50)
    $h_Top = GUICreate("SlideGUI Top", 350, 155, -1, -1, -1, $WS_EX_TOPMOST)
    $_ListView = GUICtrlCreateListView("Columnd 1|Column 2", 5, 5, 340, 145)
    GUICtrlCreateListViewItem("Item 1_1|Item 1_2",$_ListView)
    GUICtrlCreateListViewItem("Item 2_1|Item 2_2",$_ListView)
    GUICtrlCreateListViewItem("Item 3_1|Item 3_2",$_ListView)

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

    ; Move GUI's to the right place and set the Variables State to False
    Global $LEFT_IN = False, $RIGHT_IN = False, $BOTTOM_IN = False, $TOP_IN = False
    _SlideWin($h_Left, "out", "left")
    _SlideWin($h_Right, "out", "right")
    _SlideWin($h_Bottom, "out", "bottom")
    _SlideWin($h_Top, "out", "top")

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

    ; Show GUI's
    GUISetState(@SW_SHOWNOACTIVATE, $h_Left)
    GUISetState(@SW_SHOWNOACTIVATE, $h_Right)
    GUISetState(@SW_SHOWNOACTIVATE, $h_Bottom)
    GUISetState(@SW_SHOWNOACTIVATE, $h_Top)

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

    While 1 * Sleep(10)
    $nMsg = GUIGetMsg(1)
    Select
    Case $nMsg[0] = -3
    _Exit()
    Case $nMsg[0] = $_Button1
    MsgBox(0, "", "Example Button clicked.")
    Case _WinIsHovered($h_Left, $hDLL) ; Check if we need to Slide in a GUI.
    If Not $LEFT_IN Then ; If not already slide-in,
    _SlideWin($h_Left, "in", "left") ; Slide in GUI
    $LEFT_IN = True ; Set var to True.
    EndIf
    Case _WinIsHovered($h_Right, $hDLL)
    If Not $RIGHT_IN Then
    _SlideWin($h_Right, "in", "right")
    $RIGHT_IN = True
    EndIf
    Case _WinIsHovered($h_Bottom, $hDLL)
    If Not $BOTTOM_IN Then
    _SlideWin($h_Bottom, "in", "bottom")
    $BOTTOM_IN = True
    EndIf
    Case _WinIsHovered($h_Top, $hDLL)
    If Not $TOP_IN Then
    _SlideWin($h_Top, "in", "top")
    $TOP_IN = True
    EndIf
    Case Else ; No window is hovered. Check if we need to Slide out a GUI.
    Select
    Case $LEFT_IN
    _SlideWin($h_Left, "out", "left")
    $LEFT_IN = False
    Case $RIGHT_IN
    _SlideWin($h_Right, "out", "right")
    $RIGHT_IN = False
    Case $TOP_IN
    _SlideWin($h_Top, "out", "top")
    $TOP_IN = False
    Case $BOTTOM_IN
    _SlideWin($h_Bottom, "out", "bottom")
    $BOTTOM_IN = False
    EndSelect
    EndSelect
    WEnd

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

    Func _SlideWin($hWnd, $sMode, $sSide)
    ;$hWnd = Window to slide.
    ;$sMode = Slide-In or -out (in|out)
    ;$sSide = Side where you want the GUI to slide. (left|right|top|bottom)
    Local $aScreen_Res = WinGetPos(WinGetHandle("Program Manager"))
    Local $aWPos = WinGetPos($hWnd), $m = 0 - ($sMode = "in") + ($sMode = "out")
    Local $h = 0 - ($sSide = "left") + ($sSide = "right"), $v = 0 - ($sSide = "top") + ($sSide = "bottom")

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

    WinMove($hWnd, "", _ ; Move GUI according to $sMode and $sSide.
    $aScreen_Res[0] - (($h = -1) * ($m = -1) * ($aWPos[2] - 10)) _
    + (($h = 1) * (($h = 1) * $aScreen_Res[2] - (10 * ($m = -1)) - ($m <> -1) * $aWPos[2])) _
    + (($h = 0) * (($h = 0) * ($aScreen_Res[2] / 2) - ($aWPos[2] / 2))) _
    , _
    $aScreen_Res[1] - (($v = -1) * ($m = -1) * ($aWPos[3] - 10)) _
    + (($v = 1) * (($v = 1) * $aScreen_Res[3] - (10 * ($m = -1)) - ($m <> -1) * $aWPos[3])) _
    + (($v = 0) * (($v = 0) * ($aScreen_Res[3] / 2) - ($aWPos[3] / 2))) _
    )

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

    $aWPos = WinGetPos($hWnd)
    ; Slide GUI.
    Switch $sSide
    Case "left", "right"
    Local $STEP = (((($h = 1) And ($m = 1)) Or (($h = -1) And ($m = -1))) - ((($h = -1) And ($m = 1)) Or (($h = 1) And ($m = -1)))) * 10
    Local $FROM = $aWPos[0], $TO = $aWPos[0] _
    + (((($h = 1) And ($m = 1)) Or (($h = -1) And ($m = -1))) * ($aWPos[2])) _
    - (((($h = 1) And ($m = -1)) Or (($h = -1) And ($m = 1))) * ($aWPos[2])) - $STEP
    For $i = $aWPos[0] To $TO Step $STEP
    WinMove($hWnd, "", $i, $aWPos[1])
    Sleep(10)
    Next
    Case "top", "bottom"
    Local $STEP = (((($v = 1) And ($m = 1)) Or (($v = -1) And ($m = -1))) - ((($v = -1) And ($m = 1)) Or (($v = 1) And ($m = -1)))) * 10
    Local $FROM = $aWPos[1], $TO = $aWPos[1] _
    + (((($v = 1) And ($m = 1)) Or (($v = -1) And ($m = -1))) * ($aWPos[3])) _
    - (((($v = 1) And ($m = -1)) Or (($v = -1) And ($m = 1))) * ($aWPos[3])) - $STEP
    For $i = $aWPos[1] To $TO Step $STEP
    WinMove($hWnd, "", $aWPos[0], $i)
    Sleep(10)
    Next
    EndSwitch
    EndFunc ;==>_SlideWin

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

    Func _WinIsHovered($hWnd, $vDLL = "User32.dll")
    Local $aResult, $aWPos = WinGetPos($hWnd), $aMPos = MouseGetPos()
    Local $tRect = DllStructCreate("int Left;int Top;int Right;int Bottom")
    Local $iLeft = $aWPos[0], $iTop = $aWPos[1], $iWidth = $aWPos[2], $iHeight = $aWPos[3]
    Local $iX = $aMPos[0], $iY = $aMPos[1]
    DllStructSetData($tRect, "Left", $iLeft)
    DllStructSetData($tRect, "Top", $iTop)
    DllStructSetData($tRect, "Right", $iLeft + $iWidth)
    DllStructSetData($tRect, "Bottom", $iTop + $iHeight)

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

    $aResult = DllCall($vDLL, "int", "PtInRect", "ptr", DllStructGetPtr($tRect), "int", $iX, "int", $iY)
    If @error Then Return SetError(@error, 0, False)

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

    Return $aResult[0] <> 0
    EndFunc ;==>_WinIsHovered

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

    Func _Exit()
    DllClose($hDLL) ; Dont forget to close your DLL-Handle
    Exit
    EndFunc ;==>_Exit

    [/autoit]
  • Zu großer Inhalt von GUI mit veränderbarer Größe

    • SEuBo
    • 24. Februar 2010 um 20:52

    Außerdem kannst du mit GUICtrlSetResizing festlegen, wie sich Controls beim Resizen verhalten sollen.

  • Windowstaste inzwischen für Hotkeyset möglich?

    • SEuBo
    • 24. Februar 2010 um 20:47
    Zitat von pretrojaner

    die windows taste wird durch das # zeichen ersetzt.


    Wäre ja nicht so, dass ich das gleiche Beispiel 2 Posts vorher gepostet hätte.
    Bei mir ist es halt Win+O

    Zitat von chip

    ICh meine ja nur die WIndowstaste, keine Tastenkombination.

    Nein. Gibts nicht. geht nicht.

    Zitat

    The following hotkeys cannot be set:

    Ctrl+Alt+Delete It is reserved by Windows
    F12 It is also reserved by Windows, according to its API.
    NumPad's Enter Key Instead, use {Enter} which captures both Enter keys on the keyboard.
    Win+B,D,E,F,L,M,R,U; and Win+Shift+M These are built-in Windows shortcuts. Note: Win+B and Win+L might only be reserved on Windows XP and above.
    Alt, Ctrl, Shift, Win These are the modifier keys themselves!
    Other Any global hotkeys a user has defined using third-party software, any combos of two or more "base keys" such as '{F1}{F2}', and any keys of the form '{LALT}' or '{ALTDOWN}'.

    Arbeite doch einfach mit AdlibRegister und _IsPressed o.o

    5B Left Windows key
    5C Right Windows key

  • Ahh Hilfe

    • SEuBo
    • 24. Februar 2010 um 20:41

    Abgesicherter Modus. Programm ausm Autostart nehmen. Neu starten. Was VERNÜNFTIGES programmieren.

  • Windowstaste inzwischen für Hotkeyset möglich?

    • SEuBo
    • 24. Februar 2010 um 15:05

    Bei mir unter Win Vista klappts tadellos.
    Schonmal #RequireAdmin probiert ? ^^

  • AutoIt Inputbox per email schicken Hilfe

    • SEuBo
    • 24. Februar 2010 um 13:52

    http://tinyurl.com/eg569

    :whistling:

    Wo ist denn dein bisheriger Code?

  • Prüfen ob GUI verlassen wurde

    • SEuBo
    • 24. Februar 2010 um 00:56

    Fürs nächste mal geht auch das hier:

    [autoit]

    Func _CheckForWinHover($hWnd)
    Local $aResult, $aWPos = WinGetPos($hWnd), $aMPos = MouseGetPos()
    Local $tRect = DllStructCreate("int Left;int Top;int Right;int Bottom")
    Local $iLeft = $aWPos[0], $iTop = $aWPos[1], $iWidth = $aWPos[2], $iHeight = $aWPos[3]
    Local $iX = $aMPos[0], $iY = $aMPos[1]
    DllStructSetData($tRect, "Left", $iLeft)
    DllStructSetData($tRect, "Top", $iTop)
    DllStructSetData($tRect, "Right", $iLeft + $iWidth)
    DllStructSetData($tRect, "Bottom", $iTop + $iHeight)

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

    $aResult = DllCall("User32.dll", "int", "PtInRect", "ptr", DllStructGetPtr($tRect), "int", $iX, "int", $iY)
    If @error Then Return SetError(@error, 0, False)

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

    Return $aResult[0] <> 0
    EndFunc ;==>_CheckForWinHover

    [/autoit]
  • Windowstaste inzwischen für Hotkeyset möglich?

    • SEuBo
    • 24. Februar 2010 um 00:52
    [autoit]

    HotKeySet("#{o}", "Test")

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

    While 1 * Sleep(1000)
    WEnd

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

    Func Test()
    MsgBox(0, "", @HotKeyPressed)
    EndFunc ;==>Test

    [/autoit]
  • Frage zum Dateien abspeichern

    • SEuBo
    • 23. Februar 2010 um 18:58
    [autoit]

    FileWrite("Datei.dateiendung","Daten in der Datei")

    [/autoit]

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™