addtomenu Method
Class: tsbaseform
Expand/Collapse source code of procedure addtomenu Source Code
*-- Add the form's caption to the Window menu popup
LOCAL lnBar

IF TYPE("oApp") == "O"
	IF !POPUP("Window")
		*- need to define Windows menu
		DO menus\window.mpr
	ENDIF
	*-- Find the next available bar number
	IF CNTBAR("Window") = 0 OR ;
		GETBAR("Window", CNTBAR("Window")) < 0     && At a Fox system BAR
		lnBar = CNTBAR("Window") + 1
	ELSE
		lnBar = GETBAR("Window", CNTBAR("Window")) + 1
	ENDIF

	DEFINE BAR lnBar OF Window PROMPT thisform.caption && AFTER _MLAST
	lcFormName = thisform.Name
	ON SELECTION BAR lnBar OF Window ACTIVATE Window &lcFormName
ENDIF