9
procedure move_cb(ob : PFL_OBJECT; data : longint);export;
16
but := PFL_OBJECT (data);
17
fl_get_object_geometry(but,@x,@y, @w, @h);
19
if ( (x + dx) < 0) or ( (x+w+dx) >= but^.form^.w) then
21
if ( (y + dy) < 0) or ( (y+h+dy) >= but^.form^.h) then
26
fl_set_object_position(but,x,y);
31
but, obj : PFL_OBJECT ;
34
fl_initialize(@argc, argv, 'FormDemo', nil, 0);
36
form := fl_bgn_form(FL_DOWN_BOX,400,200);
37
but := fl_add_button(FL_NORMAL_BUTTON,140,160,70,35,'Exit');
38
obj := fl_add_button(FL_TOUCH_BUTTON,330,150,50,30,'Move');
39
fl_set_object_callback(obj,PFL_CALLBACKPTR(@move_cb),longint(but));
42
fl_show_form(form,FL_PLACE_MOUSE,FL_NOBORDER,'ObjPos');
49
Revision 1.3 2003/10/27 15:48:13 peter
50
* renamed forms unit to xforms to prevent conflict with Forms
53
Revision 1.2 2002/09/07 15:42:57 peter
54
* old logs removed and tabs fixed