>Several years ago I remember a DevCon demo where open instances of a form (or open windows) were added to the app's menu -- like most Windows apps do when items are opened. Can someone offer hints as to how this is done? I've experimented with redefining the menu pad and all of its bars on the fly, but I seem to remember that the solution demonstrated was more elegant than that. In this case, the form's caption includes a job number that should become the menu prompt. The prompt will need to change when the job data is requeried. Also, there can be multiple instances of the form.
Lynda,
In my form base class I call the method AddToMenu
local lnBar, lcCaption, lcFormName
lcCaption = ThisForm.Caption
if popup("Window")
if cntbar("Window") = 0 or ;
getbar("Window", cntbar("Window")) < 0
lnBar = cntbar("Window") + 1
else
lnBar = getbar("Window", cntbar("Window")) + 1
endif
define bar lnBar of Window prompt lcCaption
lcFormName = '"'+ThisForm.Name+'"'
on selection bar lnBar of Window ActivateIt(&lcFormName)
ENDIF
Then reverse the process to remove it.
HTH
Caroline