AutoHotkey Community

It is currently May 27th, 2012, 9:04 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: October 27th, 2011, 12:28 pm 
Offline

Joined: October 18th, 2006, 8:07 pm
Posts: 169
Hi there,

The following code throws an error for me, which I think is a bug in gui,show in AutoHotkey_L.

Code:
;a GUI with edit box should appear for 1 second.

;edit box width should be 100
;edit box height should be 35 (i.e. 3.5 * 10)

;GUI width should be 300
;GUI height should be 665 (i.e. 66.5 * 10)


size=10

;this line DOES NOT cause an error
gui,add,edit,% "w100 h" 3.5*size,Test edit box

;this line DOES cause an error.
gui,show ,% "w300 h" 66.5*size,Test window

sleep 1000

exitapp


The error is:
Quote:
Error: Invalid option.
Specifically: .000000
---> 016: Gui,show,"w300 h" 66.5*size,Test window


The error disappears if either:
* I use Autohotkey Basic (this code was originally written there)
* I change “66.5” to “66” (i.e. no decimal point)

The same parameter causes no error in the “gui,add” command (as shown above).

Is this a bug, or am I doing something silly here ...?

*EDIT*
Both of these also cause the error too:

Code:
gui,show,% "w300 h665.000",Test window


Code:
gui,show,% "w300 h” 665.000,Test window


It seems that any decimal points are interpreted as separating options (as a space would) … I'm now even more certain this is a bug.


Last edited by daorc on October 27th, 2011, 4:06 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2011, 3:37 pm 
Offline
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
daorc wrote:
I'm now even more certain this is a bug.

It is not. AutoHotkey has never supported non-integer GUI positions/sizes. It didn't error out before because invalid options were ignored by the Gui command before v1.1.04.

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2011, 4:12 pm 
Offline

Joined: October 18th, 2006, 8:07 pm
Posts: 169
Oh ok, thanks fincs.

So is it not possible to have an expression calculating gui size then? ...Because even an expression resolving to a whole number (e.g. 16) is rejected as it is interpreted as a floating point number (16.0000).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2011, 4:12 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Use Round()

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2011, 4:39 pm 
Offline

Joined: October 18th, 2006, 8:07 pm
Posts: 169
Thanks HotKeyIt! I really should have thought of that! Works like a charm :)

But do you agree that having something that resolves to a number with only zeros after the decimal point should still be accepted in gui,show? It is in other gui connands (e.g. gui,add).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2011, 5:21 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
fincs wrote:
AutoHotkey has never supported non-integer GUI positions/sizes.

Positioning and Sizing of Controls
AHK Help File wrote:
R: Rows of text (can contain a floating point number such as R2.5).


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group