~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to packages/extra/forms/demo/touchbutton.pp

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{  This demo shows the use of a touch buttons. }
2
 
program touchbutton;
3
 
 
4
 
uses strings,forms;
5
 
 
6
 
var form : PFL_FORM;
7
 
    valobj,obj : PFL_OBJECT;
8
 
    value : LongInt;
9
 
 
10
 
 
11
 
Procedure show_val(ob : PFL_OBJECT;delta : Longint);export;
12
 
 
13
 
var     st : string[32];
14
 
 
15
 
begin
16
 
   value:=value+delta;
17
 
   str(value,st);
18
 
   st:=st+#0;
19
 
   fl_set_object_label(valobj, @st[1]);
20
 
end;
21
 
 
22
 
 
23
 
begin
24
 
  fl_initialize(@argc, argv, 'FormDemo', nil, 0);
25
 
  form := fl_bgn_form(FL_UP_BOX,360,140);
26
 
    obj := fl_add_button(FL_TOUCH_BUTTON,50,30,40,30,'@<<');
27
 
     fl_set_object_boxtype(obj,FL_FRAME_BOX);
28
 
     fl_set_object_color(obj, FL_COL1, FL_INDIANRED);
29
 
     fl_set_object_callback(obj, PFL_CALLBACKPTR(@show_val),-5);
30
 
     fl_set_button_shortcut(obj,'1'#0, 0);
31
 
    obj := fl_add_button(FL_TOUCH_BUTTON,90,30,40,30,'@<');
32
 
     fl_set_object_boxtype(obj,FL_FRAME_BOX);
33
 
     fl_set_object_color(obj, FL_COL1, FL_INDIANRED);
34
 
     fl_set_object_callback(obj, PFL_CALLBACKPTR(@show_val),-1);
35
 
     fl_set_button_shortcut(obj,'2'#0, 0);
36
 
    obj := fl_add_box(FL_BORDER_BOX,130,30,100,30,'');
37
 
    valobj:=obj;
38
 
     fl_set_object_color(obj,FL_LEFT_BCOL,FL_LEFT_BCOL);
39
 
    obj := fl_add_button(FL_TOUCH_BUTTON,230,30,40,30,'@>');
40
 
     fl_set_object_boxtype(obj,FL_FRAME_BOX);
41
 
     fl_set_object_color(obj, FL_COL1, FL_INDIANRED);
42
 
     fl_set_object_callback(obj, PFL_CALLBACKPTR(@show_val),1);
43
 
     fl_set_button_shortcut(obj,'3'#0, 0);
44
 
    obj := fl_add_button(FL_TOUCH_BUTTON,270,30,40,30,'@>>');
45
 
     fl_set_object_boxtype(obj,FL_FRAME_BOX);
46
 
     fl_set_object_callback(obj, PFL_CALLBACKPTR(@show_val),5);
47
 
     fl_set_object_color(obj, FL_COL1, FL_INDIANRED);
48
 
     fl_set_button_shortcut(obj,'4'#0, 0);
49
 
    obj := fl_add_button(FL_NORMAL_BUTTON,220,90,100,30,'Exit');
50
 
  fl_end_form;
51
 
  fl_show_form(form,FL_PLACE_CENTER,FL_NOBORDER,'Touch Buttons');
52
 
  fl_do_forms();
53
 
end.
54
 
 
55
 
{
56
 
  $Log: touchbutton.pp,v $
57
 
  Revision 1.3  2003/10/27 15:48:13  peter
58
 
    * renamed forms unit to xforms to prevent conflict with Forms
59
 
      from the LCL
60
 
 
61
 
  Revision 1.2  2002/09/07 15:42:57  peter
62
 
    * old logs removed and tabs fixed
63
 
 
64
 
  Revision 1.1  2002/01/29 17:55:02  peter
65
 
    * splitted to base and extra
66
 
 
67
 
}