Xojo Conferences
XDCMay2019MiamiUSA

ColumnFromXY/RowFromXY (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Sandbox: automatic open of last used file?
Next thread: Re: Creating emails in the default mail program


Re: OS X close confirmation save dialog   -   Garth Hjelte
  ColumnFromXY/RowFromXY   -   John Kouraklis
   Re: ColumnFromXY/RowFromXY   -   Lars Jensen
   Re: ColumnFromXY/RowFromXY   -   Lars Jensen
    Re: ColumnFromXY/RowFromXY   -   Lars Jensen
     Re: ColumnFromXY/RowFromXY   -   Lars Jensen
      Re: ColumnFromXY/RowFromXY [SOLVED]   -   John Kouraklis
     Re: ColumnFromXY/RowFromXY   -   John Kouraklis
    Re: ColumnFromXY/RowFromXY   -   John Kouraklis
   Re: ColumnFromXY/RowFromXY   -   Arnaud Nicolet
    Re: ColumnFromXY/RowFromXY   -   John Kouraklis

ColumnFromXY/RowFromXY
Date: 02.08.12 04:12 (Thu, 2 Aug 2012 04:12:20 +0100)
From: John Kouraklis
Hi to all,

I have a listbox and in the double-click even I try to calculate the row and
the column.

I use the code from the LR but it calculates the wrong row. It goes one row
forward.

This is the code:

CurrentRow= me.RowFromXY( System.MouseX - me.Left - Self.Left,_
System.MouseY -me.Top - Self.Top)

CurrentColumn= me.ColumnFromXY( System.MouseX -me.Left - Self.Left,_
System.MouseY - me.Top - Self.Top)

Any ideas why the calculation fails?

Thank you
John

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: ColumnFromXY/RowFromXY
Date: 02.08.12 13:31 (Thu, 2 Aug 2012 08:31:05 -0400)
From: Lars Jensen
> I got the expected results, for which the first row and
> first column are reported as Row = 0, Col = 0.

BTW, this is true whether regardless of Listbox.HasHeading.

lj

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: ColumnFromXY/RowFromXY
Date: 02.08.12 13:29 (Thu, 2 Aug 2012 08:29:05 -0400)
From: Lars Jensen
> I use the code from the LR but it calculates the wrong row.
> It goes one row forward.

The code that you posted works correctly for me in RS 2011r4.3.
Then I modified it slightly by putting this in Listbox.DoubleClick:

=cD#Dh
dim X as integer = System.MouseX - me.Left - Self.Left
dim Y as integer = System.MouseY - me.Top - Self.Top

dim Row as integer = me.RowFromXY(X, Y)
dim Col as integer = me.ColumnFromXY(X, Y)

dim Lines() as string

Lines.Append "Double-click coordinates:"
Lines.Append "X = " + str(X) + ", Y = " + str(Y)
Lines.Append "Row = " + str(Row) + ", Col = " + str(Col)

MsgBox Join(Lines, EndOfLine)

=#DoDe
I got the expected results, for which the first row and first column
are reported as Row = 0, Col = 0.

lj

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: ColumnFromXY/RowFromXY
Date: 02.08.12 14:20 (Thu, 2 Aug 2012 09:20:43 -0400)
From: Lars Jensen
> What I ave notices with the rowfromXY is that it was working fine
> until one day it was calculating the wrong row.

What version of RB are you using, and on what OS+version?

lj

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: ColumnFromXY/RowFromXY
Date: 02.08.12 15:55 (Thu, 2 Aug 2012 10:55:33 -0400)
From: Lars Jensen
I don't have access to Win7 at the moment. I tried it on WinXP with
RS2011 4.3 and it works as expected. If you can reproduce an error, I
would encourage you to file a feedback report.

lj

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: ColumnFromXY/RowFromXY
Date: 02.08.12 14:39 (Thu, 2 Aug 2012 14:39:14 +0100)
From: John Kouraklis
RS2011 4.3 on Win7


On 02/08/2012 14:20 , "Lars Jensen" <<email address removed>> wrote:

>> What I ave notices with the rowfromXY is that it was working fine
>> until one day it was calculating the wrong row.
>
>What version of RB are you using, and on what OS+version?
>
>lj
>
>_______________________________________________
>Unsubscribe or switch delivery mode:
><http://www.realsoftware.com/support/listmanager/>
>Search the archives:
><http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: ColumnFromXY/RowFromXY
Date: 02.08.12 14:09 (Thu, 2 Aug 2012 14:09:12 +0100)
From: John Kouraklis
What I ave notices with the rowfromXY is that it was working fine until
one day it was calculating the wrong row.

I tried hard-really hard to get what changed but I wasn't luck.

But I think I will try to use the .listindex hoping that it will be more
reliable, as Arnaud suggested

Thank you anyway

john

On 02/08/2012 13:29 , "Lars Jensen" <<email address removed>> wrote:

>> I use the code from the LR but it calculates the wrong row.
>> It goes one row forward.
>
>The code that you posted works correctly for me in RS 2011r4.3.
>Then I modified it slightly by putting this in Listbox.DoubleClick:
>
>=cD#Dn>
> dim X as integer = System.MouseX - me.Left - Self.Left
> dim Y as integer = System.MouseY - me.Top - Self.Top
>
> dim Row as integer = me.RowFromXY(X, Y)
> dim Col as integer = me.ColumnFromXY(X, Y)
>
> dim Lines() as string
>
> Lines.Append "Double-click coordinates:"
> Lines.Append "X = " + str(X) + ", Y = " + str(Y)
> Lines.Append "Row = " + str(Row) + ", Col = " + str(Col)
>
> MsgBox Join(Lines, EndOfLine)
>
>=3D?D3>
>I got the expected results, for which the first row and first column
>are reported as Row = 0, Col = 0.
>
>lj
>
>_______________________________________________
>Unsubscribe or switch delivery mode:
><http://www.realsoftware.com/support/listmanager/>
>Search the archives:
><http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: ColumnFromXY/RowFromXY
Date: 02.08.12 09:34 (Thu, 02 Aug 2012 10:34:35 +0200)
From: Arnaud Nicolet
Le 2 août 2012 à 05:12 Matin, John Kouraklis a écrit:

> I have a listbox and in the double-click even I try to calculate the row and
> the column.
>
> I use the code from the LR but it calculates the wrong row. It goes one row
> forward.

Any reason why you don't simply use me.ListIndex? Since a double click always selects the relevant row, RowFromXY is not needed. Also, RowFromXY may fail if the user moves the mouse quickly.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: ColumnFromXY/RowFromXY
Date: 02.08.12 14:05 (Thu, 2 Aug 2012 14:05:42 +0100)
From: John Kouraklis
Arnaud hi,

I hadn't thought to use list index. I just copied from the LR. But I think
it will work. I will check soon

Thank you

On 02/08/2012 9:34 , "Arnaud Nicolet" <<email address removed>> wrote:

>Le 2 août 2012 à 05:12 Matin, John Kouraklis a écrit:
>
>> I have a listbox and in the double-click even I try to calculate the
>>row and
>> the column.
>>
>> I use the code from the LR but it calculates the wrong row. It goes one
>>row
>> forward.
>
>Any reason why you don't simply use me.ListIndex? Since a double click
>always selects the relevant row, RowFromXY is not needed. Also, RowFromXY
>may fail if the user moves the mouse quickly.
>_______________________________________________
>Unsubscribe or switch delivery mode:
><http://www.realsoftware.com/support/listmanager/>
>Search the archives:
><http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>