Jump to content
Sign in to follow this  
rudi

Using AutoitSetOption(GuiCoordMode,2) I fail to "step left or up"

Recommended Posts

rudi

Hi.

The help file tells:

GUICoordMode Alters the position of a control defined by GUICtrlSetPos.

1 = absolute coordinates (default) still relative to the dialog box.

0 = relative position to the start of the last control (upper left corner).

2 = cell positionining relative to current cell. A -1 for left or top parameter don't increment the start.

So next line is -1,offset; next cell is offset,-1; current cell is -1,-1.

Obviously "offset" cannot be -1 which reserved to indicate the no increment.

But if you can use a multiple of the width you choose to skip or go back.

GUICreate($GuiTitle,320,125,@DesktopWidth - 420,30,$WS_POPUP)
GUICtrlSetBkColor(-1,0xfffff0)
$b2 = GUICtrlCreateButton("B2 starten",-1,1,100,25)
$email = GUICtrlCreateButton("Email starten",1,1,100,25)
; I'd expect that the next line would go "two up" ...
$Word =  GUICtrlCreateButton("Word starten",1,-2,100,25)
; ... and that one "two to the left  side" ...
$Excel = GUICtrlCreateButton("Excel starten",-2,1,100,25)
; ... more buttons
$Ende = GUICtrlCreateButton("Arbeit beenden",-1,1,100,25)

What do I miss to step left or upwards?

Either I want first to fill the topmost button row, then step back to "collumn 1", or first fill the first collumn, then step back to the topmost row. :)

I can't find it :)

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites
PsaltyDS

Hi.

The help file tells:

GUICoordMode Alters the position of a control defined by GUICtrlSetPos.

1 = absolute coordinates (default) still relative to the dialog box.

0 = relative position to the start of the last control (upper left corner).

2 = cell positionining relative to current cell. A -1 for left or top parameter don't increment the start.

So next line is -1,offset; next cell is offset,-1; current cell is -1,-1.

Obviously "offset" cannot be -1 which reserved to indicate the no increment.

But if you can use a multiple of the width you choose to skip or go back.

GUICreate($GuiTitle,320,125,@DesktopWidth - 420,30,$WS_POPUP)
GUICtrlSetBkColor(-1,0xfffff0)
$b2 = GUICtrlCreateButton("B2 starten",-1,1,100,25)
$email = GUICtrlCreateButton("Email starten",1,1,100,25)
; I'd expect that the next line would go "two up" ...
$Word =  GUICtrlCreateButton("Word starten",1,-2,100,25)
; ... and that one "two to the left  side" ...
$Excel = GUICtrlCreateButton("Excel starten",-2,1,100,25)
; ... more buttons
$Ende = GUICtrlCreateButton("Arbeit beenden",-1,1,100,25)oÝ÷ ÙhZµÚ+,-z^+º­ÛØ^¬×â®Ëm¡ø¥Ø^¶f¢Ë[ºÛhº0¶§²×©m§$¶®¢×([¦Z®¢Ú+~*ìµø¥Ø^~*ìµÊ%駶§²×©m§$¶azÚ)-®-)ä!ƧßÛ_wb·^ªÝ±ú®¢×ã-±ëajئ¥§-²+"*.Á©í¶§r·¦z{m¢Ø^ìmªê-qéeªê-)î°EÀ    2Ø¢w©¥"Ö¥Á¬¬w+zg§¶Ëh¶§{jºBzYjº[jÇ¢{a{¶§v¢h~Ø^¦·¯¬rí®Sê~Ç­Çë¢kajÙhq«b¢v(¹Æ§iÈbz÷­ç}ç-¡úÞ½êìz)Ü­éÛÊëÚئzËayÊ'¶º%Â'm©Ýþáz(7¦¡«­¢+ØÀÌØíÜôÐÀ(ÀÌØí ôÐÀ(ÀÌØí¡U$ôU%
ÉÑ ÅÕ½ÐíQÍÐÅÕ½Ðì°ÐÀÀ°ÐÀÀ¤)U%MÑMÑÑ ¤)U%
Ñɱ
ÉÑ    ÕÑѽ¸ ÅÕ½ÐìÀÅÕ½Ðì°ÌÔÀ°ÌÔÀ°ÀÌØíÜ°ÀÌØí ¤)=ÁÐ ÅÕ½ÐíÕ¥
½½É5½ÅÕ½Ðì°È¤)½ÈÀÌØí¸ôÄѼà(%U%
Ñɱ
ÉÑ    ÕÑѽ¸ ÀÌØí¸°´È¨ÀÌØíÜ°´È¨ÀÌØí °ÐÀ°ÐÀ¤)9áÐ()¼(%M±À ÈÀ¤)U¹Ñ¥°U%Ñ5Í ¤ô´Ì

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
rudi

Hello.

Thanks, the basics I've got now:

"down" and "right" it's the height / width of the previous element

"up" and "left" I have to multiply with "height in Pixel" and "width in Pixel". At least I couldn't get that from the help file...

But it's not accurate in positioning this way. ONE pixel has to be substracted extra when stepping left or upwards. Look at the output of this code:

AutoItSetOption ("GUICoordMode",2)

$w = 40
$h = 40

for $extra = 0 to 1
$hGUI = GUICreate("Test, $extra = " & $extra, 400, 400)
GUISetState()
GUICtrlCreateButton("0", 350, 350, $w, $h)
Opt("GuiCoordMode", 2)
For $n = 1 to 8
    GUICtrlCreateButton($n, -2 * $w - $extra, -2 * $h - $extra, $w, $h)
Next
for $n = 9 to 16
        GUICtrlCreateButton($n, 1, -1 , $w, $h)
Next
        GUICtrlCreateButton("17", -1, 1 , $w, $h)
for $n = 18 to 24
            GUICtrlCreateButton($n, -2 * $w - $extra, 1 , $w, $h)
Next


Do
    Sleep(20)
Until GUIGetMsg() = -3
Next

Thanks, I'd never got that on my own! :)

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

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  

×