Sign in to follow this  
Followers 0
t0ddie

tab on a tab?

6 posts in this topic

so i make 3 tab in a gui, and i want to put 3 smaller tabs ON the third tab. right in the middle of it.

but instead im getting 6 tabs at the top.

i want 3 tabs, and on the THIRD tab i want another 3 tabs.

currently im creating a new tab after the last tab item.

what should i do instead?


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites



post your code please..


[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

$GUI = GUICreate("help!", 510, 390)
$tab = GUICtrlCreateTab(0, 22, 510, 390)
$1 = GUICtrlCreateTabItem("1")
$2 = GUICtrlCreateTabItem("2")
$3 = GUICtrlCreateTabItem("3")
$tab2 = GUICtrlCreateTab(255, 170, 40, 40)
$4 = GUICtrlCreateTabItem("4")
$5 = GUICtrlCreateTabItem("5")
$6 = GUICtrlCreateTabItem("6")
GUISetState()
while 1
wend

the numbers arent perfect for left, top, width, height. i just quickly wrote them here.

i just tested this exact script. the tabs say 123456 all at the top.

i want 3 tabs, and on the third tab, somewhere in the middle.. you see more tabs. NOT at the top. kind of like the tabs in the example gui that is in the help file. except those are not on a tab. i want so when you click the third tab, you will see on that tab 3 more tabs in the middle of the tab (not next to the other tabs at the top) to select

i thought i made sense without showing code...

but thats my problem. what do you think? is my goal obtainable?

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

ahh, nesting of tabs isnt supported yet. i seeeeeeeeeeeeeeeeeeeeeee

this seems like it might be helpful though

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

i get an error with this.

and how do i post a picture of the error? i have seen others on the forum doing this. but in the meantime, the error is: "Error reading the file: GUI_Messages.au3"

and i just got the newest beta version so what gives?


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

#include <Guiconstants.au3>
#include <ANYGUIv2.1.au3>
$GUI = GUICreate("Nested Tabs", 510, 390)
$tab = GUICtrlCreateTab(0, 22, 510, 390)
$1 = GUICtrlCreateTabItem("1")
$2 = GUICtrlCreateTabItem("2")
$3 = GUICtrlCreateTabItem("3")
$child = GUICtrlCreateLabel( "Nested Tabs", 0, 48, 510, 340); this is inside tab 3
GUISetState()
$target = _GuiTarget ($GUI, "", "", $child); get hwnd to label in tab 3
$tab2 = _TargetaddTab (0, 0, 510, 340, -1, -1, $target); embed tab child window 
;over top of Label in Tab 3
$tab2item1 = GUICtrlCreateTabItem("4")
$tab2item2 = GUICtrlCreateTabItem("5")
$tab2item3 = GUICtrlCreateTabItem("6")
GUISetState(); must call again to show $Tab2
While 1
    $msg = GUIGetMsg(1)
    If $msg[0] = $GUI_EVENT_CLOSE Then Exit
WEnd

can't target a Tabitem, but i can target a control IN a tabitem

try that....

EDIT: you'll probably want to use GUIGetMsg(1) to handle msg's from items in your 'nested tabs'

See this post for a more in-depth example: Nested Tabs

Edited by quaizywabbit

[u]Do more with pre-existing apps![/u]ANYGUIv2.8

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