2
* Motif Tools Library, Version 3.1
5
* Written by David Flanagan.
6
* Copyright (c) 1992-2001 by David Flanagan.
7
* All Rights Reserved. See the file COPYRIGHT for details.
8
* This is open source software. See the file LICENSE for details.
9
* There is no warranty for this software. See NO_WARRANTY for details.
12
* Revision 1.1.1.1 2001/07/18 11:06:03 root
15
* Revision 1.2 2001/06/12 16:25:28 andre
16
* *** empty log message ***
22
#include <Xmt/WidgetType.h>
23
#include <Xmt/QuarksP.h>
27
#if NeedFunctionPrototypes
28
static void setvalue(Widget w, XtPointer address, XrmQuark type, Cardinal size)
30
static void setvalue(w, address, type, size)
37
if (type == XmtQString)
38
XmTextSetString(w, *(String *)address);
39
else if (type == XmtQBuffer)
40
XmTextSetString(w, (char *)address);
42
XmtWarningMsg("XmtDialogSetDialogValues", "xmtext",
43
"Type mismatch:\n\tCan't set value from resource of type '%s'. String or Buffer expected.",
44
XrmQuarkToString(type));
47
#if NeedFunctionPrototypes
48
static void getvalue(Widget w, XtPointer address, XrmQuark type, Cardinal size)
50
static void getvalue(w, address, type, size)
57
if (type == XmtQString)
58
*(String *)address = XmTextGetString(w);
59
else if (type == XmtQBuffer) {
60
String s = XmTextGetString(w);
63
strncpy(address, s, size-1);
64
((char *)address)[size-1] = '\0';
66
XmtWarningMsg("XmtDialogGetDialogValues", "xmtextTrunc",
67
"The input value is %d characters long\n\tand does not fit into a buffer %d characters long.\n\tThe trailing characters have been truncated.",
72
XmtWarningMsg("XmtDialogGetDialogValues", "xmtextType",
73
"Type mismatch:\n\tCan't set input value on a resource of type '%s'. String or Buffer expected.",
74
XrmQuarkToString(type));
77
static XmtWidgetType text = {
85
static XmtWidgetType stext = {
93
#if NeedFunctionPrototypes
94
void XmtRegisterXmText(void)
96
void XmtRegisterXmText()
100
XmtRegisterWidgetTypes(&text, 1);
103
#if NeedFunctionPrototypes
104
void XmtRegisterXmScrolledText(void)
106
void XmtRegisterXmScrolledText()
110
XmtRegisterWidgetTypes(&stext, 1);