Modify

Opened 17 years ago

Closed 17 years ago

Last modified 16 years ago

#256 closed Bug (Fixed)

Multiple windows and tab controls

Reported by: Jon Owned by: Jon
Milestone: 3.2.13.0 Component: AutoIt
Version: 3.2.11.12 Severity: Blocking
Keywords: gui tab Cc:

Description

With multiple windows and tab controls when you select a tab on one window the controls on BOTH windows change.

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)
Opt("GUIOnEventMode", 1)

Global $ex1winh, $ex2winh, $btn, $btn2, $tab, $othertab

Example()
Win2()
Main()
Exit

Func Main()
While 1
        Sleep(200)
WEnd
EndFunc;==>Main

Func Example()
    Local $tab0, $tab0OK, $tab0input
    Local $tab1, $tab1combo, $tab1OK
    Local $tab2, $tab2OK, $msg
    
   $ex1winh        =     GUICreate("My GUI Tab",300,200,50,50) 
                    GuiSetOnEvent($GUI_EVENT_CLOSE, "evtClose")

                    GUISetBkColor(0x00E0FFFF)
                    GUISetFont(9, 300)

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

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

    $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)

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

                    GUICtrlCreateTabItem("")   ; end tabitem definition
                    GUICtrlCreateLabel("label3", 20, 130, 50, 20)

    GUISetState()

EndFunc  ;==>Example

Func Win2()
    Local $tab0, $tab0OK, $tab0input
    Local $tab1, $tab1combo, $tab1OK
    Local $tab2, $tab2OK, $msg
    Local $tab3, $tab3OK
    ConsoleWrite("call btn" & @LF)
   $ex2winh        =     GUICreate("My 2nd GUI Tab",300,200,200,200)
                    GuiSetOnEvent($GUI_EVENT_CLOSE, "evtClose")

                    GUISetBkColor(0x00E0FFFF)
                    GUISetFont(9, 300)

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

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

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

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

    $tab3         =    GUICtrlCreateTabItem("otab3")
                    GUICtrlSetState(-1, $GUI_SHOW) ; will be display first
                    GUICtrlCreateLabel("label3", 30, 80, 50, 20)
    $tab3OK     =    GUICtrlCreateButton("OK3", 140, 50, 50)

                    GUICtrlCreateTabItem("")   ; end tabitem definition
                    GUICtrlCreateLabel("label3", 20, 130, 50, 20)

    GUISetState()

EndFunc  ;==>Example2

func fake()
; insert code here
EndFunc ;==>fake

Func evtClose()
        GUIDelete(@GUI_WINHANDLE)
        Exit
EndFunc;==>evtClose

Attachments (0)

Change History (2)

comment:1 Changed 17 years ago by Jon

  • Milestone set to 3.2.11.13
  • Owner changed from Jpm to Jon
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed in version: 3.2.11.13

comment:2 Changed 16 years ago by Valik

  • Milestone changed from 3.2.11.13 to 3.2.13.0

Fixing wrong milestone.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jon.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.