File: part2_getting_started.texi

package info (click to toggle)
libforms 1.0.93sp1-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 11,548 kB
  • sloc: ansic: 97,227; sh: 9,236; makefile: 858
file content (111 lines) | stat: -rw-r--r-- 5,929 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
@node Part II Getting Started
@chapter Getting Started

To start up the Form Designer simply type fdesign without any
arguments. (If nothing happens, check whether the package has been
installed correctly.) A black window (the main window) will appear on
the screen. This is the window in which you can create your forms.
Next the control panel appears on the screen. No form is shown yet.

@ifhtml
@center @image{images/fdesign}
@end ifhtml
@ifnothtml
@center @image{images/fdesign,14cm}
@end ifnothtml

The control panel consists of five parts. The first part is the menu
bar, consisting of several groups of menus from which you can make
selections or give commands to the program. 

Directly below the menu you have a row of buttons for manipulating
forms and to invoke few other functions described below.

At the left there is a list of all existing forms. At the
start the list is empty, indicating that there are no forms yet.
There's no upper limit to the number of forms you that can be
created. You can work on exactly one form at a time and use this
list to switch between the different forms. Below the forms list
is another list of all groups in the form you're currently working
on. It will be empty at first because there are no groups yet.
Ignore this at the moment as we will come back to groups and their
uses later.

Just right of those two lists you find a list of all the different
types of objects that can be placed into the form. Use the
mouse to select the type of object you want to add to the form.

On the right side you find a number of buttons to give commands to the
program. Each of these buttons is bound to a function key. You can
either press the buttons with the mouse or press the corresponding
function keys on the keyboard. The functions of these keys will be
described below.

To create a new form click on the button labeled "New Form" in the
top-left corner of the control panel, just below the menu bar. A
little popup box will appear, prompting you for the name of the new
form. This is the name under which the application program will know
the form. You will have to provide a name (which must be a legal C
variable name). Type in the name and press @code{<Return>}. Now the
color of the other window for working on forms changes to that of the
background color of the new form. (Actually, each new form gets
created with a box already covering its entire area, what you see is
the color of this box. You can change most properties of this box
using the methods described below. Just its size is fixed to the size
of the form, which can be simply changed by resizing the window.) Note
that the form's name is added to the list of forms in the control
panel.

To add an object to the form choose the type of object in the control
panel by clicking in the list of object classes. Next move the mouse
into the form you are creating and drag the mouse while pressing the
left mouse button. By keeping the mouse button pressed you create a
box that has the desired size of the object. Release the button and
the object will appear. Note that a red outline appears around the new
object. This indicates that the object is selected. In this way you
can put all kinds of objects on the form.

It is possible to move objects around or change their sizes. To this
end first select the object by pressing the mouse in it. A red outline
will appear around the object. You now will be able to drag the object
around with the mouse. By grabbing the object at one of the four red
corners you can change its size. In this way you can change the layout
of the objects on the form. It is also possible to select multiple
objects and move or scale them simultaneously. See below for details.

To change the object's attributes, e.g. the label, of an object, first
single-click on the object to select it. Next press the function key
@code{<F1>} or click on the button labeled "F1 attribs'' in the
control panel or select "Object attributes" from the "Object" menu.
The same effect can also be achieved by double-clicking on the object
with the right mouse button. A new form appears in which you can
change all the different attributes. Their meanings should be clear
(if you have read the documentation on the Forms Library). Change the
attributes you want to change and finally press the button labeled
"Accept". To reset all attributes to their original values press
"Restore" (or "Cancel" if you also want to close the window for
modifying the attributes). See below for more information about
changing attributes.

In this way you can create the forms you want to have. Note that you
can work on different forms at the same moment. Just add another form
in the way described above and use the list of forms to switch between
them. After you have created all your forms select "Save" from the
"File" menu to save them to disk. It will ask you for a file name
using the file selector. In this file selector you can walk through
the directory tree to locate the place where you want to save the
file. Next, you can type in the name of the file (or point to it when
you want to overwrite an existing file). The name should end with
@code{.fd}. So for example, choose @file{ttt.fd}. The program now
creates three files: @file{ttt.c}, @file{ttt.h} and @file{ttt.fd}.
@file{ttt.c} contains a readable piece of C code that creates the
forms you designed. The file @file{ttt.h} contains the corresponding
header file for inclusion in your application program. The file
@file{ttt.fd} contains a description of the forms in such a way that
the Form Designer can read it back in later. The application program
now simply has to call the routines with names like
@code{create_form_xxx()} (replace @code{xxx} with the names you gave
to the forms) to create the different forms you designed.

These are the basic ideas behind the Form Designer. In the following
chapters we describe the program in more detail.