4 * $TOG: DialogShell.C /main/10 1998/02/03 12:10:06 mgreess $
6 * RESTRICTED CONFIDENTIAL INFORMATION:
8 * The information in this document is subject to special
9 * restrictions in a confidential disclosure agreement between
10 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
11 * document outside HP, IBM, Sun, USL, SCO, or Univel without
12 * Sun's specific written approval. This document and all copies
13 * and derivative works thereof must be returned or destroyed at
16 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
22 #include <X11/Intrinsic.h>
23 #include <X11/Xmu/Editres.h>
24 #include <Xm/Protocols.h>
25 #include <Xm/AtomMgr.h>
28 #include <Dt/Session.h>
29 #include <DtMail/IO.hh>
31 // The following headers are private to CDE and should NOT be required
32 // but unfortunately are.
35 #include <Dt/HourGlass.h>
39 #include <Dt/IconFile.h>
41 #include "DialogShell.h"
42 #include "Application.h"
43 #include "RoamMenuWindow.h"
46 DialogShell::DialogShell(char *name, RoamMenuWindow *parent, WidgetClass wc)
53 assert( theApplication != NULL );
56 DialogShell::~DialogShell()
58 Atom WM_DELETE_WINDOW=XmInternAtom( XtDisplay( _w ),
61 XmRemoveWMProtocolCallback( _w,
63 ( XtCallbackProc ) quitCallback,
70 DialogShell::initialize()
72 _w = XtVaCreatePopupShell(
73 _name, _widgetClass, _parent->baseWidget(),
74 XmNdefaultPosition, False,
78 _w, (EventMask) 0, True,
79 (XtEventHandler) _XEditResCheckMessages, NULL);
82 installDestroyHandler();
83 _workArea = createWorkArea ( _w );
84 assert ( _workArea != NULL );
86 XtVaSetValues( _w, XmNdefaultPosition, False, NULL );
89 ( XtCallbackProc ) &DialogShell::popupCallback,
93 ( XtCallbackProc ) &DialogShell::popdownCallback,
96 Atom WM_DELETE_WINDOW=XmInternAtom( XtDisplay( _w ),
100 XmAddWMProtocolCallback( _w,
102 ( XtCallbackProc ) quitCallback,
105 // if (!XtIsManaged(_workArea)) XtManageChild(_workArea);
114 XtVaSetValues ( _w, XmNtitle, text, NULL );
119 DialogShell::popupCallback( Widget ,
120 XtPointer clientData,
121 XmAnyCallbackStruct *
124 DialogShell *obj=( DialogShell * ) clientData;
126 obj->displayInCurrentWorkspace();
131 DialogShell::popdownCallback( Widget ,
132 XtPointer clientData,
133 XmAnyCallbackStruct *
136 DialogShell *obj=( DialogShell * ) clientData;
141 DialogShell::manage()
143 if (NULL == _workArea) return;
144 if (!XtIsManaged(_workArea )) XtManageChild(_workArea);
145 UIComponent::manage();
150 DialogShell::quitCallback( Widget,
151 XtPointer clientData,
152 XmAnyCallbackStruct *)
154 DialogShell *dlg = ( DialogShell *) clientData;
159 DialogShell::busyCursor()
161 // Do nothing if the widget has not been realized
163 if (XtIsRealized(_w)) {
164 _DtTurnOnHourGlass(_w);
169 DialogShell::normalCursor()
171 // Do nothing if the widget has not been realized
173 if (XtIsRealized ( _w ))
175 _DtTurnOffHourGlass(_w);