gettingstarted
[Top] [All Lists]

Re: Sublcassing Interface Classes?

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: Sublcassing Interface Classes?
From: Charles Ross <chivalry at mac dot com>
Date: Mon, 28 Nov 2005 11:11:13 -0800
Delivered-to: gettingstarted at lists dot realsoftware dot com
References: <BB85D010-3BDB-4DE4-8DC2-5D953986FB7D at mac dot com> <90088af9524ed6dc27172f9da53532cf at declareSub dot com> <F2F9455B-A93B-4155-8AAF-3188289E00FB at mac dot com> <05ff31bff5d1fae7b1f04f6c98729aa7 at declareSub dot com>
Charles,

Unfortunately not. What you can try is to write a Listbox subclass that operates on the ActiveCell property. For instance --

Sub CellGotFocus()
  If me.ActiveCell <> Nil then
    me.ActiveCell.SelStart = 0
    me.ActiveCell.SelLength = Len(me.ActiveCell.Text)
  End if
  CellGotFocus
End Sub

I say "try" because the Listbox class may do things with the ActiveCell EditField that you will need to work around, if possible.

That may be good enough. It seems that this would do what I want it to, which is select all of the text within the edit field when it gets double-clicked. It seems that the DoubleClick event should be this:

Sub DoubleClick()
  me.EditCell me.ListIndex, 0
  me.ActiveCell.SelectAll
End Sub

The list boxes I'm working with at this time all have a single column, so this will work find for them, but I notice that the DoubleClick handler doesn't provide any information about the double- clicked column, while the CellClick handler does. This would seem to mean that I will need a property called clickedCol that CellClick uses to stores the column number, and that the last parameter of me.EditCell would then be clickedCol. Sound right?

Thanks,
Chuck

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

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

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