_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
- Chn : a channel
- ObjContainer : a parent component
- ObjNode : a father node (can be nil)
- [I I] : x and y coordonates inside the parent component
- I : flags. Can be a combination of following values :
- OBJ_ENABLE : object is enabled
- OBJ_DISABLE : object is disabled
- OBJ_HIDE : object is hidden
- OBJ_VISIBLE : object is visible
- OBJ_CBNOPAINT : object is not repaint before user callbacks
- OBJ_TABSTOP : object is in the "tab stop" list
- OBJ_LW_FLEX : left margin from container border to object is flexible
- OBJ_MW_FLEX : object width is flexible
- OBJ_RW_FLEX : right margin from object to container border is flexible
- OBJ_LH_FLEX : top margin from container to object is flexible
- OBJ_MH_FLEX : object height is flexible
- OBJ_RH_FLEX : bottom margin from object to container is flexible
- I : filter flags. Defines how events are relayed to container, can be any combination of following values :
- OBJ_CONTAINER_CLICK : mouse click event is relayed to container click callback
- OBJ_CONTAINER_UNCLICK : mouse unclick event is relayed to container unclick callback
- OBJ_CONTAINER_DBLCLICK : mouse double-click event is relayed to container double-click callback
- OBJ_CONTAINER_KEYUP : keyup event is relayed to container keyup callback
- OBJ_CONTAINER_KEYDOWN : keydown event is relayed to container keydown callback
- OBJ_CONTAINER_MOUSEWHEEL : mouse wheel event is relayed to container mouse wheel callback
- OBJ_CONTAINER_MOVE : mouse move event is relayed to container mouse move callback
- OBJ_CONTAINER_ALLEVENTS : Activates all nodes' event forwardings: clicks, keys, wheel, move
- ObjWin : host/capture window
- ObjWin : activeX window (can be nil)
- I : refresh frenquency timer in millisecond. If nil, this value is 1000.
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;;