realbasic-nug
[Top] [All Lists]

Re: StaticText and '&'

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: StaticText and '&'
From: Tom Benson <tombenson at mac dot com>
Date: Sat, 1 Oct 2005 08:41:05 +1000
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <266C7B6A-943C-4AC8-A1E9-67BECD9AC344 at graymattercomputing dot com>
dim i as integer

for i = 0 to window.controlCount -1
    if window.control(i) isa StaticText then
staticText(window.control(i).text = replaceall(staticText (window.control(i).text,"&","&&")
    end
next


There would of course be some overhead in doing this, you should really go back and change their captions.

You could export to XML, do a find and replace, and then import back in again.

Cheers,
Tom

On 01/10/2005, at 8:29 AM, David Glass wrote:

In an effort to properly display ampersands in StaticText captions I was wondering if it would be possible to subclass the StaticText control to handle the caption manipulation.

Would this be an effective way of handling the issue, or am I better off with a bunch of 'replaceall(text, "&", "&&")' commands?

Ideally, a subclass is workable as I would like to then subclass popupmenus as well.

Any guidance on how to accomplish this would be appreciated.

--
David Glass - Gray Matter Computing
graymattercomputing.com - corepos.com
559-303-4915

Apple Certified Help Desk Specialist

_______________________________________________
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>


_______________________________________________
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>