v2: Fail to create Tab control Topic is solved

Report problems with documented functionality
User avatar
aseiot
Posts: 51
Joined: 05 Mar 2017, 04:25

v2: Fail to create Tab control

01 Jul 2020, 05:21

Fail to create Tab control, Following is an example code in help file:

Code: Select all

MyGui := Gui.New()
Tab := MyGui.Add("Tab3",, ["First Tab","Second Tab","Third Tab"])
MyGui.Add("Checkbox", "vMyCheckbox", "Sample checkbox") 
Tab.UseTab(2)
MyGui.Add("Radio", "vMyRadio", "Sample radio1")
MyGui.Add("Radio",, "Sample radio2")
Tab.UseTab(3)
MyGui.Add("Edit", "vMyEdit r5")  ; r5 means 5 rows tall.
Tab.UseTab()  ; i.e. subsequently-added controls will not belong to the tab control.
Btn := MyGui.Add("Button", "default xm", "OK")  ; xm puts it at the bottom left corner.
Btn.OnEvent("Click", (*) => ProcessUserInput(Gui))
MyGui.OnEvent("Close", "ProcessUserInput")
MyGui.OnEvent("Escape", "ProcessUserInput")
MyGui.Show()

ProcessUserInput(this, *)
{
    Saved := this.Submit()  ; Save the contents of named controls into an object.
    MsgBox("You entered:`n" Saved.MyCheckbox "`n" Saved.MyRadio "`n" Saved.MyEdit)
}
User avatar
Ragnar
Posts: 320
Joined: 30 Sep 2013, 15:25

Re: v2: Fail to create Tab control

01 Jul 2020, 06:03

If you mean the error which occurs after pressing OK, fix it by replacing ProcessUserInput(Gui) with ProcessUserInput(MyGui).

If you mean the display issues (no tabs etc.), you are right - it is a bug. This seems to affect only "Tab3" and "Tab2". "Tab" works correctly.
User avatar
kczx3
Posts: 1118
Joined: 06 Oct 2015, 21:39

Re: v2: Fail to create Tab control

01 Jul 2020, 20:13

I am seeing the same thing as Ragnar
User avatar
aseiot
Posts: 51
Joined: 05 Mar 2017, 04:25

Re: v2: Fail to create Tab control

05 Jul 2020, 19:29

Ragnar wrote:
01 Jul 2020, 06:03
If you mean the error which occurs after pressing OK, fix it by replacing ProcessUserInput(Gui) with ProcessUserInput(MyGui).

If you mean the display issues (no tabs etc.), you are right - it is a bug. This seems to affect only "Tab3" and "Tab2". "Tab" works correctly.
Yes, I mean display issues.
lexikos
Posts: 6964
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: v2: Fail to create Tab control  Topic is solved

06 Jul 2020, 05:43

There are two bugs:
  1. The Text parameter of MyGui.Add is ignored by Tab3 and Tab2, so the control actually has no tabs.
  2. The position of the tab dialog (the window that contains a Tab3's controls) is not updated when tabs are added, only when the Tab control is moved.
You can work around it like this:

Code: Select all

MyGui := Gui.New()
Tab := MyGui.Add("Tab3")
Tab.Add(["First Tab","Second Tab","Third Tab"])
Tab.GetPos(x)
Tab.Move(x)
MyGui.Show()
Or get v2.0-a115.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 5 guests