Auslesen welcher Tab aktiv ist

  • Frage -> Kann mann auslesen welcher tab aktiv ist und wenn ja wie

    hier das script wo es rein soll
    Dieses Script benötigt weitere includes(XSkin)

    Spoiler anzeigen
    [autoit]

    #region ### Include ###
    #include <GUIConstantsEx.au3>
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <TabConstants.au3>
    #include <WindowsConstants.au3>
    #include <IE.au3>
    #include <WindowsConstants.au3>
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <TabConstants.au3>
    #include <WindowsConstants.au3>
    #include <Misc.au3>
    #include <ComboConstants.au3>
    #include <sound.au3>
    #include <date.au3>
    #include <XSkin.au3>
    #include <XSkinAnimate.au3>
    Dim $XSkinTab[100],$ieo[100],$XskinIE[100],$XSkinUrl[100],$XSkinGo[100]
    $TabCount = 1
    Global $ini = @TempDir & "\Softera\Config.nsc"
    $skinchoice = IniRead($ini, "MAIN", "skin", "Blackhole")
    $ieo[$TabCount] =_IECreateEmbedded()
    #endregion ### Include ###
    HotKeySet("{esc}", '_exit')
    $skin_Folder = 'Skin\' & $skinchoice & "\"
    $icon_Folder = 'Skin\Default\'
    $XSkinGui = XSkinGuiCreate("Softera", @DesktopWidth + 8, @DesktopHeight - 20, $skin_Folder)
    $addtab = XSkinButton("+", @DesktopWidth - 38, 50, 18, 18, '_addTab')
    $deltab = XSkinButton("-", @DesktopWidth - 38, 50+18, 18, 18, '_delTab')
    $XSkinTab[0] = GUICtrlCreateTab(50, 50, @DesktopWidth - 90, @DesktopHeight - 20)
    $XSkinTab[$TabCount] = GUICtrlCreateTabItem("Tab " & $TabCount)
    $XskinIE[$TabCount] =GUICtrlCreateObj($ieo[$TabCount], 55, 95, @DesktopWidth - 100, @DesktopHeight - 165)
    $XSkinUrl[$TabCount] = GUICtrlCreateInput("www.Neon-Soft.de.tl",55,75,@DesktopWidth-140,20)
    $XSkinGo[$TabCount] = XSkinButton("GO",@DesktopWidth-80,75,30,20,'_GO')
    GUICtrlCreateTabItem("")
    $XIcon = XSkinIcon($XSkinGui, 3)
    GUISetState(@SW_SHOW)
    _IENavigate($ieo[$TabCount],"http://www.Neon-Soft.de.tl")
    While 1
    $nmsg = GUIGetMsg()
    If $nmsg = $XIcon[1] Then _exit()
    If $nmsg = $XIcon[2] Then _minimize()
    If $nmsg = $XIcon[3] Then _config()
    mouseover()
    WEnd
    Func _GO()
    ;MsgBox(0,"Debug","Aktiver Tab "&GUICtrlRead($XSkinTab[0])+1&@CRLF&"Ausgelesene url :http://"&GUICtrlRead($XSkinUrl[GUICtrlRead($XSkinTab[0])+1]))
    _IENavigate($ieo[GUICtrlRead($XSkinTab[0])+1],"http://"&GUICtrlRead($XSkinUrl[GUICtrlRead($XSkinTab[0])+1]))
    EndFunc
    Func _delTab()
    if $TabCount > 1 Then
    Global $TabCountNew = $TabCount - 1
    Global $TabCount = $TabCountNew
    GUICtrlDelete(GUICtrlRead($XSkinTab[0],1))
    Else
    XSkinMSGBoxOk(".","Keine Tabs mehr zum löschen übrig!")
    EndIf
    EndFunc
    Func _addTab()
    If $TabCount < 100 Then
    Global $TabCountNew = $TabCount + 1
    Global $TabCount = $TabCountNew
    $XSkinTab[$TabCount] = GUICtrlCreateTabItem("Tab " & $TabCount)
    $XskinIE[$TabCount] =GUICtrlCreateObj($ieo[$TabCount], 55, 95, @DesktopWidth - 100, @DesktopHeight - 165)
    $XSkinUrl[$TabCount] = GUICtrlCreateInput("www.Neon-Soft.de.tl",55,75,@DesktopWidth-140,20)
    $XSkinGo[$TabCount] = XSkinButton("GO",@DesktopWidth-80,75,30,20,'_GO')
    GUICtrlCreateTabItem("")
    Else
    XSkinMSGBoxOk(".", "Maximale anzahl an Tabs Erreicht!")
    EndIf
    EndFunc ;==>_addTab
    Func _Exit()
    Exit
    EndFunc ;==>_Exit
    Func _minimize()
    GUISetState(@SW_MINIMIZE, $XSkinGui)
    EndFunc ;==>_minimize
    Func _Config()
    XSkinMSGBoxOk("Softera", "Config")
    EndFunc ;==>_Config

    [/autoit]

    Edit: Schon erledigt!

  • Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>

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

    Opt('MustDeclareVars', 1)

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

    Example()

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

    Func Example()
    Local $tab, $tab0, $tab0OK, $tab0input
    Local $tab1, $tab1combo, $tab1OK
    Local $tab2, $tab2OK, $witchTab, $msg

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

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

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

    GUISetBkColor(0x00E0FFFF)
    GUISetFont(9, 300)

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

    $tab = GUICtrlCreateTab(10, 10, 200, 100)

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

    $tab0 = GUICtrlCreateTabItem("tab0")
    GUICtrlCreateLabel("label0", 30, 80, 50, 20)
    $tab0OK = GUICtrlCreateButton("OK0", 20, 50, 50, 20)
    $tab0input = GUICtrlCreateInput("default", 80, 50, 70, 20)

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

    $tab1 = GUICtrlCreateTabItem("tab----1")
    GUICtrlCreateLabel("label1", 30, 80, 50, 20)
    $tab1combo = GUICtrlCreateCombo("", 20, 50, 60, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon") ; default Jon
    $tab1OK = GUICtrlCreateButton("OK1", 80, 50, 50, 20)

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

    $tab2 = GUICtrlCreateTabItem("tab2")
    GUICtrlSetState(-1, $GUI_SHOW) ; will be display first
    GUICtrlCreateLabel("label2", 30, 80, 50, 20)
    $tab2OK = GUICtrlCreateButton("OK2", 140, 50, 50)

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

    GUICtrlCreateTabItem("") ; end tabitem definition

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

    GUICtrlCreateLabel("label3", 20, 130, 50, 20)
    $witchTab = GUICtrlCreateButton("welcher Tb ist aktiv?",10,350)
    GUISetState()

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

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

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

    Switch $msg
    Case $GUI_EVENT_CLOSE
    ExitLoop
    Case $tab
    MsgBox(0,"aktiver Tab",GUICtrlRead($tab))
    Case $witchTab
    MsgBox(0,"aktiver Tab",GUICtrlRead($tab))
    EndSwitch
    WEnd
    EndFunc

    [/autoit]

    ;==>Example

    ausserdem gint es noch:

    Zitat

    _GUICtrlTab_GetCurSel -------------------

    Ermittelt den aktuell markierten Tab

    zu beachten ist, dass die Zählung beu 0 anfängt.

    Einmal editiert, zuletzt von autoBert (5. November 2012 um 03:11)