Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Basic4ppc Wishlist > Bug Reports
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Bug Reports Post about errors or bugs encountered.

AutoScaled Mouse X and Y not integers

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-26-2009, 03:09 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default AutoScaled Mouse X and Y not integers

The Mouse X and Y values returned by the Form Mouse events can have non-integer values in an AutoScaled application running on a VGA device. It probably doesn't matter most of the time but occasionally it might cause a problem. I think they would be better to be returned as

delMouseDown(Math.Floor(e.X/b4p.fixX).ToString(b4p.cul) ....
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #2 (permalink)  
Old 07-26-2009, 06:37 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

The advantage of returning non-integer values is that the accuracy is kept 100%.
For example: Button1.Left = Button1.Left will not change the position of the button as expected. This will not always be correct if the number was rounded.
I agree that it is a little bit strange to see non-integer values but as I see it the accuracy is more important here.
__________________
Basic4android documentation
Reply With Quote
  #3 (permalink)  
Old 07-26-2009, 07:57 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by Erel View Post
The advantage of returning non-integer values is that the accuracy is kept 100%.
I don't really agree with that statement. The resolution that the program sees is 320 x 240 so controls are always placed to that resolution and in fact all operatoins are also to that resolution so it seems "correct" to me to return Mouse positions to that same resolution.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #4 (permalink)  
Old 07-27-2009, 09:13 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

I had to go and cook the evening meal before I could finish my previous comment. I was commenting about the mouse X and Y and this quote below is not relevant to that. However I can't overlook the opportunity to respond

Quote:
Button1.Left = Button1.Left will not change the position of the button as expected
In an AutoScaled application the valid range of values for Left are 0 to 239. This will be translated on a VGA device to 0 to 478 in steps of two and retranslated to 0 to 239 when read back so in an AutoScaled application there is no possibility of a fractional value arising in this case.

However if a fractional MouseX value was assigned to a Left property the value is cast to an integer on assignment to the proerty so when read back the Left value would not be the same as the MouseX value that was assigned! If a comparison was then done, for some reason, with the saved MouseX value the comparison would fail and the application would behave differently when run on a QVGA device to when run on a VGA device so I am still of the opinion that the Mouse coordinates should be "Floored" before return.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #5 (permalink)  
Old 07-28-2009, 08:40 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by agraham View Post
However if a fractional MouseX value was assigned to a Left property the value is cast to an integer...
I shouldn't have used Left as an example because it is manipulated by AutoScale. I really had in mind a normal integer property such as Value for a Scrollbar.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #6 (permalink)  
Old 07-28-2009, 09:52 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

I will reconsider it in the next version. However as it is currently implemented it is not a simple change as the multiplying (or dividing) code is scattered in many places.
__________________
Basic4android documentation
Reply With Quote
  #7 (permalink)  
Old 07-29-2009, 08:53 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by Erel View Post
the multiplying (or dividing) code is scattered in many places.
Are not changes only needed to the Form and Panel MouseDown, MouseMove and MouseUp code? Other Control properties/values originate in the Designer, or are calculated at runtime, using 320 x240 resolution and so "round trip" OK through AutoScale as integers. Only mouse coordinates originate within the higher resolution space and so only those values coordinates might end up as fractions when AutoScaled down.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #8 (permalink)  
Old 07-30-2009, 10:03 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

This is a very good point. And it makes it much simpler.
Will be fixed in the next version.
__________________
Basic4android documentation
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouse OutSide A Form eww245 Questions (Windows Mobile) 9 07-15-2009 07:27 AM
getting mouse coordinates enonod Questions (Windows Mobile) 8 06-28-2009 08:10 PM
Right Mouse button event? ExcludeReality Questions (Windows Mobile) 3 04-14-2009 11:06 AM
How to read in numbers lager then Integers? Stellaferox Questions (Windows Mobile) 2 02-24-2008 12:10 PM
Image Mouse events LineCutter Basic4ppc Wishlist 1 05-19-2007 11:24 AM


All times are GMT. The time now is 02:45 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0