~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to packages/forms/USAGE

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2004-08-12 16:29:37 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040812162937-moo8ulvysp1ln771
Tags: 1.9.4-5
fp-compiler: needs ld, adding dependency on binutils.  (Closes: #265265)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
The usage of the forms library is relatively straightforward.
2
 
 
3
 
The interface has been designed as follows:
4
 
 
5
 
- All functions and procedures have kept their names.
6
 
- All types have a T appended in front of it.
7
 
  If the forms manual speaks of a FL_OBJECT type, then the FPK port
8
 
  has a TFL_OBJECT type.
9
 
  (This is because of pascal's CaSe InSenSiTiViTy)
10
 
- Pointers to all objects have been defined as Ptype_of_object.
11
 
  In C   : FL_OBJECT *
12
 
  in FPK : PFL_OBJECT = ^TFL_OBJECT
13
 
- All 'int' declarations are 'longint' in fpkpascal.
14
 
 
15
 
Check out the 'demo' directory for examples.
16
 
 
17
 
Some fields of some structs have been renamed (fields as 'label' or 'type')
18
 
when they were in conflict with Pascal reserved words. Unfortunately this
19
 
has not been done in a consistent way. This will change in the future,
20
 
hopefully. As a rule of thumb : reserved pascal words got the prefix 'the',
21
 
so 'type' became 'thetype' etc.
22
 
 
23
 
When in doubt : consult the interface part of 'forms.pp'
24
 
 
25
 
How to compile an executable ?
26
 
 
27
 
Easy as pie:
28
 
The only thing that you must remember is to provide the linker with the
29
 
path to the X-libraries, and the form libraries. You can set this through
30
 
the '-k' option of -Fl option. 
31
 
 
32
 
ppc386 -k-L/usr/X11/lib myprog.pp
33
 
or
34
 
ppc386 -Fl/usr/X11/lib myprog.pp
35
 
 
36
 
Will do the trick in most cases.
37
 
 
38
 
 
39
 
DESIGNING A FORM
40
 
================
41
 
 
42
 
As of version 0.88 of xforms, fdesign supports pascal directly !
43
 
Using version 0.86, you can use the workaround described below:
44
 
 
45
 
You can convert existing design programs as follows:
46
 
version 0.86:
47
 
  fdesign [other options] -convert -ada -filter fd2pascal file.fd
48
 
version 0.88:
49
 
  fdesign [other options] -convert -pascal file.fd
50
 
 
51
 
or start a new design with
52
 
version 0.86:
53
 
  fdesign -ada -filter fd2pascal
54
 
version 0.88:
55
 
  fdesign -pascal
56
 
 
57
 
This will emit pascal code. Use the following options
58
 
 -callback
59
 
   to emit procedure headers.
60
 
 -main
61
 
   to emit a program instead of a unit
62
 
 -altformat
63
 
   to use global variables instead of records.
64
 
 
65
 
Enjoy !
66
 
 
67
 
Michael Van Canneyt (michael@tfdec1.fys.kuleuven.ac.be)