*Rightclick >do myshcut.mpr with this > >*myshcut.mpr >lparameters toObject >DEFINE POPUP shortcut SHORTCUT RELATIVE FROM MROW(),MCOL() >DEFINE BAR _med_cut OF shortcut PROMPT "Cu\<t" ; > KEY CTRL+X, "Ctrl+X" ; > MESSAGE "Removes the selection and places it onto the Clipboard" >DEFINE BAR _med_copy OF shortcut PROMPT "\<Copy" ; > KEY CTRL+C, "Ctrl+C" ; > MESSAGE "Copies the selection onto the Clipboard" >DEFINE BAR _med_paste OF shortcut PROMPT "\<Paste" ; > KEY CTRL+V, "Ctrl+V" ; > MESSAGE "Pastes the contents of the Clipboard" >DEFINE BAR _med_slcta OF shortcut PROMPT "Se\<lect All" ; > KEY CTRL+A, "Ctrl+A" ; > MESSAGE "Selects all text or items in the current window" >DEFINE BAR 5 OF shortcut PROMPT "Print" ; > KEY CTRL+P, "Ctrl+P" >On selection bar 5 of shortcut do Printme with toObject.Value > >ACTIVATE POPUP shortcut > >function printme >lparameters tcPrint >create cursor dummy (Edited m) >insert into dummy values (tcPrint) >report form dummy to printer >use in 'dummy' >Don't forget to create the report dummy.
Create_Popup: ******************************************************************** * Description.......: Create_Popup - creates shortcut menu for edit boxes * Calling Samples...: * Parameter List....: tcPopupName, toForm * Created by........: Cetin Basoz * Modified by.......: Nadya Nosonovsky 01/25/2002 10:30:05 AM ******************************************************************** lparameter tcPopupName, toForm if vartype(m.tcPopupName)<>"C" tcPopupName = 'Edit_Box' endif DEFINE POPUP (m.tcPopupName) SHORTCUT RELATIVE DEFINE BAR _med_undo OF (m.tcPopupName) PROMPT "\<Undo" ; KEY CTRL+Z, "Ctrl+Z" ; MESSAGE "Undoes the last command or action" DEFINE BAR _med_redo OF (m.tcPopupName) PROMPT "Re\<do" ; KEY CTRL+R, "Ctrl+R" ; MESSAGE "Repeats the last command or action" DEFINE BAR 3 OF (m.tcPopupName) PROMPT "\-" DEFINE BAR _med_cut OF (m.tcPopupName) PROMPT "Cu\<t" ; KEY CTRL+X, "Ctrl+X" ; MESSAGE "Removes the selection and places it onto the Clipboard" DEFINE BAR _med_copy OF (m.tcPopupName) PROMPT "\<Copy" ; KEY CTRL+C, "Ctrl+C" ; MESSAGE "Copies the selection onto the Clipboard" DEFINE BAR _med_paste OF (m.tcPopupName) PROMPT "\<Paste" ; KEY CTRL+V, "Ctrl+V" ; MESSAGE "Pastes the contents of the Clipboard" DEFINE BAR _med_slcta OF (m.tcPopupName) PROMPT "Se\<lect All" ; KEY CTRL+A, "Ctrl+A" ; MESSAGE "Selects all text or items in the current window" DEFINE BAR 8 OF (m.tcPopupName) PROMPT "P\<rint content" ; && _mfi_sysprint KEY CTRL+P, "Ctrl+P" ; MESSAGE "Prints window's content" local lnBars, lcValue lnBars = cntbar('Edit_Box') on selection bar m.lnBars of Edit_Box do PrintContent with _screen.ActiveForm.ActiveControl.ValuePrintContent:
******************************************************************** * Description.......: PrintContent - prints EditBox content * Calling Samples...: * Parameter List....: tcValue * Created by........: Nadya Nosonovsky 01/25/2002 12:33:03 PM * Modified by.......: ******************************************************************** lparameters tcValue if vartype(m.tcValue)<>"C" tcValue = "Nadya's test" endif local lnSelect lnSelect = select() select 0 create cursor dummy (cMessage M, cTitle M) append blank replace dummy.cMessage with m.tcValue, cTitle with "Procedure's code" report form Statistics to print prompt use && Close dummy select (m.lnSelect) returnThank you so much for the help.