1
{ This demo is meant to demonstrate the use of a free
16
i, j, depth, col : Longint;
20
{ The call back routine }
21
function handle_it(obj : PFL_OBJECT; event : longint;
23
key : longint; ev : pointer) : longint;cdecl;
29
fl_rect(obj^.x,obj^.y,obj^.w,obj^.h, obj^.u_ldata);
35
if (obj^.u_ldata = cole) then
37
if (obj^.u_ldata = FL_FREE_COL1) then
40
fl_redraw_object(obj);
46
procedure done(ob : PFL_OBJECT; data : longint); cdecl;
53
fl_initialize(@argc, argv, 'FormDemo', nil, 0);
54
form := fl_bgn_form(FL_UP_BOX,400,400);
55
obj := fl_add_button(FL_NORMAL_BUTTON,320,20,40,30,'Exit');
56
fl_set_object_callback(obj, PFL_CALLBACKPTR(@done), 0);
57
obj := fl_add_free(FL_CONTINUOUS_FREE,40,80,320,280
58
,'',PFL_HANDLEPTR(@handle_it));
60
depth := fl_get_visual_depth;
61
{ can't do it if less than 4 bit deep }
62
if depth=8 then writeln ('depth of 8');
65
writeln ('This Demo requires a depth of at least 4 bits');
68
cole := ((1 shl depth)-1);
72
{ obj^.u_ldata := col;
77
j := round(255 * (i - col) /(cole - col));
78
dummy:=fl_mapcolor(i, j, j, j);
82
fl_show_form(form,FL_PLACE_CENTER,FL_NOBORDER,'Free Object');