Sign in to follow this  
Followers 0
GEOSoft

Tab in tab

8 posts in this topic

I have a GUI that uses a Tab control with 4 TabItem controls. I would like to add a Tab Control and 5 tabItems on the last of the current tabs. Is this at all possible as is or do we have to wait for a later version? Even if I had to add the new tab within a group on the last of the existing tab pages would be fine.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites



Nested tab controls (or even multiple tab controls) are not suppported by the current gui implementation.

However, It would be possible to simulate a tab control by having a row of buttons that, when clicked, show and hide different controls. I'll see if I can get something working...


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Thanks CS.

No big rush, It's my busy season so I am only home about 1 day a week right now anyway.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Since there is no hurry, here is Hard-coded, rather ugly example that might or might not work with the newest AutoIt builds...

#cs - ### Generated by AutoBuilder 0.4 -- do not modify ###
394 271
0   3   0   0   0   0   1   0   0   0   0   0   0   0   0   0   
group   $group_1    Group 1 40  40  330 210 0   0   
button  $button_1   Button 1    40  30  100 20  0   0   
button  $button_2   Button 2    150 30  100 20  0   0   
button  $button_3   Button 3    260 30  110 20  0   0   
#ce - ### End of Dump ###

;Script generated by AutoBuilder 0.4 - but modified a lot

Global $GUI_SHOW     = 16
Global $GUI_HIDE    = 32
Global $GUI_ENABLE   = 64
Global $GUI_DISABLE      = 128
Global $GUI_DEFBUTTON  = 512

Opt("GUINotifyMode", 1)
GuiCreate("MyGUI", 392,266,(@DesktopWidth-392)/2, (@DesktopHeight-266)/2 , 0x04CF0000)

$group_1 = GUISetControl("group", "", 40, 40, 330, 210)
$button_1 = GUISetControl("button", "Button 1", 40, 25, 100, 25)
  ;;;GuiSetControlEx($button_1, $GUI_DISABLE)
$button_2 = GUISetControl("button", "Button 2", 150, 30, 100, 20)
$button_3 = GUISetControl("button", "Button 3", 260, 30, 110, 20)

$edit_1 = GuiSetControl("edit", "This label is on the first tab", 90, 90, 200, 100)
$label_1 = GuiSetControl("label", "This edit is on the second tab", 90, 90, 200, 100)
   GuiSetControlEx($label_1, $GUI_HIDE)
$input_1 = GuiSetControl("input", "This input is on the third tab", 90, 90, 200, 100)
   GuiSetControlEx($edit_1, $GUI_HIDE)

GuiShow()

While 1
    sleep(100)
    $msg = GuiMsg(0)
    Select
    Case $msg = -3
        Exit
        
     Case $msg = $button_1
         GUISetControl($button_1, "Button 1", 40, 25, 100, 25)
         GUISetControl($button_2, "Button 2", 150, 30, 100, 20)
         GUISetControl($button_3, "Button 3", 260, 30, 110, 20)
         
         GuiSetControlEx($edit_1, $GUI_SHOW)
         GuiSetControlEx($label_1, $GUI_HIDE)
         GuiSetControlEx($input_1, $GUI_HIDE)
         
         
   Case $msg = $button_2
         GUISetControl($button_1, "Button 1", 40, 30, 100, 20)
         GUISetControl($button_2, "Button 2", 150, 25, 100, 25)
         GUISetControl($button_3, "Button 3", 260, 30, 110, 20)
         
         GuiSetControlEx($edit_1, $GUI_HIDE)
         GuiSetControlEx($label_1, $GUI_SHOW)
         GuiSetControlEx($input_1, $GUI_HIDE)
         
         
    Case $msg = $button_3
         GUISetControl($button_1, "Button 1", 40, 30, 100, 20)
         GUISetControl($button_2, "Button 2", 150, 30, 100, 20)
         GUISetControl($button_3, "Button 3", 260, 25, 110, 25)
         
         GuiSetControlEx($edit_1, $GUI_HIDE)
         GuiSetControlEx($label_1, $GUI_HIDE)
         GuiSetControlEx($input_1, $GUI_SHOW)
    EndSelect
WEnd
Exit
Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Thanks CS. I'll probably have to do it this way anyway because I won't be updating AutoIt GUI anymore. The last two have just broken the GUI too badly so I reloaded a version from May about a half hour ago.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

I have a GUI that uses a Tab control with 4 TabItem controls. I would like to add a Tab Control and 5 tabItems on the last of the current tabs.  Is this at all possible as is or do we have to wait for a later version? Even if I had to add the new tab within a group on the last of the existing tab pages would be fine.

Definetly you can add dynamically tabitem to current tab :D

Opt("GUINotifyMode", 1)

$count = 0
#include "GUI_Messages.au3"

GuiCreate("TitleFoo", 500, 500)
WinActivate("TitleFoo")
$Add = GUISetControl("button", "New tab", 300, 300)
$tab = GUISetControl("tab", "", 0, 0, 300, 300)
GUISetControl("tabitem", $count, 0, 0);, 300, 300)

GUISetControl("edit", "Edit on tab #" & $count , 40, 40, 150, 150)

GuiShow(3)
While 1
   sleep(100)
   $msg = GuiMsg(0)
   If $count >= 10 Then GuiWrite($Add, 128);disable the button

   Select
   Case -3 = $msg
       Exit
   Case -1 = $msg
       Exit

   Case $Add = $msg
     $count =$count+1
     

     ; Create new tab with button
       GUISetControl("tabitem", $count, 0, 0)
       GUISetControl("edit", "Edit on tab #" & $count , 40, 50, 150, 150)
       GUISetControl("tabitem", "", 0, 0); close tab definition
       
    GuiSendMsg($tab, $TCM_SETCURFOCUS, $count, 0)
   EndSelect

WEnd
Exit

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  
Followers 0