Jump to content
Sign in to follow this  
narciso

A bug sizing GUI window?!

Recommended Posts

narciso

Hi,

Why isn't the size of generated GUI window equal to the dimensions given in the script below. AutoIt Window Info says it is 233 x 158, instead of the desired 227 x 126 ?!

; ################# cut

#include <GUIConstants.au3>

GUICreate("Rozliczenia fiskalne", 227, 126, -1, 385)

GUISetState ()

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then

ExitLoop

EndIf

Wend

; ################# cut

Very strange, isn't it?

Thanks in advance for any help on that.


Warmly,Narciso

Share this post


Link to post
Share on other sites
PsaltyDS

Some AutoIt functions take into account the border and title bar dimensions, and some do not. By default the border is 2 pixels wide, so if your width is off by exactly 4, that's probably it. The height will be off by the height of the title bar. The AutoItInfo tool has a setting for getting the dimensions of the whole window, or just the client area.

:)

Edit: Ran the following demo:

; Create GUI
Opt("GuiOnEventMode", 1)
$hGui = GUICreate("GUI Test", 227, 126)
GUISetOnEvent(-3, "_Quit")
GUISetState()

While 1
    Sleep(20)
WEnd

Func _Quit()
    Exit
EndFunc

Using AutoItInfo tool, with the 'Magnify' option on, you see a border width of 3 and a title bar height of 35 (at least on this computer).

:D

Edited by PsaltyDS

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
narciso

Using AutoItInfo tool, with the 'Magnify' option on, you see a border width of 3 and a title bar height of 35 (at least on this computer).

Thanks a lot, man! How do I use AutoItInfo tool, with the 'Magnify' option on?!


Warmly,Narciso

Share this post


Link to post
Share on other sites
PsaltyDS

Thanks a lot, man! How do I use AutoItInfo tool, with the 'Magnify' option on?!

Run "AutoIt Window Info" (Au3Info.exe), and on the menu bar select Options | Magnify. Or just toggle it with Ctrl+Alt+M.

:)


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
narciso

Run "AutoIt Window Info" (Au3Info.exe), and on the menu bar select Options | Magnify. Or just toggle it with Ctrl+Alt+M.

:)

Thank you so much for the hint!!!

:D


Warmly,Narciso

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.