Tab inside a tab problem Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
DoriTos_
Posts: 16
Joined: 15 Mar 2021, 08:30

Tab inside a tab problem

16 Jun 2021, 13:56

Hello, I'm having a problem with a tab inside a tab
When using Tab3 this bug happen:
Image

This is a bug of tab3? i don't know a way to solve this, can someone help me?

Code: Select all

#SingleInstance, Force

Gui, Add, Tab3, x5 y30 w695 h495 vSecond_Tab, a|b|c
Gui, Tab

Gui, Add, Tab3, x5 y1 w695 h495 vMain_Tab, 1|2|3

Gui, Add, Text, x25 y+70, Text test 
Gui, Add, Radio, x25 y+20, Radio
Gui, Add, GroupBox, x20 y+20, GroupBox
Gui, Tab

Gui, Show, w250 h300, Program
Using Tab2 It works! but i don't want to use it because of the gray background in the text, combobox, etc...
Image

Code: Select all

#SingleInstance, Force

Gui, Add, Tab2, x5 y30 w695 h495 vSecond_Tab +Theme, a|b|c
Gui, Tab

Gui, Add, Tab2, x5 y1 w695 h495 vMain_Tab +Theme, 1|2|3

Gui, Add, Text, x25 y+70, Text test 
Gui, Add, Radio, x25 y+20, Radio
Gui, Add, GroupBox, x20 y+20, GroupBox
Gui, Tab

Gui, Show, w250 h300, Program
User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: Tab inside a tab problem

16 Jun 2021, 16:09

I see that the Tab3 controls cannot be overlapped, but I do not understand how you would use an approach of overlapping controls anyway. Your other controls are actually on tab 1. If you move them to tab a, you still cannot use the numbered controls with this layout.
DoriTos_
Posts: 16
Joined: 15 Mar 2021, 08:30

Re: Tab inside a tab problem

16 Jun 2021, 20:19

mikeyww wrote:
16 Jun 2021, 16:09
I see that the Tab3 controls cannot be overlapped, but I do not understand how you would use an approach of overlapping controls anyway. Your other controls are actually on tab 1. If you move them to tab a, you still cannot use the numbered controls with this layout.
This is just an example, I want it to work the same it works in tab2, but i can't make it work
User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: Tab inside a tab problem

16 Jun 2021, 21:44

OK. It seems to me that the Tab2 also does not provide functionality when the controls are on top of each other. I do not understand how such controls would be used.
just me
Posts: 9453
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Tab inside a tab problem

17 Jun 2021, 04:00

Tab3 wrote:Limits: Each window may have no more than 255 tab controls. Each tab control may have no more than 256 tabs (pages). In addition, a tab control may not contain other tab controls.

Source
teadrinker
Posts: 4326
Joined: 29 Mar 2015, 09:41
Contact:

Re: Tab inside a tab problem  Topic is solved

17 Jun 2021, 05:22

There is one trick:

Code: Select all

Gui, Main:New
Gui, Margin, 0, 0
Gui, Add, Tab3, hwndhTab vMainTab w400 h300 gMainTab AltSubmit, Tab 1|Tab 2|Tab 3
hParent := DllCall("GetWindow", "Ptr", hTab, "UInt", GW_HWNDNEXT := 2, "Ptr")
WinGetPos,,, W, H, ahk_id %hParent%
scale := A_ScreenDPI/96
W /= scale, H /= scale

Loop 3 {
   Gui, Tab%A_Index%:New, +Parent%hParent% -Caption +ToolWindow
   Gui, Add, Tab3, % "x" 5 " y" 5 " w" W - 20 " h" H - 20, Tab %A_Index%-1|Tab %A_Index%-2|Tab %A_Index%-3
   Gui, Add, Edit, w200 h100, Edit %A_Index%-1
   Gui, Tab, 2
   Gui, Add, Button, gOnClick w100, Button %A_Index%-2
   Gui, Tab, 3
   Gui, Add, Progress, % "w200 h20 c" Format("{:X}", 0xFF << (A_Index - 1)*8), % 100 * A_Index/3
   Gui, Show, % "Hide x5 y6 w" W - 10 " h" H - 10
}
Gui, Tab1:Show, NA

Gui,Main: Show, w400 h300
Return

OnClick:
   MsgBox, % A_GuiControl
   Return
   
MainTab:
   Gui, Tab%MainTab%:Show, Hide
   GuiControlGet, MainTab, Main:
   Gui, Tab%MainTab%:Show, NA
   Return
   
MainGuiClose:
   ExitApp
User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: Tab inside a tab problem

17 Jun 2021, 06:13

Thanks for both. I had seen the limitation about tab inside tab, but it seemed that the goal here was not to do that, but to have two separate but overlapping tab areas-- hence my confusion about it. In any case, when I tried teadrinker's script, it worked!
just me
Posts: 9453
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Tab inside a tab problem

17 Jun 2021, 06:58

@mikeyww, it might be just me being confused. ;)
DoriTos_
Posts: 16
Joined: 15 Mar 2021, 08:30

Re: Tab inside a tab problem

18 Jun 2021, 15:59

Thanks everyone for the answers

@teadrinker
Your code worked well, now i will adapt to my script and test it more deeply, thanks.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: scriptor2016 and 326 guests