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:02 root
15
* Revision 1.2 2001/06/12 16:25:28 andre
16
* *** empty log message ***
22
#include <Xmt/ScreenP.h>
23
#include <Xmt/DialogsP.h>
24
#include <X11/IntrinsicP.h>
25
#include <X11/CompositeP.h>
28
#if NeedFunctionPrototypes
29
void _XmtOkCallback(Widget w, XtPointer tag, XtPointer call_data)
31
void _XmtOkCallback(w, tag, call_data)
37
XmtPerScreenInfo *info = (XmtPerScreenInfo *)tag;
38
info->blocked = False;
39
info->button = XmtOkButton;
43
#if NeedFunctionPrototypes
44
void _XmtYesCallback(Widget w, XtPointer tag, XtPointer call_data)
46
void _XmtYesCallback(w, tag, call_data)
52
XmtPerScreenInfo *info = (XmtPerScreenInfo *)tag;
53
info->blocked = False;
54
info->button = XmtYesButton;
58
#if NeedFunctionPrototypes
59
void _XmtNoCallback(Widget w, XtPointer tag, XtPointer call_data)
61
void _XmtNoCallback(w, tag, call_data)
67
XmtPerScreenInfo *info = (XmtPerScreenInfo *)tag;
68
info->blocked = False;
69
info->button = XmtNoButton;
73
#if NeedFunctionPrototypes
74
void _XmtCancelCallback(Widget w, XtPointer tag, XtPointer call_data)
76
void _XmtCancelCallback(w, tag, call_data)
82
XmtPerScreenInfo *info = (XmtPerScreenInfo *)tag;
84
info->blocked = False;
85
info->button = XmtCancelButton;
89
#if NeedFunctionPrototypes
90
void _XmtHelpCallback(Widget w, XtPointer tag, XtPointer call_data)
92
void _XmtHelpCallback(w, tag, call_data)
98
XmtPerScreenInfo *info = (XmtPerScreenInfo *)tag;
101
* Display a help dialog.
102
* Use NULL dialog name and NULL title so we get the default.
103
* We make this a modal dialog, even though info dialogs are generally
104
* modeless because if we use a modeless one the user can't pop it down
105
* until the modal dialog underneath is popped down. I don't know if
106
* this is a bug in motif, or is because the help dialog is not a child
107
* of the modal dialog underneath, but it is bad behavior, so we work
108
* around it by using a modal help dialog. Also, this is good because
109
* we don't have to arrange to automatically pop down the help dialog when
110
* the modal underneath is popped down; the user can't pop down the modal
111
* until he dismisses the help.
113
(void) _XmtDisplayMessage(w, NULL, NULL, info->help_text, NULL,
115
XmDIALOG_INFORMATION,
116
XmDIALOG_PRIMARY_APPLICATION_MODAL);
120
#if NeedFunctionPrototypes
121
void _XmtDialogPopdownCallback(Widget w, XtPointer tag, XtPointer data)
123
void _XmtDialogPopdownCallback(w, tag, data)
129
XmtDialogCache *cache = (XmtDialogCache *)tag;
133
* if there is already a free dialog, destroy this one
134
* and remove it from the cache. Otherwise, just note that
135
* we now have one free.
137
if (cache->in_use < cache->num) {
141
* w is the shell. Get the dialog child
143
dialog = ((CompositeWidget)w)->composite.children[0];
144
for(i=0; i < cache->num; i++)
145
if (cache->dialogs[i] == dialog) break;
147
XtDestroyWidget(dialog);
149
/* now compress the remaining array elements */
150
for(; i < cache->num-1; i++) cache->dialogs[i] = cache->dialogs[i+1];