Fix for a crash which happened when a document couldn't be opened.
[AROS-Contrib.git] / fish / memomaster / helpmode.c
blobb6a2147d0beca55d6f77204026649bafd7fc8c7e
1 #include <aros/oldprograms.h>
3 #include <exec/types.h>
4 #include <intuition/intuition.h>
6 extern void DisplayT(char **);
8 extern struct IntuitionBase *IntuitionBase;
9 extern struct Window *mm_w;
11 char *Help_display[]= {
12 "",
13 " MemoMaster V2.0",
14 "",
15 " Select a memo for action by clicking on it here. ",
16 " The Edit and Delete routines process all selected memos. ",
17 " Any number of memos may be selected at any time.",
18 "",
19 '\0' };
21 char *Help_close[]= {
22 "",
23 " MemoMaster V2.0",
24 "",
25 " Click on close gadget to exit MemoMaster, ",
26 " saving list of memos back to disk if",
27 " any have changed. ",
28 "",
29 '\0' };
31 char *Help_add[]= {
32 "",
33 " MemoMaster V2.0",
34 "",
35 " Displays a requester allowing you to add a memo item ",
36 " to the list.",
37 "",
38 '\0' };
40 char *Help_del[]= {
41 "",
42 " MemoMaster V2.0",
43 "",
44 " Removes selected memos from the list in memory. ",
45 " The memos you want to delete must be selected",
46 " in the display window first. The program will ",
47 " ask for confirmation that each selected memo",
48 " be deleted.",
49 "",
50 '\0' };
52 char *Help_edi[]= {
53 "",
54 " MemoMaster V2.0",
55 "",
56 " Displays a requester allowing you to ",
57 " edit an existing memo. The memos you",
58 " want to edit must be selected in the",
59 " display window first.",
60 "",
61 '\0' };
63 char *Help_chk[]= {
64 "",
65 " MemoMaster V2.0",
66 "",
67 " Checks the list of memos in memory for any to be ",
68 " displayed today.",
69 "",
70 '\0' };
72 char *Help_shr[]= {
73 "",
74 " MemoMaster V2.0",
75 "",
76 " Close main window but keep process in memory. A small",
77 " window will open with a gadget marked EXPAND. Clicking",
78 " inside the small window (not the border) will reopen",
79 " the main window in the same state as when suspended.",
80 " While the main window is closed, the process will be",
81 " in a WAIT state therefore taking minimal processor",
82 " resource from your other applications.",
83 "",
84 '\0' };
86 char *Help_beg[]= {
87 "",
88 " MemoMaster V2.0",
89 "",
90 " The first memos in the list ",
91 " in memory are displayed.",
92 "",
93 '\0' };
95 char *Help_bkb[]= {
96 "",
97 " MemoMaster V2.0",
98 "",
99 " Move the display back one block of 6 ",
100 " memos.",
102 '\0' };
104 char *Help_bki[]= {
106 " MemoMaster V2.0",
108 " Move memos 1 back toward start of list. ",
110 '\0' };
112 char *Help_fwi[]= {
114 " MemoMaster V2.0",
116 " Move memos 1 on toward end of list. ",
118 '\0' };
120 char *Help_fwb[]= {
122 " MemoMaster V2.0",
124 " Moves memos in display window one block ",
125 " of 6 forwards.",
127 '\0' };
129 char *Help_eol[]= {
131 " MemoMaster V2.0",
133 " Click here to move display to end of list. ",
135 '\0' };
138 void Mode_Help()
140 int Class,g;
141 struct IntuiMessage *msg;
142 APTR address;
143 BOOL finished;
144 ULONG SignalMask;
146 SignalMask = 1L << mm_w->UserPort->mp_SigBit;
147 finished=FALSE;
148 while(!finished)
150 Wait( SignalMask );
151 msg = (struct IntuiMessage *) GetMsg( mm_w->UserPort );
152 if(msg)
154 Class = msg->Class;
155 address = msg->IAddress;
156 ReplyMsg( (struct Message *)msg );
157 switch( Class )
159 case CLOSEWINDOW:
160 DisplayT(Help_close);
161 break;
162 case GADGETUP:
163 g=((struct Gadget *)address)->GadgetID;
164 switch (g)
166 case 0:
167 case 1:
168 case 2:
169 case 3:
170 case 4:
171 case 5:
172 DisplayT(Help_display);
173 break;
174 case 6:
175 DisplayT(Help_add);
176 break;
177 case 7:
178 DisplayT(Help_del);
179 break;
180 case 8:
181 DisplayT(Help_edi);
182 break;
183 case 9:
184 DisplayT(Help_chk);
185 break;
186 case 10:
187 DisplayT(Help_shr);
188 break;
189 case 11:
190 finished=TRUE;
191 break;
192 case 12:
193 DisplayT(Help_beg);
194 break;
195 case 13:
196 DisplayT(Help_bkb);
197 break;
198 case 14:
199 DisplayT(Help_bki);
200 break;
201 case 15:
202 DisplayT(Help_fwi);
203 break;
204 case 16:
205 DisplayT(Help_fwb);
206 break;
207 case 17:
208 DisplayT(Help_eol);
209 break;
211 break;
217 /*=====================================================================*/