KSum Posted June 24, 2013 Share Posted June 24, 2013 I have a GUI that has several checkboxes created. I show and hide groups of these based on a radio button. That all works fine. I would like to resize the window based on the checkboxes shown. I know which one will be the farthest extent and can resize based on this if I know the coordinates used to create the checkbox. Is there any way to read these as opposed to saving a variable for each set? Karl Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 24, 2013 Moderators Share Posted June 24, 2013 KSum,If you have stored the ControlID of the checkbox, you can use ControlGetPos to find its location. M23P.S. Have you looked at my GUIExtender UDF (the link is in my sig)? It might save you a lot of coding. Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
KSum Posted June 24, 2013 Author Share Posted June 24, 2013 As I understand it, I should be able to use WinMove and redefine the size. With that in mind, I shouldn't need a lot of coding. Then again, when I use this to widen the GUI, my checkboxes seem to move over the same amount as the added width. And I have tried all 3 settings for AutoItSetOption("GUICoordMode", _) as well as not defining this option at all. I am widening the GUI I create to show checkboxes arranged in columns. I have an array of checkboxes, and have the low and high array item for a set, so I have $checkbox[$I] as the last item in the set. Does ControlGetPos work on the running AutoIt window? I was expected for a GUI_____ but have been wrong before... Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 24, 2013 Moderators Share Posted June 24, 2013 KSum,I suggest you post the code you are using - then we can see what might be the problem with your checkboxes. And the Control* commands work perfectly well on AutoIt GUIs - after all they are just GUIs. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
KSum Posted June 24, 2013 Author Share Posted June 24, 2013 I have the checkboxes not moving now. Had to add this after the creation of each: GUICtrlSetResizing(-1, BitOr($GUI_DOCKTOP, $GUI_DOCKLEFT, $GUI_DOCKSIZE)); <- Set the resizing for the control And the ControlGetPos works well too. I decided, however to just divide the total number of checkboxes displayed by the number of boxes in each column and then multiply that by the width per column: ;$I1 is passed as the number of checkboxes ;calculate the number of columns, Rounding the result up to the nearest integer $MainGUIWidth = 560 + (((Ceiling($I1/6)) - 2) * 125) WinMove($MainGUIName, "", Default, Default, $MainGUIWidth, Default) 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