Edit Menu

Sarah Reichelt sarah.reichelt at gmail.com
Sun Mar 25 19:34:02 EDT 2007


On 3/26/07, Joe Lewis Wilkins <pepetoo at cox.net> wrote:
> Do we have to implement each of the items in the Edit Menu? I thought
> basic text editing was automatic with the enabling of the Edit Menu. No?

When you make a menu using the Menu Builder, it includes an Edit menu
with the default items (Cut, Copy, Paste etc). If you then use
"Auto-script", you get the shell for the menuPick handler but it does
not include the actual commands.

I have a standard Edit menu script that I put into the script of any
Edit menu. Here it is if you would like to use/modify it.

Cheers,
Sarah


on menuPick pWhich
  switch pWhich
  case "Undo"
    undo
    break
  case "Cut"
    cut
    break
  case "Copy"
    copy
    break
  case "Paste"
    paste
    break
  case "Clear"
    put empty into the selection
    break
  case "Select All"
    put the focusedObject into tID
    if tID contains "field" then
      select text in tID
    end if
    break
  case "Preferences..."
  case "Preferences"
    go to stack "Prefs"
    break
  end switch
end menuPick



More information about the use-livecode mailing list