dtcalc: change from obsoleted MAXFLOAT to FLT_MAX from std C
[oweals/cde.git] / cde / lib / DtWidget / DtMsgs.c
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: DtMsgs.c /main/7 1996/06/19 11:27:11 cde-dec $ */
24 /*
25  * DtWidget/DtMsgs.c
26  */
27 /*** const causes the HP compiler to complain.  Remove reference until   ***
28  *** the build and integration people can figure out how to get this to  ***
29  *** work.                                                               ***/
30 /* #define CONST        const */
31 #define CONST 
32
33 #ifdef I18N_MSG
34
35 #include <nl_types.h>
36
37 #if !defined(NL_CAT_LOCALE)
38 #define NL_CAT_LOCALE 0
39 #endif 
40
41 #define _DTWIDGET_CAT_NAME      "DtWidget"
42
43 #endif /* I18N_MSG */
44
45 #include <DtWidgetI.h>
46
47 /*** Common messages across libDtWidget ***/
48 CONST char _DtMsgCommon_0000[] =
49    "Close";
50 CONST char _DtMsgCommon_0001[] =
51    "Help";
52
53 /*** ComboBox.c ***/
54 CONST char _DtMsgComboBox_0000[] =
55    "DtComboBoxWidget: Invalid alignment resource (defaulting to DtALIGNMENT_CENTER).";
56
57 CONST char _DtMsgComboBox_0001[] =
58    "DtComboBoxWidget: Invalid marginHeight resource (defaulting to 2).";
59
60 CONST char _DtMsgComboBox_0002[] =
61    "DtComboBoxWidget: Invalid marginWidth resource (defaulting to 2).";
62
63 CONST char _DtMsgComboBox_0003[] =
64    "DtComboBoxWidget: Invalid horizontalSpacing resource (defaulting to 0).";
65
66 CONST char _DtMsgComboBox_0004[] =
67    "DtComboBoxWidget: Invalid verticalSpacing resource (defaulting to 0).";
68
69 CONST char _DtMsgComboBox_0005[] =
70    "DtComboBoxWidget: Invalid orientation resource (defaulting to DtRIGHT).";
71
72 CONST char _DtMsgComboBox_0006[] =
73    "DtComboBoxWidget: Invalid itemCount resource (defaulting to 0).";
74
75 CONST char _DtMsgComboBox_0007[] =
76    "DtComboBoxWidget: Invalid selectedPosition resource (defaulting to 0).";
77
78 CONST char _DtMsgComboBox_0008[] =
79    "DtComboBoxWidget: Unable to set textField resource.";
80
81 CONST char _DtMsgComboBox_0009[] =
82    "DtComboBoxWidget: Unable to find item to set (DtComboBoxSetItem).";
83
84 CONST char _DtMsgComboBox_0010[] =
85    "DtComboBoxWidget: Unable to find item to select (DtComboBoxSelectItem).";
86
87 CONST char _DtMsgComboBox_0011[] =
88    "Resizing failed.  Maybe longest item is wider than space allowed.";
89
90 CONST char _DtMsgComboBox_0012[] =
91    "ComboBox";
92
93 CONST char _DtMsgComboBox_0013[] =
94    "cvtStringToType: wrongParameters, String to XmRType conversion needs no extra arguments";
95
96 CONST char _DtMsgComboBox_0014[] =
97    "DtComboBoxDeletePos: wrongParameters, Invalid position value";
98
99 /*** DialogBox.c TitleBox.c ***/
100 CONST char _DtMsgDialogBox_0000[] =
101    "Incorrect child type.";
102
103
104 /*** DialogBox.c ***/
105 CONST char _DtMsgDialogBox_0001[] =
106    "Invalid button position.";
107
108
109 /*** Editor.c & SearchDlg.c ***/
110 /* Default value for DtNformatSettingsDialogTitle */
111 CONST char _DtMsgEditor_0000[] =
112    "Format Settings";
113
114 /* Default values for DtNleftMarginFieldLabel and DtNrightMarginFieldLabel */
115 CONST char _DtMsgEditor_0001[] =
116    "Right Margin:";
117
118 CONST char _DtMsgEditor_0002[] =
119    "Left Margin:";
120
121 /* Default values for DtNleftAlignToggleLabel, DtNrightAlignToggleLabel, */
122 /* DtNjustifyToggleLabel, and DtNcenterToggleLabel */
123 CONST char _DtMsgEditor_0003[] =
124    "Left Align";
125
126 CONST char _DtMsgEditor_0004[] =
127    "Right Align";
128
129 CONST char _DtMsgEditor_0005[] =
130    "Justify";
131
132 CONST char _DtMsgEditor_0006[] =
133    "Center";
134
135 /* Default values for DtNformatParagraphButtonLabel and */
136 /* DtNformatAllButtonLabel */
137 CONST char _DtMsgEditor_0007[] =
138    "Paragraph";
139
140 CONST char _DtMsgEditor_0008[] =
141    "All";
142
143 /* Default value for DtNspellDialogTitle resource */
144 CONST char _DtMsgEditor_0009[] =
145    "Spell";
146
147 /* Default value for DtNfindChangeDialogTitle resource */
148 CONST char _DtMsgEditor_0010[] =
149    "Find/Change";
150
151 /* Default value for DtNmisspelledListLabel resource */
152 CONST char _DtMsgEditor_0011[] =
153    "Misspelled Words:";
154
155 /* Default value for DtNfindFieldLabel resource */
156 CONST char _DtMsgEditor_0012[] =
157    "Find:";
158
159 /* Default value for DtNchangeFieldLabel resource */
160 CONST char _DtMsgEditor_0013[] =
161    "Change To:";
162
163 /* Default value for DtNfindButtonLabel, DtNchangeButtonLabel, and */
164 /*  DtNchangeAllButtonLabel resources */
165 CONST char _DtMsgEditor_0014[] =
166    "Find";
167
168 CONST char _DtMsgEditor_0015[] =
169    "Change";
170
171 CONST char _DtMsgEditor_0016[] =
172    "Change All";
173
174 /* 'Unable to locate word' message */
175 CONST char _DtMsgEditor_0017[] =
176    "Unable to find the string %s in the current document.";
177
178 /* Default value for DtNinformationDialogTitle resource */
179 CONST char _DtMsgEditor_0018[] =
180    "Information";
181
182 /* Default values for DtNcurrentLineLabel, DtNtotalLineCountLabel, 
183  * DtNoverstrikeLabel, and DtNinsertLabel resources */
184 CONST char _DtMsgEditor_0019[] =
185    "Line:";
186
187 CONST char _DtMsgEditor_0020[] =
188    "Total:";
189
190 CONST char _DtMsgEditor_0021[] =
191    "Overstrike";
192
193 CONST char _DtMsgEditor_0022[] =
194    " ";
195
196 /* Default values for messages and title when spell filter is
197  * not executable or not found */
198 CONST char _DtMsgEditor_0023[] =
199    "Error executing spell filter.";
200
201 CONST char _DtMsgEditor_0024[] =
202    "Check to see if filter, %s, is installed and in the path.";
203
204 CONST char _DtMsgEditor_0025[] =
205    "Editor Error";
206
207
208
209 /*** Icon.c ***/
210 CONST char _DtMsgIcon_0000[] =
211    "Incorrect alignment.";
212
213 CONST char _DtMsgIcon_0001[] =
214    "Incorrect behavior.";
215
216 CONST char _DtMsgIcon_0002[] =
217    "Incorrect fill mode.";
218
219 CONST char _DtMsgIcon_0003[] =
220    "Incorrect string or pixmap position.";
221
222 CONST char _DtMsgIcon_0004[] =
223    "Incorrect margin width or height.";
224
225
226 /*** Icon.c TitleBox.c ***/
227 CONST char _DtMsgIcon_0005[] =
228    "Incorrect shadow type.";
229
230
231 /*** Indicator.c ***/
232 #ifdef _SUN_OS
233 CONST char _DtMsgIndicator_0000[] =
234    "/usr/spool/mail/";
235 #else
236 CONST char _DtMsgIndicator_0000[] =
237    "/usr/mail/";
238 #endif
239
240 /*** MenuButton.c ***/
241 CONST char _DtMsgMenuButton_0000[] =
242    "XmNmenuPost has illegal value.";
243
244 CONST char _DtMsgMenuButton_0001[] =
245    "DtMenuButtonWidget: Invalid Parent.";
246
247 CONST char _DtMsgMenuButton_0002[] =
248    "DtMenuButtonWidget: Invalid Submenu.";
249
250 /*** SpinBox.c ***/
251 CONST char _DtMsgSpinBox_0000[] =
252    "DtSpinBoxWidget: Invalid arrowSensitivity resource (defaulting to DtARROWS_SENSITIVE).";
253
254 CONST char _DtMsgSpinBox_0001[] =
255    "DtSpinBoxWidget: Invalid alignment resource (defaulting to DtALIGNMENT_CENTER).";
256
257 CONST char _DtMsgSpinBox_0002[] =
258    "DtSpinBoxWidget: Invalid initialDelay resource (defaulting to 250).";
259
260 CONST char _DtMsgSpinBox_0003[] =
261    "DtSpinBoxWidget: Invalid marginHeight resource (defaulting to 2).";
262
263 CONST char _DtMsgSpinBox_0004[] =
264    "DtSpinBoxWidget:  Invalid marginWidth resource (defaulting to 2).";
265
266 CONST char _DtMsgSpinBox_0005[] =
267    "DtSpinBoxWidget: Invalid arrowLayout resource (defaulting to DtARROWS_BEGINNING).";
268
269 CONST char _DtMsgSpinBox_0006[] =
270    "DtSpinBoxWidget: Invalid repeatDelay resource (defaulting to 200).";
271
272 CONST char _DtMsgSpinBox_0007[] =
273    "DtSpinBoxWidget: Invalid itemCount resource (defaulting to 0).";
274
275 CONST char _DtMsgSpinBox_0008[] =
276    "DtSpinBoxWidget: Invalid position resource (defaulting to 0).";
277
278 CONST char _DtMsgSpinBox_0009[] =
279    "DtSpinBoxWidget: Invalid position resource (defaulting to minimum).";
280
281 CONST char _DtMsgSpinBox_0010[] =
282    "DtSpinBoxWidget:  Invalid decimalPoints resource (defaulting to 0).";
283
284 CONST char _DtMsgSpinBox_0011[] =
285    "DtSpinBoxWidget: Invalid minimum resource (defaulting to maximum).";
286
287 CONST char _DtMsgSpinBox_0012[] =
288    "DtSpinBoxWidget:  Unable to set textField resource.";
289
290 CONST char _DtMsgSpinBox_0013[] =
291    "DtSpinBoxWidget: Unable to find item to set (DtSpinBoxSetItem).";
292
293 CONST char _DtMsgSpinBox_0014[] =
294    "SpinBox";
295
296 /*** TitleBox.c ***/
297 CONST char _DtMsgTitleBox_0000[] =
298    "Incorrect title position.";
299
300 CONST char _DtMsgTitleBox_0001[] =
301    "Incorrect title alignment.";
302
303 CONST char _DtMsgTitleBox_0002[] =
304    "Only one child should be inserted in a frame.";
305
306 CONST char _DtMsgTitleBox_0003[] =
307    "Invalid margin width.";
308
309 CONST char _DtMsgTitleBox_0004[] =
310    "Invalid margin height.";
311
312 #ifdef I18N_MSG
313
314 /*****************************************************************************
315  *
316  * Function: _DtWidgetGetMessage
317  *
318  * Parameters:
319  *
320  *   int        set -           The message catalog set number.
321  *
322  *   int        n -             The message number.
323  *
324  *   char       *s -            The default message if the message is not
325  *                              retrieved from a message catalog.
326  *
327  * Returns: the string for set 'set' and number 'n'.
328  *
329  *****************************************************************************/
330
331 char * 
332 _DtWidgetGetMessage(int set,
333                     int n,
334                     char *s)
335 {
336   char *msg;
337   nl_catd catopen();
338   char *catgets();
339   static int first = 1;
340   static nl_catd nlmsg_fd;
341   
342   if ( first ) 
343     {
344       _DtProcessLock();
345       if ( first)
346         {
347           nlmsg_fd = catopen(_DTWIDGET_CAT_NAME, NL_CAT_LOCALE);
348           first = 0;
349         }
350       _DtProcessUnlock();
351     }
352
353   msg=catgets(nlmsg_fd,set,n,s);
354   return (msg);
355 }
356 #endif /* I18N_MSG */