]> andersk Git - moira.git/blob - clients/mmoira/data.h
moved helpfile name to resources
[moira.git] / clients / mmoira / data.h
1 /*
2 ** Buttons & Pulldown menus across the top of the application.
3 ** When selected, it will continue to the submenu if non-null,
4 ** otherwise call the general callback.
5 */
6
7 typedef struct MenuItemS {
8         char            *label;         /* the displayed label */
9         struct MenuItemS **submenu;     /* if non-null, a submenu to display */
10         char            *accel;         /* accelerator */
11         int             operation;      /* op identifer */
12         char            *form;          /* name of form to popup */
13         char            *query;
14         int             argc;
15 } MenuItem;
16
17
18 typedef struct {
19         char    *prompt;                /* text displayed to left of input */
20         int     type;                   /* what sort of input expected */
21         union {                         /* default value / return value */
22                 char    *stringvalue;
23                 Boolean booleanvalue;
24                 int     integervalue;
25         } returnvalue;
26         Boolean insensitive;            /* grayed-out or not... */
27         Boolean changed;                /* true when prog changes config */
28         int     (*valuechanged)();      /* if non-NULL, call */
29         char    **keywords;             /* list of possible values */
30         char    *keyword_name;          /* name of keyword */
31         Widget  mywidget;
32         caddr_t parent;                 /* parent form */
33 } UserPrompt;
34
35 /* field types */
36 #define FT_STRING       1
37 #define FT_BOOLEAN      2
38 #define FT_KEYWORD      3
39 #define FT_NUMBER       4
40
41 /* max length of character fields */
42 #define MAXFIELDSIZE    256
43
44 #define stringval(f, n) ((f)->inputlines[n]->returnvalue.stringvalue)
45 #define boolval(f, n) ((f)->inputlines[n]->returnvalue.booleanvalue)
46
47 /*
48 ** All (foo **) entries are assumed to be null-terminated lists of foos.
49 */
50
51 typedef struct {
52         char    *label;                 /* text displayed on button */
53         int     (*returnfunction) ();   /* function called when button hit */
54 } BottomButton;
55
56 /*
57 ** Pass a pointer to the filled-in EntryForm structure back to the
58 ** returnfunction when the button is hit.
59 */
60
61 typedef struct {
62         char            *formname;      /* name of form (duh!) */
63         char            *instructions;  /* text at top of form */
64         UserPrompt      **inputlines;   /* list of input lines */
65         BottomButton    **buttons;      /* list of buttons on the bottom */
66         Widget          formpointer;    /* already exists? */
67         MenuItem        *menu;
68         caddr_t         extrastuff;     /* for future expansion */
69 } EntryForm;
70
71 /*
72 ** When you're coming up, check to see if formpointer is initialized.
73 ** If so, map it.  Otherwise, create the form and set formpointer to
74 ** the new toplevel widget id.  Then map it.
75 */
76
This page took 0.053883 seconds and 5 git commands to generate.