Edit menu recipe?

Frank Leahy frank at backtalk.com
Fri Aug 20 08:19:32 EDT 2004


Does anyone have an edit menu recipe they'd like to share?  I've got 
one that works for the main stack, but doesn't seem to work for other 
stacks.  I thought it was working at one point, but now I'm not sure 
whether it was ever working correctly.

Here's what I've got currently:

on DoMenuEditMenu theMenuItem
   switch (theMenuItem)
     --- Edit menu
   case "Undo"
     -- do nothing for now, not yet implemented
     break
   case "Cut"
     put the selectedChunk into curChunk
     if curChunk <> "" then
       put "put " & curChunk & " into theText" into theCmd
       do theCmd
       set the clipboardData["text"] to theText
       put "put empty into " & curChunk into theCmd
       do theCmd
     end if
     break
   case "Copy"
     put the selectedChunk into curChunk
     if curChunk <> "" then
       put "put " & curChunk & " into theText" into theCmd
       do theCmd
       set the clipboardData["text"] to theText
     end if
     break
   case "Paste"
     put the selectedChunk into curChunk
     put the clipboardData["text"] into pasteChunk

     put the focusedObject into theSelectedField
     if theSelectedField = "" then break
     put the short name of the focusedObject into fieldName

     if not fieldName contains "Description" then
       replace (numToChar(10) & numToChar(13)) with " " in pasteChunk
       replace numToChar(10) with " " in pasteChunk
       replace numToChar(13) with " " in pasteChunk
     end if

     put "put pasteChunk into " & curChunk into theCmd
     do theCmd
     put the selectedChunk into curSelection
     select curSelection
     break
   case "Clear"
     put the selectedChunk into curChunk
     if curChunk <> "" then
       put "put empty into " & curChunk into theCmd
       do theCmd
     end if
     break
   case "Select All"
     put the focusedObject into fieldName
     if word 1 of fieldName = "field" then
       put the short name of the focusedObject into shortFieldName
       put "select text of " & fieldName into theCmd
       do theCmd
     end if
     break
   default
     answer error "Error: forgot to handle '" & theMenuItem & "' in List 
of Albums menuPickEditMenu" titled getPhotoAlbumDialogName()
   end switch
end DoMenuEditMenu


Thanks,
-- Frank

Web Photos Pro: Software for Photo Bloggers and Other Photo Power Users
See us on the web at http://www.webphotospro.com/



More information about the Use-livecode mailing list