Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Right click Pop-ups in VFP 3
Message
 
 
À
22/11/1997 15:19:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Divers
Thread ID:
00061713
Message ID:
00061794
Vues:
60
>>>I have an editbox in vfp3.0b and I want to able use a right-click popup with undo, cut, copy, paste, and select all. Every thing works fine except the copy. When I select text and then right-click in the box the rightclick activates the popup but deselects the the text.
>>>
>>>I would appreciate any suggestions.
>>
>>In the right click method of a textbox subclass:
>>
>>do mymenu.mpr with This
>>
>>The code generated by GenMenu produced the following code (after removing all the comments):
>>
>>LParameters loObject
>>DEFINE POPUP shortcut SHORTCUT RELATIVE FROM MROW(),MCOL()
>>DEFINE BAR _med_cut OF shortcut PROMPT "Cu\>> KEY CTRL+X, "Ctrl+X" ;
>> SKIP FOR loObject.SelLength = 0 ;
>> MESSAGE "Removes the selection and places it onto the Clipboard"
>>DEFINE BAR _med_copy OF shortcut PROMPT "\>> KEY CTRL+C, "Ctrl+C" ;
>> SKIP FOR loObject.SelLength = 0 ;
>> MESSAGE "Copies the selection onto the Clipboard"
>>DEFINE BAR _med_paste OF shortcut PROMPT "\>> KEY CTRL+V, "Ctrl+V" ;
>> SKIP FOR Len(_ClipText) = 0 ;
>> MESSAGE "Pastes the contents of the Clipboard"
>>ACTIVATE POPUP shortcut
>>
>>You can of course add more functionality to this menu. You can also include the call to this menu from editboxes and anything else where text can be cut, copied, pasted.
>
>
>I tried your idea however when I right-click the text is deselected and loObject.SelLength is always equal to 0

When I created the menu (in VFP 5) I got the choice of making this a "shortcut". I would have thought the code above works regardless of version. You put the "do memenu.mpr" in the right click method of the textbox? Does the popup menu with those choices come up?
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform