[Lazarus] String Grid MouseToCell seems inconsistent when deleted some columns

Lukasz Sokol el.es.cr at gmail.com
Tue Sep 7 18:18:22 CEST 2010


On 07/09/2010 16:16, Jesus Reyes wrote:
> 
> 
> --- El mar 7-sep-10, Lukasz Sokol <el.es.cr at gmail.com> escribió:
> 
>> De: Lukasz Sokol <el.es.cr at gmail.com>
>> Asunto: Re: [Lazarus] String Grid MouseToCell seems inconsistent when deleted some columns
>> A: "Lazarus mailing list" <lazarus at lists.lazarus.freepascal.org>
>> Fecha: martes, 7 de septiembre de 2010, 10:01
>> Hello faber,
>>
>> On 07/09/2010 15:45, faber wrote:
>> [...]
>>>
>>> try with
>> StringGrid1.MouseToCell(ScreenToClient(Mouse.CursorPos))
> 
> [...]
> 
>> Oh... yes that solved the issue. Sorry for the noise :) i
>> was searching for
>> the ScreenToClient, but $Deity knows why I was looking for
>> it as procedure of
>> the StringGrid itself :)
>>
> 
> Indeed it should, and the correct translation of coordinates should be made with StringGrid1 
> 
> StringGrid1.MouseToCell(StringGrid1.ScreenToClient(Mouse.CursorPos))
> 
> otherwise MouseToCell would get parent form coordinates.
> 
> Jesus Reyes A.
> 
Bingo again :)
for some reason StringGrid1.ScreenToClient did not show in code completion (tried a few times
then decided there isn't any...) i guess what saved me was that the whole of form is filled
with the grid.


Lukasz
> 
>       
> 
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
> 





More information about the Lazarus mailing list