stev379 Posted February 23, 2005 Share Posted February 23, 2005 Why is GUICtrlCreateGroup ("",-99,-99,1,1) needed to close a group? I have suspicions why, but would like to know a concrete reason to be sure I'm not wrong. What can go wrong if you have 2 groups in a gui, (1 above the other, both have input fields and only one has radio buttons), if the groups aren't closed? Link to comment Share on other sites More sharing options...
Josbe Posted February 23, 2005 Share Posted February 23, 2005 Why is GUICtrlCreateGroup ("",-99,-99,1,1)needed to close a group? I have suspicions why, but would like to know a concrete reason to be sure I'm not wrong.What can go wrong if you have 2 groups in a gui, (1 above the other, both have input fields and only one has radio buttons), if the groups aren't closed?<{POST_SNAPBACK}>From the helpfile...:A group control is the thin line you see around controls (usually only Radio button) that visually groups them together. Only one Radio button within a Group can be selected at once.If you want to have multiple groups without the visible line then you must use GUIStartGroup() to group your Radio buttons. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
phillip123adams Posted February 23, 2005 Share Posted February 23, 2005 From the helpfile...:<{POST_SNAPBACK}>@josbeI think you mis-understood. The help file for GUICtrlCreateGroup has a line in the example that says:GUICtrlCreateGroup ("",-99,-99,1,1) ;close groupI too am curious about this. Phillip Link to comment Share on other sites More sharing options...
stev379 Posted February 23, 2005 Author Share Posted February 23, 2005 (edited) <{POST_SNAPBACK}>@josbeI think you mis-understood. The help file for GUICtrlCreateGroup has a line in the example that says:GUICtrlCreateGroup ("",-99,-99,1,1);close groupI too am curious about this.<{POST_SNAPBACK}>Right, doesn't the creation of the group signify where it's boundries are? If GUICtrlCreateGroup ("",-99,-99,1,1) is needed to close the group so that radio buttons in another group in the same gui can function properly, so be it. But that would merely be a reason why the group needs to be closed. Not an explanation for what GUICtrlCreateGroup ("",-99,-99,1,1) actually does to close the group and again...of course why doesn't the creation of the group when its boundaries are set function as opening and closing? Edited February 23, 2005 by stev379 Link to comment Share on other sites More sharing options...
phillip123adams Posted February 23, 2005 Share Posted February 23, 2005 To take this a little further, the example for GUIStartGroup does not do a GUICtrlCreateGroup ("",-99,-99,1,1), and it seems to work okay. Phillip Link to comment Share on other sites More sharing options...
stev379 Posted February 23, 2005 Author Share Posted February 23, 2005 True, this example from the Au help file uses GUICtrlCreateGroup to create the group and GUIStartGroup() to group different groups of radio buttons together and doesn't close the group. So again, we're left to ask why close the group if in this example there is no need to? Why would you close group with this code "GUICtrlCreateGroup ("",-99,-99,1,1);close group", when you could just group the radio buttons by using GUIStartGroup()?? $group_1 = GUICtrlCreateGroup ("Group 1", 30, 90, 165, 160) GUIStartGroup() $radio_1 = GUICtrlCreateRadio ("Radio &0", 50, 120, 70, 20) $radio_2 = GUICtrlCreateRadio ("Radio &1", 50, 150, 60, 20) $radio_3 = GUICtrlCreateRadio ("Radio &2", 50, 180, 60, 20) GUIStartGroup() $radio_4 = GUICtrlCreateRadio ("Radio &A", 120, 120, 70, 20) $radio_5 = GUICtrlCreateRadio ("Radio &B", 120, 150, 60, 20) $radio_6 = GUICtrlCreateRadio ("Radio &C", 120, 180, 60, 20) GUIStartGroup() $input_1 = GUICtrlCreateInput ("Input 1", 200, 20, 160, 30) $input_2 = GUICtrlCreateInput ("Input 2", 200, 70, 160, 30) Link to comment Share on other sites More sharing options...
phillip123adams Posted February 24, 2005 Share Posted February 24, 2005 I guess no one knows the answer to the question of what is the purpose of GUICtrlCreateGroup ("",-99,-99,1,1). It's looking more and more, to me, to be a documentation bug. The GUI's I have tried, with and without including this so called group closer, have worked just as well with it or without it. Perhaps it was necessary originally, but no longer, and the documentation needs to be revised? Do any of the gurus, with ratings of < 3 out of 10, know the answer? Phillip Link to comment Share on other sites More sharing options...
Developers Jos Posted February 24, 2005 Developers Share Posted February 24, 2005 Do any of the gurus, with ratings of < 3 out of 10, know the answer?<{POST_SNAPBACK}>Try this script with and without the GUICtrlCreateGroup ("",-99,-99,1,1) ;close group....With: you can select 1 or 2 and 3 or 4without: you can only select 1 or 2 or 3 or 4 #include <GUIConstants.au3> GUICreate("My GUI group") ; will create a dialog box that when displayed is centered GUICtrlCreateGroup ("Group 1", 90, 60, 90, 140) $radio_1 = GUICtrlCreateRadio ("Radio 1", 110, 90, 60, 20) $radio_2 = GUICtrlCreateRadio ("Radio 2", 110, 110, 60, 50) GUICtrlCreateGroup ("",-99,-99,1,1) ;close group $radio_3 = GUICtrlCreateRadio ("Radio 3", 110, 210, 60, 20) $radio_4 = GUICtrlCreateRadio ("Radio 4", 110, 230, 60, 50) GUISetState () ; will display an empty dialog box ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend 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...
MHz Posted February 24, 2005 Share Posted February 24, 2005 Yep, Jon created GUICtrlCreateGroup('', -99, -99, 1, 1) for a reason. Same with GUICtrlCreateTabItem('') These items need to be closed, before other commence. Link to comment Share on other sites More sharing options...
phillip123adams Posted February 24, 2005 Share Posted February 24, 2005 @JdeBThank you very much. I played with your example for a while, a can now see a reason to close a group. That being, once a group has been started, it must be closed if there are controls that follow and you do not want to surround them with a border, and want them to react separately from the previous group. If the second group is to be surrounded with a border, there is no need to close the previous group (evidently starting a new group closes the previous group).@MHzThank you also. Phillip Link to comment Share on other sites More sharing options...
stev379 Posted February 24, 2005 Author Share Posted February 24, 2005 (edited) That is what I figured it was for. The question now would be...am I misunderstanding the help file (which I think is outstanding BTW ) or does GUIStartGroup not accomplish the same task? I just want to be sure I'm not missing something that may prove valuable in future scripts. This is the remark from the help file about GUIStartGroup: This function is generally used when working with radio button controls. When you click a radio button all other radio buttons in the same grouping are reset. The GUIStartGroup function allows you to easily define these groups. Edited February 24, 2005 by stev379 Link to comment Share on other sites More sharing options...
jpm Posted February 25, 2005 Share Posted February 25, 2005 We can argue a close group was needed or not. At the begining when I design GUI there was not GuiStartGroup so the following script seems logical to the close the group to have radio button outside. GuiCreate("test") $group_1 = GUICtrlCreateGroup ("Group 1", 30, 90, 100, 160) $radio_1 = GUICtrlCreateRadio ("Radio &0", 50, 120, 70, 20) $radio_2 = GUICtrlCreateRadio ("Radio &1", 50, 150, 60, 20) $radio_3 = GUICtrlCreateRadio ("Radio &2", 50, 180, 60, 20) GUICtrlCreateGroup ("", -99, 99, 1, 1) $radio_4 = GUICtrlCreateRadio ("Radio &A", 150, 120, 70, 20) $radio_5 = GUICtrlCreateRadio ("Radio &B", 150, 150, 60, 20) $input_1 = GUICtrlCreateInput ("Input 1", 200, 20, 160, 30) $input_2 = GUICtrlCreateInput ("Input 2", 200, 70, 160, 30) GUISetState() Do $msg = GuiGetMsg() Until $msg= $GUI_EVENT_CLOSE Now it looks redundant but it is there, use the way you prefer to structure your grouping Link to comment Share on other sites More sharing options...
phillip123adams Posted February 25, 2005 Share Posted February 25, 2005 At the begining when I design GUI there was not GuiStartGroup so the following script seems logical to the close the group to have radio button outside. <{POST_SNAPBACK}>Thanks jpm. Phillip Link to comment Share on other sites More sharing options...
stev379 Posted February 25, 2005 Author Share Posted February 25, 2005 Cool. Thanks to all for the info!! 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