rexx Posted August 29, 2009 Share Posted August 29, 2009 (edited) I have a GUI with several tabs, and a TreeView or ListView in each tab. but the tab ordering is not as i expected, the order is TV -> Tab -> other controls in tab. But i want Tab -> TV in tab -> other controls in tab after TV. LV has the same problem. Here's a simple code #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <TabConstants.au3> #include <TreeViewConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form=Form1.kxf $Form1 = GUICreate("Form1", 301, 284, 240, 142) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") $Tab1 = GUICtrlCreateTab(24, 24, 249, 225) GUICtrlSetResizing($Tab1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) $TabSheet1 = GUICtrlCreateTabItem("TabSheet1") $TreeView1 = GUICtrlCreateTreeView(40, 64, 209, 129, -1, $WS_EX_CLIENTEDGE) GUICtrlCreateTreeViewItem("1", $TreeView1) GUICtrlCreateTreeViewItem("2", $TreeView1) $Input1 = GUICtrlCreateInput("Input1", 40, 208, 121, 21) $Button1 = GUICtrlCreateButton("Button1", 176, 208, 75, 25, $WS_GROUP) $TabSheet2 = GUICtrlCreateTabItem("TabSheet2") $ListView1 = GUICtrlCreateListView("a|b|c", 48, 72, 201, 121) GUICtrlCreateListViewItem("1|2|3", $ListView1) GUICtrlCreateListViewItem("3|2|1", $ListView1) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 48, 208, 97, 17) $Button2 = GUICtrlCreateButton("Button2", 176, 208, 75, 25, $WS_GROUP) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Func Form1Close() Exit EndFunc Edited August 29, 2009 by rexx Link to comment Share on other sites More sharing options...
BugFix Posted August 29, 2009 Share Posted August 29, 2009 I'm confused. You've scripted: - GUI with Tab - TabItem1 with Treeview, Input and Button inside - TabItem2 with Listview, Checkbox and Button inside And exactly this is, what your script do. Best Regards BugFix Link to comment Share on other sites More sharing options...
rexx Posted August 30, 2009 Author Share Posted August 30, 2009 (edited) I mean, if you press "tab" key on the GUI, you'll see the focus is moving across the controls. the focused control will have a dotted border (or the I caret for edit control). My question is, the order is not what i expected, the tab and tv/lv are reversed. It shoud be tab first and then tv/lv, but actually it's tv/lv then tab, and then other controls. I want it to be 2 1 3 4 but it's 1 2 3 4 Edited August 30, 2009 by rexx Link to comment Share on other sites More sharing options...
BugFix Posted August 30, 2009 Share Posted August 30, 2009 Ah sorry, I've missunderstand this. Hmm, you're right. By definition the tab order in AutoIt is similiar to control creation after GUICreate. But your example fails. I've tested something to change creation and tab order, but i've found no way to solve. Best Regards BugFix Link to comment Share on other sites More sharing options...
Manjish Posted September 2, 2009 Share Posted September 2, 2009 This will give you the result you want: expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <TabConstants.au3> #include <TreeViewConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form=Form1.kxf $Form1 = GUICreate("Form1", 301, 284, 240, 142) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") $Tab1 = GUICtrlCreateTab(24, 24, 249, 225) GUICtrlSetResizing($Tab1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) $TabSheet1 = GUICtrlCreateTabItem("TabSheet1") $TreeView1 = GUICtrlCreateTreeView(40, 64, 209, 129, -1, $WS_EX_CLIENTEDGE) GUICtrlCreateTreeViewItem("1", $TreeView1) GUICtrlSetState(-1,$gui_focus) GUICtrlCreateTreeViewItem("2", $TreeView1) $Input1 = GUICtrlCreateInput("Input1", 40, 208, 121, 21) $Button1 = GUICtrlCreateButton("Button1", 176, 208, 75, 25, $WS_GROUP) $TabSheet2 = GUICtrlCreateTabItem("TabSheet2") $ListView1 = GUICtrlCreateListView("a|b|c", 48, 72, 201, 121) GUICtrlCreateListViewItem("1|2|3", $ListView1) GUICtrlSetState(-1,$gui_focus) GUICtrlCreateListViewItem("3|2|1", $ListView1) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 48, 208, 97, 17) $Button2 = GUICtrlCreateButton("Button2", 176, 208, 75, 25, $WS_GROUP) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Func Form1Close() Exit EndFunc [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
rexx Posted September 2, 2009 Author Share Posted September 2, 2009 Thanks, but the result is not changed, the tab order is still the same. Link to comment Share on other sites More sharing options...
Manjish Posted September 2, 2009 Share Posted September 2, 2009 Are you sure? I get the kind of tab order you want when I use the script I have posted above: [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
rexx Posted September 2, 2009 Author Share Posted September 2, 2009 No, in your screenshot it the same as the original one. But what i want is tabsheet1 first, and then TreeView, and then input1, button1. my screen is the how it works, the same as yours, TV first and then tabsheet. Are you sure? I get the kind of tab order you want when I use the script I have posted above: Link to comment Share on other sites More sharing options...
Manjish Posted September 2, 2009 Share Posted September 2, 2009 If I see your screenshot correctly, I see that You have mentioned the order as : TV--> Tab --> IP box --> Button If I see your post, you have mentioned order as: Tab--> TV --> IP Box --> Button I am getting seriously confused here Please clarify [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
Manjish Posted September 2, 2009 Share Posted September 2, 2009 Is this what you want?: expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <TabConstants.au3> #include <TreeViewConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) HotKeySet("{TAB}","focus") #Region ### START Koda GUI section ### Form=Form1.kxf $Form1 = GUICreate("Form1", 301, 284, 240, 142) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") $Tab1 = GUICtrlCreateTab(24, 24, 249, 225) GUICtrlSetResizing($Tab1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) GUICtrlSetState($tab1,$gui_focus) $TabSheet1 = GUICtrlCreateTabItem("TabSheet1") $TreeView1 = GUICtrlCreateTreeView(40, 64, 209, 129, -1, $WS_EX_CLIENTEDGE) GUICtrlCreateTreeViewItem("1", $TreeView1) GUICtrlCreateTreeViewItem("2", $TreeView1) $Input1 = GUICtrlCreateInput("Input1", 40, 208, 121, 21) $Button1 = GUICtrlCreateButton("Button1", 176, 208, 75, 25, $WS_GROUP) $TabSheet2 = GUICtrlCreateTabItem("TabSheet2") $ListView1 = GUICtrlCreateListView("a|b|c", 48, 72, 201, 121) GUICtrlCreateListViewItem("1|2|3", $ListView1) GUICtrlSetState(-1,$gui_focus) GUICtrlCreateListViewItem("3|2|1", $ListView1) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 48, 208, 97, 17) $Button2 = GUICtrlCreateButton("Button2", 176, 208, 75, 25, $WS_GROUP) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Func Form1Close() Exit EndFunc Func focus() Select Case ControlGetFocus ( "Form1" , "")="SysTabControl321" GUICtrlSetState($treeview1,$gui_focus) Case ControlGetFocus ( "Form1" , "")="SysTreeview321" GUICtrlSetState($input1,$gui_focus) Case ControlGetFocus ( "Form1" , "")="Edit1" GUICtrlSetState($button1,$gui_focus) Case ControlGetFocus ( "Form1" , "")="Button1" GUICtrlSetState($tab1,$gui_focus) EndSelect EndFunc [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
rexx Posted September 2, 2009 Author Share Posted September 2, 2009 Oh yes, that's it.Thanks.Is this what you want?: 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