Jump to content
Sign in to follow this  
lsakizada

Resizing nested tabs

Recommended Posts

lsakizada

Hi,

Can you please help me on that issue?

In the example bellow I am trying to use the GUICtrlSetResizing method to resize a nested tabs.

I want all tabs to be resized together with the parents tabs.

Nothing works for me, and I was unable to figure out how to make it.

Please folow the GUICtrlSetResizing in the example bellow.

Please can you help me.?

#include <GUIConstants.au3>

$main_GUI            = GUICreate("Tab Sample", 600, 400, -1, -1,BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX))
GUISetState()
$child1                = GUICreate("", 370, 215, 15, 40, BitOr($WS_CHILD,$WS_TABSTOP), -1, $main_GUI)
$child1_tab         = GUICtrlCreateTab(0, 0, 370, 215,BitAND($TCS_MULTILINE ,$TCS_VERTICAL))
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKHEIGHT)
$child1_tabitem1    = GUICtrlCreateTabItem(" Child1Tab1 ")
$child1_tabitem2    = GUICtrlCreateTabItem(" Child1Tab2 ")
$child1_tabitem3    = GUICtrlCreateTabItem(" Child1Tab3 ")
GUICtrlCreateTabItem("")
GUISetState()
$child2                = GUICreate("", 370, 215, 15, 40, BitOr($WS_CHILD,$WS_TABSTOP), -1, $main_GUI)
GUISwitch($child2)
$child2_tab            = GUICtrlCreateTab(0, 0, 370, 215)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKHEIGHT)
$child2_tabitem1    = GUICtrlCreateTabItem("Child2Tab1")
$child2_tabitem2    = GUICtrlCreateTabItem("Child2Tab2")
GUICtrlCreateTabItem("")
GUISetState()
$child3                = GUICreate("", 370, 215, 15, 40, BitOr($WS_CHILD,$WS_TABSTOP), -1, $main_GUI)
GUISwitch($child3)
$child3_tab            = GUICtrlCreateTab(0, 0, 370, 215)
GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKHEIGHT)
$child3_tabitem1    = GUICtrlCreateTabItem("Child3Tab1")
$Group1 = GUICtrlCreateGroup("AGroup1", 48, 64, 185, 105)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$child3_tabitem2    = GUICtrlCreateTabItem("Child3Tab2")
GUISetState()
GUICtrlCreateTabItem("")
GUISetState()
GUISwitch($main_GUI)
$main_tab            = GUICtrlCreateTab(10, 10, 480, 250)
GUICtrlSetResizing($main_tab, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKHEIGHT)
$main_tabitem1        = GUICtrlCreateTabItem("MainTab1")
$main_tabitem2        = GUICtrlCreateTabItem("MainTab2")
$main_tabitem3        = GUICtrlCreateTabItem("MainTab3")
GUICtrlCreateTabItem("")
GUICtrlSetState($main_tabitem1,$GUI_SHOW)

While 1
    $msg = GUIGetMsg(1)
    Select
        Case $msg[0] = $GUI_EVENT_CLOSE 
            ExitLoop
            
        Case $msg[0] = $main_tab
            $tabidx = GUICtrlRead($main_tab)
            Select 
                Case $tabidx = 0
                    GUISetState(@SW_SHOW, $child1)
                    GUISetState(@SW_HIDE, $child2)
                    GUISetState(@SW_HIDE, $child3)
            
                Case $tabidx = 1
                    GUISetState(@SW_HIDE, $child1)
                    GUISetState(@SW_SHOW, $child2)
                    GUISetState(@SW_HIDE, $child3)
                Case $tabidx = 2
                    GUISetState(@SW_HIDE, $child1)
                    GUISetState(@SW_HIDE, $child2)
                    GUISetState(@SW_SHOW, $child3)
                
            EndSelect
    EndSelect
WEnd

Exit

Be Green Now or Never (BGNN)!

Share this post


Link to post
Share on other sites
evilertoaster

Nested tabs dont work in autoit...what you posted is sort of a work around by making several GUI windows and having tabes in each of them, but the problem is you can't then apply attributes to the tabs and expect them to act like controls of the main window (because they arn't). What you would probably need to do isntead is tell the GUI child windows to resize with the parent not the tab controls themselfs...unfortuatly i don't see an option for this in GUIcreate()....but maybe it will acccept the functionality of guictrlset when used like a child...

Edit: Also there was someone working with this a while back and seemed to have some luck with it- http://www.autoitscript.com/forum/index.php?showtopic=13934

Edited by evilertoaster

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×