CMMClick in Listboxes ... 
Author Message
 CMMClick in Listboxes ...

When making a 'normal' click in a ListBox, the handler can recognize
what row of the ListBox was clicked in (me.listindex holds the
information), but when using a CMMClick, unless the row was previously
highlighted, there seems to be no way to find out 'where we are'.

Or am I missing something?

Thanks for any pointers on this ...

Dave Bull
http://www.*-*-*.com/



Mon, 31 Oct 2005 16:07:31 GMT  
 CMMClick in Listboxes ...
On 5/15/03 04:07, Dave Bull did expound most eloquently:

Quote:
> When making a 'normal' click in a ListBox, the handler can recognize
> what row of the ListBox was clicked in (me.listindex holds the
> information), but when using a CMMClick, unless the row was previously
> highlighted, there seems to be no way to find out 'where we are'.

> Or am I missing something?

> Thanks for any pointers on this ...

Use the CellClick event; it tells you which Row and Column the user is
clicking in. If you 'return true', the row just clicked will not be
selected.

George

--
Please do not reply to this message. Although the email address is perfectly
valid, any replies to this account never get to the Inbox on my computer.



Mon, 31 Oct 2005 21:03:29 GMT  
 CMMClick in Listboxes ...

Quote:

> Use the CellClick event; it tells you which Row and Column the user is
> clicking in. If you 'return true', the row just clicked will not be
> selected.

Thank you ... this does indeed do the trick. In the Listbox CellClick
event I added:

   if isCMMClick then
     me.listindex = row
     contextualMenu1.open
   end

So the proper row gets selected (and highlighted), and the subsequent
ContextualMenu code now proceeds properly.

But I'm a bit confused about the fact that this CellClick is a
_function_ that returns a boolean value. Returns to who? This is not
being called by some method somewhere that would be looking for an
'answer'. It was instigated by a mouse click. To whom is the function
returning this true/false value?

Dave Bull



Mon, 31 Oct 2005 21:55:26 GMT  
 CMMClick in Listboxes ...

Quote:


> > Use the CellClick event; it tells you which Row and Column the user is
> > clicking in. If you 'return true', the row just clicked will not be
> > selected.

> Thank you ... this does indeed do the trick. In the Listbox CellClick
> event I added:

>    if isCMMClick then
>      me.listindex = row
>      contextualMenu1.open
>    end

> So the proper row gets selected (and highlighted), and the subsequent
> ContextualMenu code now proceeds properly.

> But I'm a bit confused about the fact that this CellClick is a
> _function_ that returns a boolean value. Returns to who? This is not
> being called by some method somewhere that would be looking for an
> 'answer'. It was instigated by a mouse click. To whom is the function
> returning this true/false value?

The return value goes to REALbasic so it can figure out whether or not
to select the cell.

Try this: Make a new project with a listbox on a window. Give the
listbox a row in its InitialValue. Put this code:

msgbox "cellclick"

in the CellClick event. Run the program and click on the row. You'll get
the message box.

Now, put:

return true

in the ListBox's MouseDown event. Run the program and click on the row.
You'll get no message box, because you're telling RB that you want to
deal with the mouse down on your own. It won't 'fire' the CellClick,
because you're handling it.

This works the same way with returning true from CellClick; you're
telling RB you're handling the click. If you return false (the default
if you don't return a value), it'll continue with doing what it usually
does, which is highlighting the clicked row.



Tue, 01 Nov 2005 05:06:53 GMT  
 CMMClick in Listboxes ...
Does it not tell the event manager instead of RB?


Thu, 03 Nov 2005 20:01:00 GMT  
 CMMClick in Listboxes ...

[.. re: why return true from CellClick or MouseDown ..]

Quote:
> Does it not tell the event manager instead of RB?

For clicks that don't get handled by your program, or by REALbasic, I
can only assume that the answer is yes.


Fri, 04 Nov 2005 08:59:34 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Listbox background paint and *my* listbox bug

2. Tk Listbox bindings (was: Tk Listbox Question)

3. listbox-rtb (listbox recolor) for TK4.0

4. Making Tk listboxes behave like MS-Windows listboxes

5. How do I make one listbox's choices be dependent on another listbox selection?

6. How to make ENTRY mirror active element in LISTBOX? and other listbox questions..

7. ListBox in VA 4.02 question

8. Owner-draw listbox?

9. VAST: "extended" listbox behavior

10. Hierarchical listbox: hot to test for sublistitem

11. 50,000 Record database to Listbox

12. Editable Listbox Problem

 

 
Powered by phpBB® Forum Software