Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Nov 20, 2017 2:51 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: ListBox doubleclick not working
PostPosted: Thu Apr 25, 2013 8:47 pm 
Offline
User avatar

Joined: Fri Oct 10, 2008 7:14 pm
Posts: 94
Dim row,column as Integer
row=Me.RowFromXY(System.MouseX - Me.Left - Self.Left, System.MouseY - Me.Top - Self.Top)
column=Me.ColumnFromXY(System.MouseX - Me.Left - Self.Left, System.MouseY - Me.Top - Self.Top)
MsgBox "You double-clicked in cell "+Str(row)+", "+Str(column)


I copied this code directly out of the Library Reference for ListBox to determine which cell was double clicked.

I click the 3rd or 4th row of the ListBox and both row and column return -1

I have tried compiling both as Carbon and Cocoa - I'm running OS X of course Mountain Lion. Seems like I have made this work before so what am I doing wrong.


Top
 Profile  
Reply with quote  
 Post subject: Re: ListBox doubleclick not working
PostPosted: Thu Apr 25, 2013 11:10 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Depending on where this code is, "self" could be either the window (correct) or the listbox. This code will not work as part of a listbox subclass, it must be in the event code editor in the window. Also, it won't work as part of a containercontrol.


Top
 Profile  
Reply with quote  
 Post subject: Re: ListBox doubleclick not working
PostPosted: Fri Apr 26, 2013 8:51 am 
Offline
User avatar

Joined: Fri Oct 10, 2008 7:14 pm
Posts: 94
It's in the DoubleClick event of the Listbox control. No subclasses, the super is listed as Listbox. There are 3 columns in the list and the method to populate it works fine.

The code is right out of the Listbox control in the Language Reference and placed where it said to place it.

I really do appreciate the reply and all the help to be had here. But I still am not sure what's going on...

thanks
b


Top
 Profile  
Reply with quote  
 Post subject: Re: ListBox doubleclick not working
PostPosted: Fri Apr 26, 2013 9:08 am 
Offline
User avatar

Joined: Fri Oct 10, 2008 7:14 pm
Posts: 94
Ok, Tim's reply didn't help on the surface but it did get me looking at some other implications of what was said. Turns out the problem was in the PopulateListBox method I wrote which contained an error that apparently corrupted the listbox.

Anyway, thanks for getting me on the right train....

b


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group