realbasic-nug
[Top] [All Lists]

Re: How Do I Know if a ListBox Cell Is Being Edited?

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: How Do I Know if a ListBox Cell Is Being Edited?
From: john roberts <jarobe01 at athena dot louisville dot edu>
Date: Thu, 31 Oct 2002 00:12:29 -0500
on 10/30/02 9:40 PM, Steve Schacht at shot at frontier dot net wrote:

> Does a ListBox provide any means of finding out if one of its cells is being
> edited?

None that I know of.

> Apparently, the ActiveCell property is always non-Nil.  Also, the
> ActiveCell's Visible property is always true - even when it's not visible.
> :-/ 

Not entirely. The activeCell property is defined at runtime but becomes nil
after a cell is selected and then a no-cell-selected state occurs.

> I'm trying to enable the Edit menu when a LB cell is being edited and
> disable it otherwise.  I've got it working fine, but right now I'm setting
> my own flag each place I invoke the EditCell method.  Is there a cleaner
> way?

Similar here. I used to use a boolean "inCell" which I set in only
cellClick, cellGotFocus and cellLostFocus.
> 
> Also, what's this "Active" boolean property of a LB?  I don't see it in the
> docs anywhere.

The boolean "Active" appears to be in sync with the ActiveCell property.
Both of these are not modifiable at run-time but appear to be maintained
directly by RB. For example, I have the listbox subclassed and do
menuEnabling at the cell level by putting the following in the listbox
enableMenuItems event:

  dim cb As Clipboard
  if active and ListIndex>-1 then
    if me.ActiveCell.SelText<>"" then
      EditCopy.Enabled=true
      EditCut.Enabled=true
      EditClear.Enabled=true
    end
    cb=new Clipboard
    if cb.Text<>"" then
      EditPaste.Enabled=true
    end
  end
  
Seems to work fine and eliminates the use of "inCell" and its associated
code ... but I would like the boolean "Active" to be defined somewhere.

John


---
A searchable archive of this list is available at:
<http://dbserver.realsoftware.com/KBDB/search.php>

Unsubscribe:
<mailto:realbasic-nug-off at lists dot realsoftware dot com>

Subscribe to the digest: 
<mailto:realbasic-nug-digest at lists dot realsoftware dot com>
.


<Prev in Thread] Current Thread [Next in Thread>