Can one permanentaly change a text field's case to capitals?

Ken Ray kray at sonsothunder.com
Mon Jan 30 22:05:06 EST 2006


On 1/30/06 8:56 PM, "Jim Ault" <JimAultWins at yahoo.com> wrote:

> On 1/30/06 6:37 PM, "Ken Ray" <kray at sonsothunder.com> wrote:
>> 
>> on pasteKey
>>   put toUpper(the clipboardData["text"]) into the selection
>> end pasteKey
> 
>> Simple, no? 
> 
> Cool, since they could only enter the clipboardData using the keyboard to
> paste... or perhaps a mouse and a menu command, if paste is available.
> Would pasteKey catch the menu?

No - you'd have to handle that in the Edit menu button script. I might
choose to use a custom property on the field to determine if it should be
all caps or not:

  on menuPick pChoice
    if pChoice = "Paste" then
      if the uCapsOnly of the selectedField is true then
        put toUpper(the clipboardData["text"]) into the selection
      else
        put the clipboardData["text"] into the selection
      end if
    end if
  end menuPick

(Of course this would be longer with switch/case for more menu items other
than Paste, but you get the idea.)


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com





More information about the use-livecode mailing list