Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Top level modal?
Message
From
06/02/1999 17:43:02
 
 
To
06/02/1999 11:06:20
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00184136
Message ID:
00184737
Views:
23
>
>May i get into this thread how you get the system edit menu options attached to a top-level form work properly with modal dialog box.
>
>I have a big app with a top level menu, a resizable _screen with an attached toolbar, multiple modeless forms of different natures and, when necessary,
>modal dialog boxes.
>
>When i tried moving the app from _screen based to top-level based the dialog boxes became so modal that none of the app COPY/CUT/... menu options were available. I tried some tricks like calling the mpx file from the activate event of the dialog box... it changed nothing
>
>We reverted the app to _screen. A pity not to be able from top-level :)
>
>Has anyone a way out or did i miss something ?
>
>François

Well, I haven't mastered the edit menu in a top level modal screen (which must be "in top level" with desktop=.T.) but here's the code I use for top level or in top level forms to have the edit keys active
********
Load event
********
* make sure sysmenu is on or auto
with thisform
IF .editPop
   * allow edit controls without a visible edit menu (eg top level forms)
   LOCAL cSM, cSP
   .editPopName= RIGHT(SYS(2015),6)   && a unique name fragment
   cSM= 'M_' + .editPopName
   cSP= 'P_' + .editPopName
   DEFINE MENU (m.cSM) IN (.name) BAR
   DEFINE PAD _msm_edit OF (m.cSM) PROMPT "Edit"
   ON PAD _msm_edit OF (m.cSM) ACTIVATE POPUP (m.cSP)
   DEFINE POPUP (m.cSP) MARGIN RELATIVE
   DEFINE BAR _med_undo OF (m.cSP) PROMPT "\&ltUndo" ;
	KEY CTRL+Z
   DEFINE BAR _med_redo OF (m.cSP) PROMPT "Re\&ltdo" ;
	KEY CTRL+R
   DEFINE BAR _med_cut OF (m.cSP) PROMPT "Cu\&ltt" ;
	KEY CTRL+X
   DEFINE BAR _med_copy OF (m.cSP) PROMPT "\&ltCopy" ;
	KEY CTRL+C
   DEFINE BAR _med_paste OF (m.cSP) PROMPT "\&ltPaste" ;
	KEY CTRL+V
   DEFINE BAR _med_slcta OF (m.cSP) PROMPT "Se\&ltlect All" ;
	KEY CTRL+A
ENDIF
endwith
*** end load event

********
Destroy event
********
IF thisform.editPop
   RELEASE POPUP ('P_' + .editPopName) EXTENDED
   RELEASE MENU ('M_' + .editPopName) EXTENDED
ENDIF
Now if I ever want edit controls in a form I just set .editpop=.T.

If anyone can get this appraoch to work in a modal form, I'm all ears.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform