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>
26
#if NeedFunctionPrototypes
27
static void setvalue(Widget w, XtPointer address, XrmQuark type, Cardinal size)
29
static void setvalue(w, address, type, size)
38
if ((type != XmtQCardinal) &&
39
(type != XmtQDimension) &&
40
(type != XmtQPosition) &&
42
(type != XmtQShort) &&
43
(type != XmtQUnsignedChar)) {
44
XmtWarningMsg("XmtDialogSetDialogValues", "scale",
45
"Type mismatch: Widget '%s':\n\tCan't set widget value from a resource of type '%s'; scalar type expected.",
46
XtName(w), XrmQuarkToString(type));
50
if (size == sizeof(unsigned char))
51
value = *(unsigned char *)address;
52
else if (size == sizeof(unsigned short))
53
value = *(unsigned short *)address;
54
else if (size == sizeof(unsigned int))
55
value = *(unsigned int *)address;
58
XmScaleSetValue(w, value);
61
#if NeedFunctionPrototypes
62
static void getvalue(Widget w, XtPointer address, XrmQuark type, Cardinal size)
64
static void getvalue(w, address, type, size)
73
if ((type != XmtQCardinal) &&
74
(type != XmtQDimension) &&
75
(type != XmtQPosition) &&
77
(type != XmtQShort) &&
78
(type != XmtQUnsignedChar)) {
79
XmtWarningMsg("XmtDialogGetDialogValues", "scale",
80
"Type mismatch: Widget '%s':\n\tCan't set value on resource of type '%s'; scalar type expected.",
81
XtName(w), XrmQuarkToString(type));
85
XmScaleGetValue(w, &value);
87
if (size == sizeof(unsigned char))
88
*(unsigned char *)address = value;
89
else if (size == sizeof(unsigned short))
90
*(unsigned short *)address = value;
91
else if (size == sizeof(unsigned int))
92
*(unsigned int *)address = value;
95
static XmtWidgetType widget = {
103
#if NeedFunctionPrototypes
104
void XmtRegisterXmScale(void)
106
void XmtRegisterXmScale()
110
XmtRegisterWidgetTypes(&widget, 1);