lookfar Posted August 3, 2005 Share Posted August 3, 2005 (edited) this has got me totally frustrated, normally a control is owned by it's parent so the control's left,right,top,height are relative to the parent and not the form. In this case the Tabsheet : #include <GuiConstants.au3> If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000 GuiCreate("Form1", 420, 331, 302,218 ,$WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS) Opt("GUICoordMode",0) $PageControl1 = GUICtrlCreateTab(88, 32, 257, 201) $TabSheet1 = GUICtrlCreateTabitem ("TabSheet1") $Button1 = GuiCtrlCreateButton("Button1", 76, 40, 75, 25) $Button2 = GuiCtrlCreateButton("Button2", 76, 80, 75, 25) $TabSheet2 = GUICtrlCreateTabitem ("TabSheet2") $CheckBox1 = GuiCtrlCreateCheckbox("CheckBox1", 76, 48, 97, 17 ) $CheckBox2 = GuiCtrlCreateCheckbox("CheckBox2", 76, 80, 97, 17 ) GUICtrlCreateTabitem ("") GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit The controls position are relative to the tabsheet and not the main form but I simply cannot make it obey the rules... I have run into the same problem with groupbox and child controls.. does anyone know how I can make this work? Edited August 3, 2005 by lookfar Get the latest version of AutoEd and Koda FormDesigner here Link to comment Share on other sites More sharing options...
Valuater Posted August 4, 2005 Share Posted August 4, 2005 (edited) Of course you know this is where the trouble startsOpt("GUICoordMode",0)I wrote an extensive program including many tabs. this was in Autoit 3.1. there were minimal "tab controls". there are more now including <GuiTab.au3>but this is what i wrote....$tab = GUICtrlCreateTab(9, 8, 492, 345, BitOR($TCS_MULTILINE, $TCS_RIGHTJUSTIFY)) $tab1 = GUICtrlCreateTabItem(" My Favorites ") GUICtrlCreatePic($Favorites_jpg, 10, 31, 491, 321, $SS_SUNKEN) GUICtrlSetState(-1, $GUI_DEFBUTTON); will display this tab first GUICtrlCreateLabel("PLEASE Create a Restore Point...", 165, 60, 260, 25) $tab11OK = GUICtrlCreateButton("Create Restore", 30, 55, 120, 25, $BS_ICON)All based on the GUI not the tabs.... and this is what it looked likehttp://xpcleanmenu.hostrocket.com/image/Favorites-screen.jpgSorry I dont have the answer you were looking for....8) Edited August 4, 2005 by Valuater Link to comment Share on other sites More sharing options...
lookfar Posted August 4, 2005 Author Share Posted August 4, 2005 Of course you know this is where the trouble startsOpt("GUICoordMode",0)I wrote an extensive program including many tabs. this was in Autoit 3.1. there were minimal "tab controls". there are more now including <GuiTab.au3>but this is what i wrote....$tab = GUICtrlCreateTab(9, 8, 492, 345, BitOR($TCS_MULTILINE, $TCS_RIGHTJUSTIFY)) $tab1 = GUICtrlCreateTabItem(" My Favorites ") GUICtrlCreatePic($Favorites_jpg, 10, 31, 491, 321, $SS_SUNKEN) GUICtrlSetState(-1, $GUI_DEFBUTTON); will display this tab first GUICtrlCreateLabel("PLEASE Create a Restore Point...", 165, 60, 260, 25) $tab11OK = GUICtrlCreateButton("Create Restore", 30, 55, 120, 25, $BS_ICON)All based on the GUI not the tabs.... and this is what it looked likehttp://xpcleanmenu.hostrocket.com/image/Favorites-screen.jpgSorry I dont have the answer you were looking for....8)<{POST_SNAPBACK}>If you have a look at the FormDesigner I'm working on:drop a groupbox on the form and then drop some checkboxes or radiobuttons on the groupbox and then move the groupbox around the form..The contols move with the groupbox because they are owned by the groupbox and not the form. this is a standard in GUI development.AutoIt GUI does not seem to have any Parent/Child relationships for controls so when you "Generate code" the controls are all over the place on the form. It's too bad..what is needed is a parameter for controls like:$CheckBox1 = GuiCtrlCreateCheckbox("CheckBox1", 76, 48, 97, 17,$GroupBox1 )so it will get it's coordinates relative to the groupbox xy and not the form xy Get the latest version of AutoEd and Koda FormDesigner here Link to comment Share on other sites More sharing options...
quaizywabbit Posted August 4, 2005 Share Posted August 4, 2005 you'll have to have logic in your code to discern whether controls are placed in a groupbox, and set the order of creation: GroupBox Opt("GUICoordMode",0) 1st Control 2nd Control Nth Control Opt("GUICoordMode",1) Otherwise try GuiStartGroup() [u]Do more with pre-existing apps![/u]ANYGUIv2.8 Link to comment Share on other sites More sharing options...
lookfar Posted August 5, 2005 Author Share Posted August 5, 2005 you'll have to have logic in your code to discern whether controls are placed in a groupbox, and set the order of creation: GroupBox Opt("GUICoordMode",0) 1st Control 2nd Control Nth ControlOpt("GUICoordMode",1)Otherwise try GuiStartGroup()<{POST_SNAPBACK}>I wish it were that simple..GuiStartGroup() seems to be reserved for control logic not coordinates. Opt("GUICoordMode",0) just does not work in this case..I have tried every combinationwith no joy.Oh well, I'm going to leave it for now, I want to get onto real time code generation for the form designer ,and have events for onclick, onmouseover etc. Get the latest version of AutoEd and Koda FormDesigner here Link to comment Share on other sites More sharing options...
quaizywabbit Posted August 5, 2005 Share Posted August 5, 2005 I take it you're trying to generate an au3 script from the gui in your formbuilder? The only other option that even comes to mind would be to use absolute coordinates for every control. [u]Do more with pre-existing apps![/u]ANYGUIv2.8 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