As WinDom from version 1.2, DFRM is safe-multithread. So there is two king of fonctions :
- functions safe-multithread : there are prefixed by 'mt_' (e.g. mt_dfrm_create())
- functions not multithread : without prefix (e.g. dfrm_create()) 'mt_' functions have an additional parameter (always the first parameter), which describe the 'WinDom application descriptor' provided of course by WinDom.
Exception of the application descriptor for mt-functions, DFRM functions have three kind of parameter :
- dialog reference : generally the first parameter, it is a pointer to as structure describing a dialog. This structure is totally hidden to prevent compatibility of the library with futur enhancement,
- coordinate, size, spacing parameters : these parameters control all geometric aspect of the dialog (size and position of object, spacing between object). These parameters can be positive or negative :
- if positive, values exprimed use the pixel screen unit,
- if negative, values exprimed use demi-size of character system size : demi-width character for width and demi-height character for height. For example, the call :
dfrm_sw( my_dialog, MY_BOX, -2);
gives a width of one character-width for the object MY_BOX. Using this kind of value is higly recommanded. You can use the function dfrm_sizecell() to melt pixel unit and semi-character unit and have a better control of geometric parameters.
- other parameters addressing specific parameter of object. There is no special thing to say.
DFRM (
dfrm_add()) can align objects in horizontal direction or in vertical direction but it is not possible to change direction during the building of objects. To place an object,
dfrm_add() uses always the position of previous object brother (i.e. previous child of parent object) to compute the object position. If you align verticaly an object than horizontaly an another object, this last object will be placed on a diagonal !
If you want to align objects in the two directions, you have to group objects with the same alignement in an insivible box (see dfrm_new_box()), then other objects and the invisible box can be aligned in the other direction.
For example, to build :
you have to :
- add but1 vertically
- create an invisible box (ibox) containing :
- but2 added horizontaly,
- but3 added horizontaly,
- but4 added horizontaly.
- add ibox vertically,
- add but5 vertically.