Up

_CRcompSizeBar

Creates a size bar in an ObjContainer.

Prototype :

fun [Chn ObjContainer ObjNode [I I] I I I AlphaBitmap] CompSizeBar

Return : CompSizeBar the new object or nil if error

See also :

Example :

typeof Win = ObjWin;;
typeof Abmp = AlphaBitmap;;
typeof Abmp2 = AlphaBitmap;;
typeof Cont = ObjContainer;;
typeof Cbmp = CompBitmap;;
typeof SizeBar = CompSizeBar;;

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

fun cbEnd (obj, user_parameter)=
	_DScompSizeBar SizeBar;
	_DScompBitmap Cbmp;
	_DScontainer Cont;
	_DSalphaBitmap Abmp;
	_DSalphaBitmap Abmp2;
	_closemachine;;
	
fun cbSize (obj, user_parameter, w, h)=
	_SIZEcontainer Cont 0 0 w h;
	_PAINTcontainer Cont;
	0;;

fun main ()=
	_showconsole;
	
	set Win = _CRwindow _channel nil 50 50 Width Height WN_NORMAL " Test CompSizeBar";
	_CBwinDestroy Win @cbEnd 0;
	_CBwinSize Win @cbSize 0;
	
	set Cont = _CRcontainerFromObjWin _channel Win 0 0 Width Height CO_CHILDINSIDE 0x777777 nil;
	
	set Abmp2 = _LDalphaBitmap _channel _checkpack "tests/scol2d/sizebar/0/test_2.png";
	let _GETalphaBitmapSize Abmp2 -> [w h] in
	set Cbmp = _CRcompBitmap _channel Cont nil [5 5] OBJ_ENABLE|OBJ_VISIBLE 0 Abmp2 0 0 w h;
	
	set Abmp = _LDalphaBitmap _channel _checkpack "tests/scol2d/sizebar/0/test.png";
	set SizeBar = _CRcompSizeBar _channel Cont nil [5 50] OBJ_ENABLE|OBJ_VISIBLE 0 SLB_VERTICAL Abmp;
	_SETcompSizeBarMinMax SizeBar (-30) 200;
	
	_PAINTcontainer Cont;
	0;;