************************************
*!* AddToMenuWindow
LOCAL nBarNumber
nBarNumber = CNTBAR("Window") + 1
IF nBarNumber < 9
DEFINE BAR 8 OF Window PROMPT "\-"
nBarNumber = 9
ENDIF
DEFINE BAR nBarNumber OF Window PROMPT TRANSFORM(nBarNumber-8) + " " + thisform.caption
ON SELECTION BAR nBarNumber OF Window DO FormSelect with PROMPT()
************************************
*!* SetWindowMark
Local nBarCounter
FOR nBarCounter = 9 TO CNTBAR("Window")
sPrompt = PRMBAR("Window", nBarCounter)
SET MARK OF BAR nBarCounter OF Window TO SUBSTR(sPrompt,AT(" ",sPrompt)+ 1) == thisform.caption
ENDFOR
************************************
*!* DeleteFromMenuWindow
LOCAL nBarCounter, nStopCount, sPrompt, nRemoveBar
nStopCount = CNTBAR("Window")
nRemoveBar = 0
FOR nBarCounter = 9 TO nStopCount
sPrompt = PRMBAR("Window", nBarCounter)
IF SUBSTR(sPrompt,AT(" ",sPrompt)+1) == thisform.caption
nRemoveBar = nBarCounter
ELSE
IF nRemoveBar != 0 AND nBarCounter > nRemoveBar
DEFINE BAR nBarCounter - 1 OF Window PROMPT TRANSFORM(nBarCounter - 9) + SUBSTR(sPrompt,AT(" ",sPrompt))
endif
endif
ENDFOR
RELEASE BAR nStopCount OF Window
IF nStopCount = 9
RELEASE BAR 8 OF Window
endif
************************************
*!* The following needs to be placed in your procedure file (prg)
PROCEDURE FormSelect (sPrompt)
LOCAL nCounter, nFormCount
sPrompt = ALLTRIM(SUBSTR(sPrompt, AT(" ", sPrompt) + 1))
nFormCount = _Screen.formcount
FOR nCounter = 1 TO nFormCount
IF ALLTRIM(_screen.forms(nCounter).caption) == sPrompt
_screen.forms(nCounter).windowstate = 0
_screen.forms(nCounter).show(2)
endif
endfor
endproc