Up

_CRcompWindow Scol 5.x or above required

Create a new CompWindow object.

Prototype :

fun [Chn ObjContainer ObjNode [I I] I I ObjWin ObjWin I] CompWindow

Return : CompWindow the new object or nil if error

See also :

Example :

typeof Win = ObjWin;;
typeof Cont = ObjContainer;;
typeof Cwin = CompWindow;;
typeof Hwin = ObjWin;;
typeof AXwin = ObjWin;;

typeof Guid = GUID;;
typeof ax = AX;;

var Width = 500;;
var Height = 300;;

fun cbEnd (obj, user_parameter)=
	_DScompWindow Cwin;
	_DSwindow Hwin;
	_DScontainer Cont;
	_closemachine;;
	
fun cbSize (obj, user_parameter, w, h)=
	_SIZEcontainer Cont 0 0 w h;
	_PAINTcontainer Cont;
	0;;

fun main (clsid)=
	_showconsole;
	
	set Win = _CRwindow _channel nil 50 50 Width Height WN_NORMAL " Test CompWindow";
	_CBwinDestroy Win @cbEnd 0;
	_CBwinSize Win @cbSize 0;
	
	set Cont = _CRcontainerFromObjWin _channel Win 0 0 Width Height CO_CHILDINSIDE 0x777777 nil;
	
	set Guid = _AXstring2GUID clsid;
	set ax = _AXCreateInstance _channel Guid;
	if ax == nil then
	(
		_fooS "AX not found !";
		1
	)
	else
	(
		set Hwin = _CRwindow _channel nil 0 0 Width-60 200 WN_NORMAL " Host window";
		_CRtext _channel AXwin 5 5 200 20 ET_BORDER "Bob and Alice";
		set AXwin = _CRwindow _channel Hwin 10 10 250 125 WN_CHILD|WN_CHILDMENU " AX window";
		_AXSetSite AXwin ax;
		set Cwin = _CRcompWindow _channel Cont nil [50 80] OBJ_ENABLE|OBJ_VISIBLE|WN_NORMAL 0 Hwin AXwin 5000;
		0		
	);

	_PAINTcontainer Cont;
	0;;