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. funkey

Beiträge von funkey

  • Eigenes Tab-Register (OwnTab-UDF)

    • funkey
    • 18. November 2009 um 11:56

    Neue Version siehe Post#1

    Jetzt kann man auch Icons anzeigen lassen. Das war ziemlich viel Arbeit, aber es hat sich gelohnt. Sieht meiner Meinung nach toll aus.

  • Eigenes Tab-Register (OwnTab-UDF)

    • funkey
    • 16. November 2009 um 19:14

    Meinst du das so?

    Spoiler anzeigen
    [autoit]

    #include "OwnTab.au3"

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

    GUICreate("Funkey's OwnTab-UDF Example 2", 500, 345)
    GUISetBkColor(0xbbbbbb)

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

    Local $aTabText[4] = ["Item 1", "Much More Longer Item 2", "Pic", "Status"] ;Declare the regions for the OwnTab-control
    Global $aCtrlTab = _OwnTabCreate($aTabText, 10, 10, 480, 300, 25, 0xD5D5D5, 0xCFE0E7, 0xCFE0E7)

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

    Local $aTabTip[4] = ["Tip Item 1", "Tip Item 2", "Tip Item 3", "Tip Item 4"]
    _OwnTabSetTip($aCtrlTab, $aTabTip) ;set the tooltips for the OwnTab-control

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

    #Region Tab1
    _OwnTabAdd($aCtrlTab) ;Start controls tab1
    Global $Edit1 = GUICtrlCreateEdit("Edit in Tab1", 20, 50, 300, 50, 0)
    Global $Button1 = GUICtrlCreateButton("Simulate an alarm", 20, 120, 300, 20)
    #EndRegion Tab1

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

    #Region Tab2
    _OwnTabAdd($aCtrlTab) ;Start controls tab2
    Global $Edit2 = GUICtrlCreateEdit("Edit in Tab2", 20, 150, 300, 50, 0)
    Global $Label2 = GUICtrlCreateLabel("Label in Tab2", 20, 220, 300, 20, 0x201)
    GUICtrlSetBkColor(-1, -2) ;$GUI_BKCOLOR_TRANSPARENT
    #EndRegion Tab2

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

    #Region Tab3
    _OwnTabAdd($aCtrlTab) ;Start controls tab3
    Global $Edit3 = GUICtrlCreatePic(@DocumentsCommonDir & '\Eigene Bilder\Beispielbilder\Winter.jpg', 20, 45, 460, 280)
    #EndRegion Tab3

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

    #Region Tab4
    _OwnTabAdd($aCtrlTab) ;Start controls tab4
    Global $Button4 = GUICtrlCreateButton("Acknowledge the alarm", 20, 120, 300, 20)
    #EndRegion Tab4

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

    _OwnTabEnd($aCtrlTab) ;End OwnTab
    _OwnTabSwitch($aCtrlTab, 1) ;inizialize the OwnTab
    GUISetState()
    _OwnTabHover($aCtrlTab, 0xFFFF88) ;start hover-function if you want

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

    Local $msg
    Do
    $msg = GUIGetMsg()
    For $a = 1 To UBound($aCtrlTab, 1) - 1
    If $msg = $aCtrlTab[$a][0] Then
    _OwnTabSwitch($aCtrlTab, $a)
    _Function($a)
    EndIf
    Next
    If $msg = $Button1 Then _OwnTabSetAlarm($aCtrlTab, 4, 0xFF0000, 0xFF0000)
    If $msg = $Button4 Then _OwnTabReSetAlarm($aCtrlTab, 4)
    Sleep(10)
    Until $msg = -3

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

    Func _Function($iIndex)
    MsgBox(0, "OwnTab-Control", "Es wurde Register " & $iIndex & " ausgewählt.")
    EndFunc ;==>_Function

    [/autoit]

    Das kannst du doch machen wie du gerade lustig bist. ;)

  • Tastatur und Maus während der Installation sperren ?

    • funkey
    • 16. November 2009 um 17:31

    Du kannst einfach

    [autoit]

    SplashImageOn
    SplashTextOn

    [/autoit]

    dafür verwenden.


    Außerdem schaltet

    [autoit]

    _WinAPI_MsgBox

    [/autoit]

    immer den BlockInput aus ;)

  • Eigenes Tab-Register (OwnTab-UDF)

    • funkey
    • 16. November 2009 um 17:24

    Danke Simon für das Lob! Aber wie meinst du das mit einer Hintergrundfunktion für die einzelnen Tabs?


    Hab noch einen Fehler bei der Hover-Funktion ausgebessert, siehe Post#1.

  • Gateway unter Vista setzen

    • funkey
    • 16. November 2009 um 17:15
    [autoit]

    $sIP = "10.0.0.130"
    $sSub = "255.255.255.0"
    $sGW = "10.0.0.138"
    $sConnection = "Drahtlose Netzwerkverbindung"

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

    RunWait(@ComSpec & " /c netsh interface ip set address " & Chr(34) & $sConnection & Chr(34) & " static " & $sIP & " " & $sSub & " " & $sGW & " 0", "", @SW_HIDE)

    [/autoit]

    mfg funkey

  • MSScriptControl.ScriptControl in Autoitscript einbinden

    • funkey
    • 16. November 2009 um 09:58

    Funktioniert doch!

    Hier noch mal in einer Funktion:

    Spoiler anzeigen
    [autoit]

    ConsoleWrite(_RegexMatches('\d+', 'ABC123DEF') & @CRLF)

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

    Func _RegexMatches($sPattern, $sString)
    Local $sCode = 'Function RegexMatches(sPattern, sString)' & _
    @LF & ' Dim oRegEx, oMatch, oMatches, RetStr' & _ ; Create variables.
    @LF & ' Set oRegEx = New RegExp' & _ ; Create regular expression.
    @LF & ' oRegEx.Pattern = sPattern' & _ ; Set pattern.
    @LF & ' oRegEx.IgnoreCase = True' & _ ; Set case sensitivity.
    @LF & ' oRegEx.Global = True' & _ ; Set Global option.
    @LF & ' Set oMatches = oRegEx.Execute(sString)' & _ ; Execute the search test.
    @LF & ' For Each oMatch in oMatches' & _
    @LF & ' RetStr = RetStr & "Match found at position "' & _
    @LF & ' RetStr = RetStr & oMatch.FirstIndex & vbCRLF' & _
    @LF & ' RetStr = RetStr & "Match Value is "' & _
    @LF & ' RetStr = RetStr & oMatch.Value & "." & vbCRLF & vbCRLF' & _
    @LF & ' Next' & _
    @LF & ' RegexMatches = RetStr' & _
    @LF & 'End Function' & @LF
    Local $Vbs = ObjCreate('ScriptControl')
    $Vbs.Language = 'VBScript'
    $Vbs.AddCode($sCode)
    $sRET = $Vbs.Run('RegexMatches', $sPattern, $sString)
    Return $sRet
    EndFunc

    [/autoit]
  • Fallende GUI

    • funkey
    • 15. November 2009 um 09:32

    Du hattest doch schon so einen Thread ?(
    [ offen ] GUI Mit Schwerkraft

  • Eigenes Tab-Register (OwnTab-UDF)

    • funkey
    • 14. November 2009 um 10:25

    Damit meinst du WinFlash, oder?

    [autoit]

    WinFlash
    _WinAPI_FlashWindow
    _WinAPI_FlashWindowEx

    [/autoit]

    Welches Fenster sollte sich im Hintergrund öffnen? Sorry aber ich hab's immer noch nicht ganz verstanden!
    Wenn also z.B. ein Alarm eines Registers auftritt und das Fenster mit dem OwnTab im Hintergrund ist, dass dann WinFlash aufgerufen wird?

  • µit - Dezember

    • funkey
    • 13. November 2009 um 17:30

    Klingt eher zeitintensiv, aber auf jeden Fall sehr interessant. Weiß noch nicht ob ich Zeit finde, aber es würde mich schon reizen.

  • Geburtstag von AutoBert

    • funkey
    • 13. November 2009 um 17:10

    AutoBert, auch von mir alles Gute zum Geburtstag und gute Besserung!!
    [Blockierte Grafik: http://smilie-land.de/t/i-l/krank/krank0027.gif][Blockierte Grafik: http://smilie-land.de/t/e-h/geburtstag/geb0006.gif]

  • Eigenes Tab-Register (OwnTab-UDF)

    • funkey
    • 13. November 2009 um 14:24

    Danke DeepRed92!

    Hab die UDF jetzt um die Hover-Funktion erweitert.
    Download siehe Post#1

  • Eigenes Tab-Register (OwnTab-UDF)

    • funkey
    • 12. November 2009 um 17:58
    Zitat von tobi_girst

    Zum neuen Script: Finde ich gut, die Wenn sich im Hintergrund ein Fenster öffnet!


    Das habe ich nicht ganz verstanden.

    Zitat von tobi_girst

    Ach ja: kann man das blinken lassen?


    Natürlich geht das! Kann ich bei nächster Gelegenheit einbauen.

  • Rundll32 Bluetooth

    • funkey
    • 12. November 2009 um 16:53

    Funktioniert bei mir zwar nicht, sollte aber so ähnlich gehen. ?(

    [autoit]

    Run('"control.exe "'& @SystemDir & '\irprops.cpl, BluetoothAuthenticationAgent"')

    [/autoit]
  • Eigenes Tab-Register (OwnTab-UDF)

    • funkey
    • 12. November 2009 um 13:25

    Thx Raupi!

    Nächste Version! Jetzt kann die Farbe der einzelnen Register geändert werden, z.B. wenn ein Alarm auftritt ;)

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>

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

    GUICreate("Funkey's Own Tabs ;)", 500, 345)
    GUISetBkColor(0xbbbbbb)

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

    Local $aTabText[4] = ["Item 1", "Much More Longer Item 2", "Pic", "Status"] ;Declare the regions for the OwnTab-control
    Global $aCtrlTab = _OwnTabCreate($aTabText, 10, 10, 480, 300, 25, 0xD5D5D5, 0xCFE0E7, 0xCFE0E7)

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

    #Region Tab1
    $aCtrlTab[0][4] = GUICtrlCreateDummy() ;Start controls tab1
    Global $Edit1 = GUICtrlCreateEdit("Edit in Tab1", 20, 50, 300, 50, 0)
    Global $Button1 = GUICtrlCreateButton("Simulate an alarm", 20, 120, 300, 20)
    #EndRegion Tab1

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

    #Region Tab2
    $aCtrlTab[1][4] = GUICtrlCreateDummy() ;Start controls tab2
    Global $Edit2 = GUICtrlCreateEdit("Edit in Tab2", 20, 150, 300, 50, 0)
    Global $Label2 = GUICtrlCreateLabel("Label in Tab2", 20, 220, 300, 20, 0x201)
    GUICtrlSetBkColor(-1, -2) ;$GUI_BKCOLOR_TRANSPARENT
    #EndRegion Tab2

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

    #Region Tab3
    $aCtrlTab[2][4] = GUICtrlCreateDummy() ;Start controls tab3
    Global $Edit3 = GUICtrlCreatePic(@DocumentsCommonDir & '\Eigene Bilder\Beispielbilder\Winter.jpg', 20, 45, 460, 280)
    #EndRegion Tab3

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

    #Region Tab4
    $aCtrlTab[3][4] = GUICtrlCreateDummy() ;Start controls tab4
    Global $Button4 = GUICtrlCreateButton("Acknowledge the alarm", 20, 120, 300, 20)
    #EndRegion Tab4

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

    $aCtrlTab[4][4] = GUICtrlCreateDummy() ;End OwnTab

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

    _OwnTabSwitch($aCtrlTab, 1)
    GUISetState()

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

    Local $msg
    Do
    $msg = GUIGetMsg()
    For $a = 1 To UBound($aCtrlTab, 1) - 1
    If $msg = $aCtrlTab[$a][0] Then _OwnTabSwitch($aCtrlTab, $a)
    Next
    If $msg = $Button1 Then _OwnTabSetCol($aCtrlTab, 4, 0xFF0000, 0xFF0000)
    If $msg = $Button4 Then _OwnTabSetCol($aCtrlTab, 4)
    Sleep(10)
    Until $msg = -3

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

    Func _OwnTabCreate($aTabText, $xPos, $yPos, $iWidth, $iHeight, $iItemHeight = -1, $nColNoSel = -1, $nColSel = -1, $nColBg = -1)
    Local $aSize, $aSize2[UBound($aTabText)][2], $xLast = 0, $aCtrl[UBound($aTabText) + 1][5]
    If Not IsArray($aTabText) Then Return SetError(1, 0, "")
    $aCtrl[0][2] = $nColNoSel
    $aCtrl[0][3] = $nColSel
    For $i = 0 To UBound($aTabText) - 1
    If $aTabText[$i] = "" Then Return SetError(2, $i + 1, "")
    $aSize = _GetTextSize($aTabText[$i])
    $aSize[0] += Ceiling($aSize[0] / 10) ;make it 10% longer for bold text
    $aSize2[$i][0] = $aSize[0]
    $aSize2[$i][1] = $aSize[1]
    If $iItemHeight = -1 Then $iItemHeight = $aSize[1]
    $aCtrl[$i + 1][0] = GUICtrlCreateLabel($aTabText[$i], $xPos + $xLast + 5, $yPos + 2, $aSize[0] + 5, $iItemHeight, 0x411201)
    $aCtrl[$i + 1][2] = $nColNoSel
    $aCtrl[$i + 1][3] = $nColSel
    $xLast += $aSize[0] + 5
    Next
    GUICtrlCreateLabel("", $xPos, $yPos + $iItemHeight, $iWidth, $iHeight, 0x411000)
    GUICtrlSetState(-1, 128) ;$GUI_DISABLE
    GUICtrlSetBkColor(-1, $nColBg)
    $xLast = 0
    For $i = 0 To UBound($aTabText) - 1
    $aCtrl[$i + 1][1] = GUICtrlCreateLabel("", $xPos + $xLast + 6, $yPos + $iItemHeight, $aSize2[$i][0] + 3, 2)
    GUICtrlSetBkColor(-1, $nColSel)
    $xLast += $aSize2[$i][0] + 5
    Next
    Return $aCtrl
    EndFunc ;==>_OwnTabCreate

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

    Func _OwnTabSwitch(ByRef $aOwnTab, $iIndex)
    If $aOwnTab[0][0] = $iIndex Then Return
    For $s = 1 To UBound($aOwnTab, 1) - 1
    If $iIndex <> $s Then
    GUICtrlSetState($aOwnTab[$s][1], 32) ;$GUI_HIDE
    GUICtrlSetBkColor($aOwnTab[$s][0], $aOwnTab[$s][2])
    GUICtrlSetFont($aOwnTab[$s][0], -1, 400)
    Else
    GUICtrlSetBkColor($aOwnTab[$iIndex][0], $aOwnTab[$s][3])
    GUICtrlSetFont($aOwnTab[$iIndex][0], -1, 1000)
    GUICtrlSetState($aOwnTab[$iIndex][1], 16) ;$GUI_SHOW
    EndIf
    Next
    For $t = $aOwnTab[0][4] To $aOwnTab[UBound($aOwnTab, 1) - 1][4]
    GUICtrlSetState($t, 32) ;$GUI_HIDE
    If $t > $aOwnTab[$iIndex - 1][4] And $t < $aOwnTab[$iIndex][4] Then GUICtrlSetState($t, 16) ;$GUI_SHOW
    Next
    $aOwnTab[0][0] = $iIndex
    EndFunc ;==>_OwnTabSwitch

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

    Func _OwnTabSetCol(ByRef $aOwnTab, $iIndex, $nColNoSel = -1, $nColSel = -1)
    If $nColNoSel = -1 Then
    $aOwnTab[$iIndex][2] = $aOwnTab[0][2]
    Else
    $aOwnTab[$iIndex][2] = $nColNoSel
    EndIf
    If $nColNoSel = -1 Then
    $aOwnTab[$iIndex][3] = $aOwnTab[0][3]
    Else
    $aOwnTab[$iIndex][3] = $nColSel
    EndIf
    If $aOwnTab[0][0] <> $iIndex Then
    GUICtrlSetBkColor($aOwnTab[$iIndex][0], $aOwnTab[$iIndex][2])
    Else
    GUICtrlSetBkColor($aOwnTab[$iIndex][0], $aOwnTab[$iIndex][3])
    EndIf
    GUICtrlSetBkColor($aOwnTab[$iIndex][1], $aOwnTab[$iIndex][3])
    EndFunc

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

    Func _GetTextSize($nText, $sFont = 'Microsoft Sans Serif', $iFontSize = 8.5, $iFontAttributes = 0)
    ;Author: Bugfix
    ;Modified: funkey
    If $nText = '' Then Return
    Local $hGui = GUICreate("Textmeter by Bugfix")
    _GDIPlus_Startup()
    Local $hFormat = _GDIPlus_StringFormatCreate(0)
    Local $hFamily = _GDIPlus_FontFamilyCreate($sFont)
    Local $hFont = _GDIPlus_FontCreate($hFamily, $iFontSize, $iFontAttributes, 3)
    Local $tLayout = _GDIPlus_RectFCreate(15, 171, 0, 0)
    Local $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)
    Local $aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $nText, $hFont, $tLayout, $hFormat)
    Local $iWidth = Ceiling(DllStructGetData($aInfo[0], "Width"))
    Local $iHeight = Ceiling(DllStructGetData($aInfo[0], "Height"))
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
    GUIDelete($hGui)
    Local $aSize[2] = [$iWidth, $iHeight]
    Return $aSize
    EndFunc ;==>_GetTextSize

    [/autoit]
  • Geburtstag von Xeno

    • funkey
    • 12. November 2009 um 08:07

    Alles Gute auch von mir!! :thumbup: Ich dachte du warst mal so ca. 10 Jahre jünger 8o ?( Wird mich wohl getäuscht haben. :D

  • Eigenes Tab-Register (OwnTab-UDF)

    • funkey
    • 11. November 2009 um 19:52
    Zitat von tobi_girst

    Graphisch: 4-5


    :(
    Ich hoffe das liegt hauptsächlich nur an den Farben, die ich für die Beispiele verwendet habe. :D

    Danke für die ansonsten positiven Kommentare!

    Hab das Skript noch ein bischen weiter verbessert.
    Der Text des aktiven Registers wird nun fett angezeigt.

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>

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

    GUICreate("Funkey's Own Tabs ;)", 500, 345)
    GUISetBkColor(0xbbbbbb)

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

    Local $aTabText[4] = ["Item 1", "Much More Longer Item 2", "Pic", "Empty"] ;Declare the regions for the OwnTab-control
    Global $aCtrlTab = _OwnTabCreate($aTabText, 10, 10, 480, 300, 25, 0xD5D5D5, 0xCFE0E7, 0xCFE0E7)

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

    #Region Tab1
    $aCtrlTab[0][4] = GUICtrlCreateDummy() ;Start controls tab1
    Global $Edit1 = GUICtrlCreateEdit("Edit in Tab1", 20, 50, 300, 50, 0)
    Global $Label1 = GUICtrlCreateButton("Button in Tab1", 20, 120, 300, 20)
    #EndRegion Tab1

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

    #Region Tab2
    $aCtrlTab[1][4] = GUICtrlCreateDummy() ;Start controls tab2
    Global $Edit2 = GUICtrlCreateEdit("Edit in Tab2", 20, 150, 300, 50, 0)
    Global $Label2 = GUICtrlCreateLabel("Label in Tab2", 20, 220, 300, 20, 0x201)
    GUICtrlSetBkColor(-1, -2) ;$GUI_BKCOLOR_TRANSPARENT
    #EndRegion Tab2

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

    #Region Tab3
    $aCtrlTab[2][4] = GUICtrlCreateDummy() ;Start controls tab3
    Global $Edit3 = GUICtrlCreatePic(@DocumentsCommonDir & '\Eigene Bilder\Beispielbilder\Winter.jpg', 20, 45, 460, 280)
    #EndRegion Tab3

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

    $aCtrlTab[3][4] = GUICtrlCreateDummy() ;Empty tab
    $aCtrlTab[4][4] = GUICtrlCreateDummy() ;End own tabs

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

    _OwnTabSwitch($aCtrlTab, 1)

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

    GUISetState()

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

    Local $msg
    Do
    $msg = GUIGetMsg()
    For $a = 1 To UBound($aCtrlTab, 1) - 1
    If $msg = $aCtrlTab[$a][0] Then _OwnTabSwitch($aCtrlTab, $a)
    Next
    Sleep(10)
    Until $msg = -3

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

    Func _OwnTabCreate($aTabText, $xPos, $yPos, $iWidth, $iHeight, $iItemHeight = -1, $nColNoSel = -1, $nColSel = -1, $nColBg = -1)
    Local $aSize, $aSize2[UBound($aTabText)][2], $xLast = 0, $aCtrl[UBound($aTabText) + 1][5]
    If Not IsArray($aTabText) Then Return SetError(1, 0, "")
    For $i = 0 To UBound($aTabText) - 1
    If $aTabText[$i] = "" Then Return SetError(2, $i + 1, "")
    $aSize = _GetTextSize($aTabText[$i])
    $aSize[0] += Ceiling($aSize[0] / 10) ;make it 10% longer for bold text
    $aSize2[$i][0] = $aSize[0]
    $aSize2[$i][1] = $aSize[1]
    If $iItemHeight = -1 Then $iItemHeight = $aSize[1]
    $aCtrl[$i + 1][0] = GUICtrlCreateLabel($aTabText[$i], $xPos + $xLast + 5, $yPos + 2, $aSize[0] + 5, $iItemHeight, 0x411201)
    $aCtrl[$i + 1][2] = $nColNoSel
    $aCtrl[$i + 1][3] = $nColSel
    $xLast += $aSize[0] + 5
    Next
    GUICtrlCreateLabel("", $xPos, $yPos + $iItemHeight, $iWidth, $iHeight, 0x411000)
    GUICtrlSetState(-1, 128) ;$GUI_DISABLE
    GUICtrlSetBkColor(-1, $nColBg)
    $xLast = 0
    For $i = 0 To UBound($aTabText) - 1
    $aCtrl[$i + 1][1] = GUICtrlCreateLabel("", $xPos + $xLast + 6, $yPos + $iItemHeight, $aSize2[$i][0] + 3, 2)
    GUICtrlSetBkColor(-1, $nColSel)
    $xLast += $aSize2[$i][0] + 5
    Next
    Return $aCtrl
    EndFunc ;==>_OwnTabCreate

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

    Func _OwnTabSwitch($aOwnTab, $iIndex)
    Local $iSwitch = $iIndex
    For $s = 1 To UBound($aOwnTab, 1) - 1
    If $iIndex <> $s Then
    GUICtrlSetState($aOwnTab[$s][1], 32) ;$GUI_HIDE
    GUICtrlSetBkColor($aOwnTab[$s][0], $aOwnTab[$s][2])
    GUICtrlSetFont($aOwnTab[$s][0], -1, 400)
    Else
    GUICtrlSetBkColor($aOwnTab[$iIndex][0], $aOwnTab[$s][3])
    GUICtrlSetFont($aOwnTab[$iIndex][0], -1, 1000)
    GUICtrlSetState($aOwnTab[$iIndex][1], 16) ;$GUI_SHOW
    EndIf
    Next
    For $t = $aOwnTab[0][4] To $aOwnTab[UBound($aOwnTab, 1) - 1][4]
    GUICtrlSetState($t, 32) ;$GUI_HIDE
    If $t > $aOwnTab[$iIndex - 1][4] And $t < $aOwnTab[$iIndex][4] Then GUICtrlSetState($t, 16) ;$GUI_SHOW
    Next
    EndFunc ;==>_OwnTabSwitch

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

    Func _GetTextSize($nText, $sFont = 'Microsoft Sans Serif', $iFontSize = 8.5, $iFontAttributes = 0)
    ;Author: Bugfix
    ;Modified: funkey
    If $nText = '' Then Return
    Local $hGui = GUICreate("Textmeter by Bugfix")
    _GDIPlus_Startup()
    Local $hFormat = _GDIPlus_StringFormatCreate(0)
    Local $hFamily = _GDIPlus_FontFamilyCreate($sFont)
    Local $hFont = _GDIPlus_FontCreate($hFamily, $iFontSize, $iFontAttributes, 3)
    Local $tLayout = _GDIPlus_RectFCreate(15, 171, 0, 0)
    Local $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)
    Local $aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $nText, $hFont, $tLayout, $hFormat)
    Local $iWidth = Ceiling(DllStructGetData($aInfo[0], "Width"))
    Local $iHeight = Ceiling(DllStructGetData($aInfo[0], "Height"))
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
    GUIDelete($hGui)
    Local $aSize[2] = [$iWidth, $iHeight]
    Return $aSize
    EndFunc ;==>_GetTextSize

    [/autoit]
  • StringRegExp - Geht nicht

    • funkey
    • 11. November 2009 um 17:26

    Geht das auch?

    [autoit]

    $Text = "Moin!!!Zeile 1" & @CRLF & "Wie gehts?"
    $Text = StringTrimLeft($Text, StringInStr($Text, "!!!") + 2)
    MsgBox(0, "", $Text)

    [/autoit]


    Edit: Oder so?

    [autoit]

    $Text = "Moin!!!Zeile 1" & @CRLF & "Wie gehts?"
    $Text = StringRegExpReplace($Text, ".+!!!", "")
    MsgBox(0, "", $Text)

    [/autoit]
  • Eigenes Tab-Register (OwnTab-UDF)

    • funkey
    • 11. November 2009 um 14:17

    Neue Version ;)
    Grafisch etwas verbessert und außerdem sind nun mehrere Tabs möglich.

    Spoiler anzeigen
    [autoit]

    #Include <GDIPlus.au3>

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

    GUICreate("Funkey's Own Tabs ;)", 500, 700)
    Local $aTabText[4] = ["Item 1", "Longer Item 2", "3rd Item", "Tab in Tab"] ;Declare the regions for the OwnTab-control

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

    Global $aCtrlTab = _OwnTabCreate($aTabText, 10, 10, 480, 300, 25, -1, 0x00FF00, 0x00FF00)

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

    #Region Tab1
    $aCtrlTab[0][4] = GUICtrlCreateDummy() ;Start controls tab1
    Global $Edit1 = GUICtrlCreateEdit("Edit in Tab1", 20, 50, 300, 50)
    Global $Label1 = GUICtrlCreateLabel("Label in Tab1", 20, 100, 300, 20)
    #EndRegion

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

    #Region Tab2
    $aCtrlTab[1][4] = GUICtrlCreateDummy() ;Start controls tab2
    Global $Edit2 = GUICtrlCreateEdit("Edit in Tab2", 20, 150, 300, 50)
    Global $Label2 = GUICtrlCreateLabel("Label in Tab2", 20, 200, 300, 20)
    #EndRegion

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

    #Region Tab3
    $aCtrlTab[2][4] = GUICtrlCreateDummy() ;Start controls tab3
    Global $Edit3 = GUICtrlCreateEdit("Edit in Tab3", 20, 250, 300, 50)
    Global $Label3 = GUICtrlCreateLabel("Label in Tab3", 20, 300, 300, 20)
    #EndRegion

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

    #Region Tab4
    $aCtrlTab[3][4] = GUICtrlCreateDummy() ;Start controls tab4
    Local $aTabText[2] = ["Test 1", "Test 2"] ;Declare the regions for the OwnTab-control
    Global $aCtrlTab2 = _OwnTabCreate($aTabText, 50, 50, 280, 100, 25, 0xFF0000, 0xFFFF00, 0xFFFF00)

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

    #Region Tab1 in Tab4
    $aCtrlTab2[0][4] = GUICtrlCreateDummy() ;Start controls tab1
    Global $Edit41 = GUICtrlCreateEdit("Edit in Tab1 in Tab4", 70, 100, 200, 70)
    #EndRegion

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

    #Region Tab2 in Tab4
    $aCtrlTab2[1][4] = GUICtrlCreateDummy() ;Start controls tab1
    Global $Button42 = GUICtrlCreateButton("A Button in a tab in a tab", 70, 100, 200, 30)
    #EndRegion

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

    $aCtrlTab2[2][4] = GUICtrlCreateDummy() ;End controls for tab in tab
    $aCtrlTab[4][4] = GUICtrlCreateDummy() ;End controls for tab

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

    GUICtrlCreateLabel("Label unterhalb des OwnTab", 20, 350, 300, 20)

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

    Local $aTabText[2] = ["Buttons Page 1", "Buttons Page 2"] ;Declare the regions for the OwnTab-control
    Global $aCtrlTab3 = _OwnTabCreate($aTabText, 10, 400, 400, 250, 20, 0xaaaaaa, 0xffff, 0xffff)

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

    #Region Tab1
    $aCtrlTab3[0][4] = GUICtrlCreateDummy() ;Start controls tab1
    Global $Button11 = GUICtrlCreateButton("Button1", 20, 440, 80, 30)
    Global $Button12 = GUICtrlCreateButton("Button2", 20, 480, 80, 30)
    Global $Button13 = GUICtrlCreateButton("Button3", 20, 520, 80, 30)
    Global $Button14 = GUICtrlCreateButton("Button4", 20, 560, 80, 30)
    Global $Button15 = GUICtrlCreateButton("Button5", 20, 600, 80, 30)
    #EndRegion

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

    #Region Tab2
    $aCtrlTab3[1][4] = GUICtrlCreateDummy() ;Start controls tab2
    Global $Button21 = GUICtrlCreateButton("Button6", 20, 440, 80, 30)
    Global $Button22 = GUICtrlCreateButton("Button7", 20, 480, 80, 30)
    Global $Button23 = GUICtrlCreateButton("Button8", 20, 520, 80, 30)
    Global $Button24 = GUICtrlCreateButton("Button9", 20, 560, 80, 30)
    Global $Button25 = GUICtrlCreateButton("Button10", 20, 600, 80, 30)
    #EndRegion

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

    $aCtrlTab3[2][4] = GUICtrlCreateDummy() ;End controls for tab in tab

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

    Global $MemTabInTab1 = 4 ; This variable shows where the tab in tab is.
    Global $MemTabInTab2 = 1 ; Variable to remember what register in the tab in tab was selected

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

    _OwnTabSwitch($aCtrlTab3, 1) ; show first tab-register in tab in tab
    _OwnTabSwitch($aCtrlTab2, $MemTabInTab2) ; show first tab-register in tab in tab
    _OwnTabSwitch($aCtrlTab, 1) ; show first tab-register

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

    GUISetState()

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

    Local $msg
    Do
    $msg = GUIGetMsg()
    For $a = 1 To UBound($aCtrlTab, 1) - 1
    If $msg = $aCtrlTab[$a][0] Then
    _OwnTabSwitch($aCtrlTab, $a)
    If $a = $MemTabInTab1 Then _OwnTabSwitch($aCtrlTab2, $MemTabInTab2)
    EndIf
    Next
    For $a = 1 To UBound($aCtrlTab2, 1) - 1
    If $msg = $aCtrlTab2[$a][0] Then
    _OwnTabSwitch($aCtrlTab2, $a)
    $MemTabInTab2 = $a ;remember the selected register
    EndIf
    Next
    For $a = 1 To UBound($aCtrlTab3, 1) - 1
    If $msg = $aCtrlTab3[$a][0] Then _OwnTabSwitch($aCtrlTab3, $a)
    Next
    Sleep(10)
    Until $msg = -3

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

    Func _OwnTabCreate($aTabText, $xPos, $yPos, $iWidth, $iHeight, $iItemHeight = -1, $nColNoSel = -1, $nColSel = -1, $nColBg = -1)
    Local $aSize, $xLast = 0, $aCtrl[UBound($aTabText) + 1][5]
    If Not IsArray($aTabText) Then Return SetError(1, 0, "")
    GUICtrlCreateLabel("", $xPos, $yPos + $iItemHeight, $iWidth, $iHeight, 0x1000)
    GUICtrlSetState(-1, 128) ;$GUI_DISABLE
    GUICtrlSetBkColor(-1, $nColBg)
    For $i = 0 To UBound($aTabText) -1
    If $aTabText[$i] = "" Then Return SetError(2, $i+1, "")
    $aSize = _GetTextSize($aTabText[$i])
    If $iItemHeight = -1 Then $iItemHeight = $aSize[1]
    $aCtrl[$i+1][0] = GUICtrlCreateLabel($aTabText[$i], $xPos + $xLast + 2, $yPos + 2, $aSize[0] + 5, $iItemHeight, BitOR(0x201, 0x411000))
    $aCtrl[$i+1][1] = GUICtrlCreateLabel("", $xPos + $xLast + 4, $yPos + $iItemHeight, $aSize[0] + 1, 2)
    GUICtrlSetBkColor(-1, $nColSel)
    $aCtrl[$i+1][2] = $nColNoSel
    $aCtrl[$i+1][3] = $nColSel
    $xLast += $aSize[0] + 5
    Next
    Return $aCtrl
    EndFunc

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

    Func _OwnTabSwitch($aOwnTab, $iIndex)
    Local $iSwitch = $iIndex
    For $s = 1 To UBound($aOwnTab, 1) - 1
    If $iIndex <> $s Then
    GUICtrlSetState($aOwnTab[$s][1], 32) ;$GUI_HIDE
    GUICtrlSetBkColor($aOwnTab[$s][0], $aOwnTab[$s][2])
    Else
    GUICtrlSetBkColor($aOwnTab[$iIndex][0], $aOwnTab[$s][3])
    GUICtrlSetState($aOwnTab[$iIndex][1], 16) ;$GUI_SHOW
    EndIf
    Next
    For $t = $aOwnTab[0][4] To $aOwnTab[UBound($aOwnTab, 1)-1][4]
    GUICtrlSetState($t, 32) ;$GUI_HIDE
    If $t > $aOwnTab[$iIndex-1][4] And $t < $aOwnTab[$iIndex][4] Then GUICtrlSetState($t, 16) ;$GUI_SHOW
    Next
    EndFunc

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

    Func _GetTextSize($nText, $sFont = 'Microsoft Sans Serif', $iFontSize = 8.5, $iFontAttributes = 0)
    ;Author: Bugfix
    ;Modified: funkey
    If $nText = '' Then Return
    Local $hGui = GUICreate("Textmeter by Bugfix")
    _GDIPlus_Startup()
    Local $hFormat = _GDIPlus_StringFormatCreate(0)
    Local $hFamily = _GDIPlus_FontFamilyCreate($sFont)
    Local $hFont = _GDIPlus_FontCreate($hFamily, $iFontSize, $iFontAttributes, 3)
    Local $tLayout = _GDIPlus_RectFCreate(15, 171, 0, 0)
    Local $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)
    Local $aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $nText, $hFont, $tLayout, $hFormat)
    Local $iWidth = Ceiling(DllStructGetData($aInfo[0], "Width"))
    Local $iHeight = Ceiling(DllStructGetData($aInfo[0], "Height"))
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
    GUIDelete($hGui)
    Local $aSize[2] = [$iWidth, $iHeight]
    Return $aSize
    EndFunc ;==>_GetTextSize

    [/autoit]
  • schwierige frage^^

    • funkey
    • 10. November 2009 um 19:08

    Bitte lesen: :cursing:
    http://www.autoit.de/index.php?page=Forumrules

  • Eigenes Tab-Register (OwnTab-UDF)

    • funkey
    • 10. November 2009 um 17:42

    Danke fürs Testen! Vllt baue ich das ganze dann noch aus, dass man verschiedene Styles verwenden könnte und mehrere Tabs in einer Gui platzieren kann.

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™