Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FFC ShortCut Menu Class - How to use
Message
De
23/12/2011 23:39:41
Jim Wiggins
Affordable Custom Software
Illinois, États-Unis
 
 
À
23/12/2011 13:22:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01531620
Message ID:
01531647
Vues:
123
Here's an alternative to using the FFC. Put this in the RightClick of the controls (the class they are based on). It assumes they are controls such as text box or edit box so that the user can select some text.
* NOTE: You should probably set _CLIPTEXT="" in the control's GotFocus
LOCAL lcField, lcChoice
DEFINE POPUP ShortcutMenu ;
		FROM MROW(),MCOL() ;
		MARGIN ;
		RELATIVE ;
		SHORTCUT
DEFINE BAR 1 OF ShortcutMenu PROMPT "\<Copy" SKIP FOR this.SelLength=0		
DEFINE BAR 2 OF ShortcutMenu PROMPT "Cu\<t" SKIP FOR this.SelLength=0		
DEFINE BAR 3 OF ShortcutMenu PROMPT "\<Paste" SKIP FOR EMPTY(_CLIPTEXT)
DEFINE BAR 4 OF ShortcutMenu PROMPT "Paste T\<o" SKIP FOR EMPTY(_CLIPTEXT)

DEFINE POPUP FieldList SHORTCUT 
DEFINE BAR 1 OF FieldList PROMPT "First Name" SKIP FOR EMPTY(_CLIPTEXT)
DEFINE BAR 2 OF FieldList PROMPT "Last Name" SKIP FOR EMPTY(_CLIPTEXT)

ON BAR 4 OF ShortcutMenu ACTIVATE POPUP FieldList
ON SELECTION POPUP ShortcutMenu lcChoice = PROMPT()
ON SELECTION POPUP FieldList lcField = PROMPT()
ACTIVATE POPUP ShortcutMenu

IF VARTYPE(lcField)="C"
  DO CASE 
  CASE lcField = "First Name"
    * replace fname with _CLIPTEXT
    MESSAGEBOX("First Name")
  CASE lcField = "Last Name"
    * replace lname with _CLIPTEXT
    MESSAGEBOX("Last Name")
  ENDCASE
ENDIF 

DO CASE 
CASE VARTYPE(lcChoice)<>"C"
  RETURN
CASE lcChoice = "Copy"
  SYS(1500,"_med_copy","_medit")
CASE lcChoice = "Cut"
  SYS(1500,"_med_cut","_medit")
CASE lcChoice == "Paste"  && notice the ==
  SYS(1500,"_med_paste","_medit")
ENDCASE
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform