Sign in to follow this  
Followers 0
CyberSlug

Autogui: Gui Coord Mode And -1

3 posts in this topic

jpm, I'm looking through the documentation, and I do not understand how GUICoordMode 0 or 2 are supposed to work.

I think the following code should produce three visible buttons. But the buttons appear on top of each other :D

Opt("GUICoordMode" ,0) 
;;;DOCS:
;;;  relative position to the start of the last control (upper left corner)

GuiCreate("MyGUI")

GUISetControl("button", "one", 10, 10, 50, 50)
GUISetControl("button", "two", -1, -1)
GUISetControl("button", "three", 0, 0)

;;;DOCS:
;;;  if [left or top is] equal to -1 the [height or width] of the previous control will be added

GuiWaitClose()

P.S. Should I keep starting new threads, or should I post in the current GUI-thread?


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites



Another issue: GuiWrite vs. GUISetControlEx

Here is my observed behavior for checkboxes:

First - GuiWrite only works if the GUI is visible, correct? [so use GUISetControlEx if you want to set a state before showing the GUI.]

Second - GuiWrite($checkboxRef, $GUI_CHECKED) does not work!!! Apparently, GuiWrite($checkboxRef, anInteger2orGreater) is required...

GuiCreate("Example", 300, 300)
$h = GUISetControl("checkbox", "foo", 10, 10)
;;;GuiWrite($h, 1)
GuiShow()
;;;GuiWrite($h, 1);note $GUI_CHECKED == 1
;;;GuiWrite($h, 4);note $GUI_UNCHECKED == 4

Note so self: In GUISetControlEx, change the state table to -1 or 0 because it looks bad when help window is small and text word wraps.

(I'm documenting such "issues" as I find them.)


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

jpm, I'm looking through the documentation, and I do not understand how GUICoordMode 0 or 2 are supposed to work.

I think the following code should produce three visible buttons.  But the buttons appear on top of each other :D

Opt("GUICoordMode" ,0) 
;;;DOCS:
;;;  relative position to the start of the last control (upper left corner)

GuiCreate("MyGUI")

GUISetControl("button", "one", 10, 10, 50, 50)
GUISetControl("button", "two", -1, -1)
GUISetControl("button", "three", 0, 0)

;;;DOCS:
;;;  if [left or top is] equal to -1 the [height or width] of the previous control will be added

GuiWaitClose()

P.S.  Should I keep starting new threads, or should I post in the current GUI-thread?

CyberSlug

Mode = 0 is relative just reuse the previous coord.

so button2 will be offset x2=x1-1 y2=y1-1

Button3 will be offset x3=x2+0 y3=y2+0

PS new thread is very good

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  
Followers 0