Jump to content
Sign in to follow this  
followgeo

Problem with embed browser and guicoordmode

Recommended Posts

followgeo

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.

Share this post


Link to post
Share on other sites
JohnOne

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 :mellow:


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
followgeo

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.

Share this post


Link to post
Share on other sites
JohnOne

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.

Share this post


Link to post
Share on other sites
Melba23

followgeo,

All the GUICoordMode does is to alter how you define the position of your controls. :mellow:

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

WEnd

If 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

WEnd

See the difference? In the first example, the coords are:

10, 10
10, 50

In 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. :P

M23

Edit: Typnig!

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
followgeo

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).

Share this post


Link to post
Share on other sites
followgeo

Crap. Again, the help file saves the day. MouseCoordMode would probably be what I'm looking for. Sorry for the trouble.

Share this post


Link to post
Share on other sites
Melba23

followgeo,

You need MouseCoordMode for that!

M23

Edit: See you already know! :mellow:

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.