Jump to content


Photo

Problem with coordinates


  • Please log in to reply
5 replies to this topic

#1 downwards1

downwards1
  • Members
  • 57 posts

Posted 28 March 2007 - 09:59 PM

Hi Boki,

It seems that there is a stupid bug which happens on approx. 1 out of 10 PCs. I cannot reproduce it on my PCs because it doesn't happen on mine (but on some user PCs). I have a grid containing some buttons in a few cells. These buttons are no real buttons, they're pictures of buttons but they look like real buttons. However, because they shall act like real buttons I am using the OnMouseUp of the grid event to detect a click on such a button (OnCellSelect fires on mouse down). Well, then I check the coordinates which I get through OnMouseUp to determine the cell (-> the button) which was clicked to initiate e.g. a download (they are download buttons...).
On some user PCs the buttons did not work. Instead of downloading my app did something different - as if the user had clicked further left onto another cell. I put some message dialogs (showing the coordinates of the click) in my app to let the users test it and send my a screenshot. I can see that on a few PCs the X coordinate is wrong (much to low).

1) How can that happen?
2) If it can't be solved, do you have any other idea how I can make a workaround. (need to trigger the mouseUp and I need to know the cell).

Well, at the time I was writing this, I thought I can maybe remember the cell via the OnCellSelect and use this info finally at the OnMouseUp. That should work - I'll try it.


BR
DW

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 28 March 2007 - 11:32 PM

Hello Downwards,

Can you please send me one small portion of code you are using in MouseUp event.

Are you using GetCellAtPos metod maybe? Also, does this bug appear every time on "buggable" PC's, or only sometime?

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 downwards1

downwards1
  • Members
  • 57 posts

Posted 29 March 2007 - 08:36 PM

It happens every time on these "buggy" PCs.
No I don't use this GetCellAtPos method. I determine the column by checking X>columns[i].Left AND x<columns[i].Left+columns[i].Width.
I'm afraid GetCellAtPos would return the wrong cell too because the .Left and .Width values are correct on these buggy PCs.

I'll try to make an example, if I find the time.

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 29 March 2007 - 09:06 PM

Hello Downwards,

Maybe something is problem with code logic. I suggest you that you try with GetCellAtPos, and if this fail we may try to find a problem together.

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#5 downwards1

downwards1
  • Members
  • 57 posts

Posted 01 April 2007 - 10:49 PM

QUOTE (Boki (Berg) @ Mar 29 2007, 09:06 PM) <{POST_SNAPBACK}>
Hello Downwards,

Maybe something is problem with code logic. I suggest you that you try with GetCellAtPos, and if this fail we may try to find a problem together.

regards



I have exchanged the code and let the Grid do the calculation by using GetCellAtPos and it works! Got positiv feedback from a user just a minute ago.

Thanx for the GetCellAtPos hint!

BR
DW

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 02 April 2007 - 05:38 AM

Hello,

I am glad that this work now.

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users