CyberSlug Posted November 23, 2004 Share Posted November 23, 2004 (edited) Concept: AutoIt supports multiple GUI windows, so create borderless mdi child windows to contain the additional tab controls. Limitations: Gui Resize stuff is not automatically supported... Nested tab controls aren't supported--but it might be possible with more coding.... _createAnotherTab($left, $top, $width, $height) _createAnotherTabItem($tabHandle, $text) Screenshot attached EDIT: Fixed positioning bug... expandcollapse popup; CyberSlug - 23 Nov 2003 ; Workaround to allow multiple tab controls on a GUI ; Create ANOTHER tab control at the specified coordinates, and return a handle... Func _createAnotherTab($left, $top, $width, $height) Local $parentGui = WinGetHandle("") Local $style = 0x56000000;WS_CHILD + WS_VISIBLE + WS_CLIPSIBLINGS + WS_CLIPCHILDREN ;I'm not sure why the -10 is needed, but it seems to calculate the right x,y coords $tabCtrlWin = GuiCreate("", $width, $height, $left,$top, $style, -1, $parentGui) GuiCtrlCreateTab(0, 0, $width, $height) GuiSetState() GuiSwitch($parentGui) Return $tabCtrlWin EndFunc ; Add a tabitem to the specified tab control Func _createAnotherTabItem($tabHandle, $text) Local $parentGui = WinGetHandle("") ; it would be better to explicitly use the handle of the parent GUI, but this the above ; function seems to work GuiSwitch($tabHandle) Local $item = GuiCtrlCreateTabItem($text) If $text = "" Then GuiSwitch($parentGui);remember null text denotes "closing" tabitem Return $item EndFunc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;; EXAMPLE CODE;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Opt("TrayIconDebug", 1);DEBUG ON $GUI = GuiCreate("Example Tab Controls", 400, 300) $info = GuiCtrlCreateButton("Info", 280, 50, 100, 50) Dim $button[8] $tab0 = GuiCtrlCreateTab(10, 10, 100, 100) GUICtrlCreateTabItem("zero") GuiCtrlCreateButton("this", 40, 40, 50, 50) GUICtrlCreateTabItem("one") GuiCtrlCreateButton("is", 40, 40, 50, 50) GUICtrlCreateTabItem("") $tab1 = _createAnotherTab(150, 10, 100, 100) _createAnotherTabItem($tab1, "A") GuiCtrlCreateButton("rather", 40, 40, 50, 50) _createAnotherTabItem($tab1, "B") GuiCtrlCreateButton("cool", 40, 40, 50, 50) _createAnotherTabItem($tab1, "") $tab2 = _createAnotherTab(10, 150, 100, 100) _createAnotherTabItem($tab2, "Two") GuiCtrlCreateButton("more", 40, 40, 50, 50) _createAnotherTabItem($tab2, "Three") GuiCtrlCreateButton("buttons", 40, 40, 50, 50) _createAnotherTabItem($tab2, "") $handle2 = _createAnotherTab(150, 150, 100, 100) _createAnotherTabItem($handle2, " i") GuiCtrlCreateButton("hi", 40, 40, 50, 50) _createAnotherTabItem($handle2, " ii") GuiCtrlCreateButton("there", 40, 40, 50, 50) _createAnotherTabItem($handle2, "") $close = GUICtrlCreateButton("Close", 280, 180, 100, 50) GuiSetState() While 1 $msg = GuiGetMsg(1) $msg = $msg[0] If $msg > 0 Then WinSetTitle($GUI, "", "Last Control Clicked: " & $msg) If $msg = -3 or $msg = $close Then ExitLoop WEnd Exit Edited November 23, 2004 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! Link to comment Share on other sites More sharing options...
PerryRaptor Posted November 27, 2004 Share Posted November 27, 2004 Which version of AutoIT did you use? Link to comment Share on other sites More sharing options...
Developers Jos Posted November 27, 2004 Developers Share Posted November 27, 2004 Which version of AutoIT did you use?<{POST_SNAPBACK}>topic says it all SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
CyberSlug Posted November 27, 2004 Author Share Posted November 27, 2004 Which version of AutoIT did you use?<{POST_SNAPBACK}>I used the newest unstable version.By the way, the _createAnotherTab returns a handle to the window instead of the tab control itself. You might want to modify to return an array with both pieces of information.(_createAnotherTabItem uses the window handle; but if you want to change any style properties of the tab control, you would need the control handle) Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
CyberSlug Posted November 29, 2004 Author Share Posted November 29, 2004 Question for the devs: Why does AutoIt only allow one tab control (per GUI) anyway? Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
jpm Posted November 29, 2004 Share Posted November 29, 2004 Question for the devs:Why does AutoIt only allow one tab control (per GUI) anyway?<{POST_SNAPBACK}>When I design the Gui tab control i did't when to scan in a lot of place to see the context so it was easier to have one. I will rehink and report more clearly if it is possible Link to comment Share on other sites More sharing options...
jpm Posted December 1, 2004 Share Posted December 1, 2004 I reread what I did and it is almost impossible to have several tab in the same window. I never saw such gui in any application that I analyse, so I will not try to rewrite the entire tab handling in the gui stuff. Sorry for not helping on this evolution. Link to comment Share on other sites More sharing options...
CyberSlug Posted December 2, 2004 Author Share Posted December 2, 2004 I reread what I did and it is almost impossible to have several tab in the same window.....Sorry for not helping on this evolution. <{POST_SNAPBACK}>That's oka :"> . I'll add my tab workaround to AutoBuilder then. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
jpm Posted December 2, 2004 Share Posted December 2, 2004 That's oka :"> . I'll add my tab workaround to AutoBuilder then.<{POST_SNAPBACK}>Thanks, did you find application using this kind of interface? Link to comment Share on other sites More sharing options...
SlimShady Posted December 2, 2004 Share Posted December 2, 2004 (edited) @CyberSlug: How do you make the tabs stick on the parent window when the window moves? Is it the styles you applied to the child windows? Edited December 2, 2004 by SlimShady Link to comment Share on other sites More sharing options...
CyberSlug Posted December 2, 2004 Author Share Posted December 2, 2004 @CyberSlug:How do you make the tabs stick on the parent window when the window moves?Is it the styles you applied to the child windows?<{POST_SNAPBACK}>Yes. It was trial/error/guesswork. I using a spy program to capture the window styles from some MDI Applications; and I think the style I'm using is from Microsoft Excel. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
jpm Posted December 2, 2004 Share Posted December 2, 2004 Yes. It was trial/error/guesswork. I using a spy program to capture the window styles from some MDI Applications; and I think the style I'm using is from Microsoft Excel.<{POST_SNAPBACK}>Thanks,If you find out where in Excel I am curious too know because I never see a tab on tab GUI. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now