Tips  |  Documentation  |  Archive
Function to auto-center child window inside parent

	   
	 //////////////////////////////////////////////// ////////
	//
	// Function: gf_childautocentr
	//
	// Access: public
	//
	// Arguments:
	// aw_parent Window, the parent window for aw_child
	// aw_child Window, child window for aw_parent
	//
	// Returns: None
	//
	// Description: Auto-center function
	// child window inside parent
	//
	//////////////////////////////////////////////// //////////
	//
	// Revision History
	//
	// Version
	// 5.0 Initial version (Varnavsky D.V.)
	// 6.0 Changed argument names to match
	// with agreement (28.07.1999)
	//
	//////////////////////////////////////////////// /////////
	//
	// BelGTASM, NIL-5
	//
	//////////////////////////////////////////////// /////////

	integer li_Wp, li_Hp, li_Wc, li_Hc
	li_Wp = aw_parent.WorkSpaceWidth () // Work area width
	li_Hp = aw_parent.WorkSpaceHeight () // Workspace Height
	li_Wc = aw_child.Width // Child Window Width
	li_Hc = aw_child.Height // Child Window Height

	IF li_wc> = li_wp THEN
	aw_child.X = 0
	ELSEIF li_Wc  = li_hp THEN
	aw_child.Y = 0
	ELSEIF li_hc  li_hp / 2 THEN
	aw_child.Y = 0
	ELSEIF li_hc