followgeo Posted June 13, 2010 Share Posted June 13, 2010 I'm using the sample provided in the help file for creating my own browser. I want to record coordinates the user clicks later on, but I'm experimenting with the GUICoordMode so that I can better understand how it works. When I set the mode to 1, everything works fine, but when I set the mode to 0 all the buttons except for 1 disappears. Any help would be appreciated. I'm trying my best to learn from the help file, but I'm stuck on this one. Link to comment Share on other sites More sharing options...
JohnOne Posted June 13, 2010 Share Posted June 13, 2010 With different modes, you will need to alter the coords in your code Im no gui whizzkid, but you certainly are best providing an example to better get help Only advice I could give is keep it set to 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
followgeo Posted June 13, 2010 Author Share Posted June 13, 2010 Well, I wanted it to use the coordinates in the window and not from the screen, so that the gui could be moved around. I just don't understand why that would break displaying the buttons from the browser demo. Strange, but I'm sure someone understands it. Link to comment Share on other sites More sharing options...
JohnOne Posted June 13, 2010 Share Posted June 13, 2010 Because guicoordmode looks to me like thats what its for, like for creating your gui rather that its functionality. the controls should always move with your gui or you are doing something fundimentaly wrong. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 13, 2010 Moderators Share Posted June 13, 2010 (edited) followgeo,All the GUICoordMode does is to alter how you define the position of your controls. If you leave it at 1 (the default) you define the controls relative to the GUI in which you creating the controls:#include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) ; Relative to GUI GUICtrlCreateButton("one", 10, 10, 80, 30) GUICtrlCreateButton("two", 10, 50, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndIf you change it to 0, the control is positioned relative to the previous control:#include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) ; Relative to GUI GUICtrlCreateButton("one", 10, 10, 80, 30) Opt("GUICoordMode", 0) GUICtrlCreateButton("two", 0, 40, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndSee the difference? In the first example, the coords are:10, 10 10, 50In the second:10, 10 ; Stil the same because you need one control to anchor the others! 0, 40 ; same x coord (10) - add 40 to y coord (50)Try changing the positon of the "one" button in each case. In the first examplw, "two" stays where it was - in the second it follows "one".Does that help? If not, do as JohnOne has suggested and post the code which is giving you problems. M23Edit: Typnig! Edited June 13, 2010 by Melba23 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...
followgeo Posted June 13, 2010 Author Share Posted June 13, 2010 Ok, maybe I'm understanding the purpose of the GuiCoordMode. I thought that would tell it how to calculate coordinates. I would like the coordinates for mouse clicks to be calculated based on the gui and not on the entire screen. I hope I have my terminology correct (still learning). Link to comment Share on other sites More sharing options...
followgeo Posted June 13, 2010 Author Share Posted June 13, 2010 Crap. Again, the help file saves the day. MouseCoordMode would probably be what I'm looking for. Sorry for the trouble. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 13, 2010 Moderators Share Posted June 13, 2010 (edited) followgeo,You need MouseCoordMode for that!M23Edit: See you already know! Edited June 13, 2010 by Melba23 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...
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