]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/forms/README
Change the semantics of 'none' and 'auto' viewers/editors: 'none' means now
[lyx.git] / src / frontends / xforms / forms / README
1 All .fd files go in this directory.
2 Each .fd file should have just one form in them
3
4 NOTE: An exception to the above is any tabbed form which
5       xforms requires multiple forms to create.  In that case
6       the group of forms constitutes one gui form.
7
8 * All forms should be named form_xxx and saved into a file of the same name.
9 For example, the copyright notice is called form_copyright and is stored in
10 form_copyright.fd.
11 Tabbed folders should be named form_xxx_yyy.
12 For example, the file folder in the graphics dialog has the identifier
13 form_graphics_file.
14
15 If you match this pattern, the fdfix.sh script will be able to manipulate
16 the generated .c and .h files to produce the .C and .h files used by LyX. A form
17 called form_xxx will result in a struct FD_xxx.
18
19 * Name all buttons and other form components that are likely to cause a
20 callback. The names should be of the form:  button_ok, radio_group_item and
21 so on.
22
23 Being more explicit:
24         class             | prefix
25         ------------------+-------
26         FL_BROWSER        | browser
27         FL_BUTTON         | button
28         FL_PIXMAPBUTTON   | button
29         FL_CHECKBUTTON    | check
30         FL_CHOICE         | choice
31         FL_COUNTER        | counter
32         FL_DIAL           | dial
33         FL_INPUT          | input
34         FL_FRAME          | frame
35         FL_LABELFRAME     | frame
36         FL_ROUND3DBUTTON,
37         RADIO_BUTTON      | radio
38         FL_SLIDER         | slider
39         FL_VALSLIDER      | slider
40         FL_TABFOLDER      | tabfolder
41         FL_TEXT           | text
42
43 The only exceptions to this are objects that are to be converted in the sed
44 scripts. At the moment this applies only to bmtable and to combox:
45
46         Convert an FL_BUTTON to a FL_BMTABLE by using prefix "bmtable".
47         Convert an FL_CHOICE to a FL_COMBOX by using prefix "combox".
48
49 Enter the full name of the callback eg.:
50         C_FormBaseOkCB
51
52 If you follow these simple rules then you will generate code for functions
53 build_xxx that will need no further editing to make them work. For example,
54 form_graphics.h contains the struct declarations and build methods, so:
55
56 extern FD_graphics * build_graphics(void *);
57 extern FD_graphics_file * build_graphics_file(void *);
58 extern FD_graphics_size * build_graphics_size(void *);
59 extern FD_graphics_bbox * build_graphics_bbox(void *);
60 extern FD_graphics_special * build_graphics_special(void *);
61 extern FD_graphics_lyxview * build_graphics_lyxview(void *);
62
63 where the function is to be passed a pointer to the parent dialog
64 (usually "this") so that this pointer can be cast off to FormBase * in the
65 assigned callback function and the appropriate class method called.