Jump to content

A bug sizing GUI window?!


Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...