2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
26 * $TOG: DialogShell.C /main/10 1998/02/03 12:10:06 mgreess $
28 * RESTRICTED CONFIDENTIAL INFORMATION:
30 * The information in this document is subject to special
31 * restrictions in a confidential disclosure agreement between
32 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
33 * document outside HP, IBM, Sun, USL, SCO, or Univel without
34 * Sun's specific written approval. This document and all copies
35 * and derivative works thereof must be returned or destroyed at
38 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
44 #include <X11/Intrinsic.h>
45 #include <X11/Xmu/Editres.h>
46 #include <Xm/Protocols.h>
47 #include <Xm/AtomMgr.h>
50 #include <Dt/Session.h>
51 #include <DtMail/IO.hh>
53 // The following headers are private to CDE and should NOT be required
54 // but unfortunately are.
57 #include <Dt/HourGlass.h>
61 #include <Dt/IconFile.h>
63 #include "DialogShell.h"
64 #include "Application.h"
65 #include "RoamMenuWindow.h"
68 DialogShell::DialogShell(char *name, RoamMenuWindow *parent, WidgetClass wc)
75 assert( theApplication != NULL );
78 DialogShell::~DialogShell()
80 Atom WM_DELETE_WINDOW=XmInternAtom( XtDisplay( _w ),
83 XmRemoveWMProtocolCallback( _w,
85 ( XtCallbackProc ) quitCallback,
92 DialogShell::initialize()
94 _w = XtVaCreatePopupShell(
95 _name, _widgetClass, _parent->baseWidget(),
96 XmNdefaultPosition, False,
100 _w, (EventMask) 0, True,
101 (XtEventHandler) _XEditResCheckMessages, NULL);
104 installDestroyHandler();
105 _workArea = createWorkArea ( _w );
106 assert ( _workArea != NULL );
108 XtVaSetValues( _w, XmNdefaultPosition, False, NULL );
111 ( XtCallbackProc ) &DialogShell::popupCallback,
115 ( XtCallbackProc ) &DialogShell::popdownCallback,
118 Atom WM_DELETE_WINDOW=XmInternAtom( XtDisplay( _w ),
122 XmAddWMProtocolCallback( _w,
124 ( XtCallbackProc ) quitCallback,
127 // if (!XtIsManaged(_workArea)) XtManageChild(_workArea);
136 XtVaSetValues ( _w, XmNtitle, text, NULL );
141 DialogShell::popupCallback( Widget ,
142 XtPointer clientData,
143 XmAnyCallbackStruct *
146 DialogShell *obj=( DialogShell * ) clientData;
148 obj->displayInCurrentWorkspace();
153 DialogShell::popdownCallback( Widget ,
154 XtPointer clientData,
155 XmAnyCallbackStruct *
158 DialogShell *obj=( DialogShell * ) clientData;
163 DialogShell::manage()
165 if (NULL == _workArea) return;
166 if (!XtIsManaged(_workArea )) XtManageChild(_workArea);
167 UIComponent::manage();
172 DialogShell::quitCallback( Widget,
173 XtPointer clientData,
174 XmAnyCallbackStruct *)
176 DialogShell *dlg = ( DialogShell *) clientData;
181 DialogShell::busyCursor()
183 // Do nothing if the widget has not been realized
185 if (XtIsRealized(_w)) {
186 _DtTurnOnHourGlass(_w);
191 DialogShell::normalCursor()
193 // Do nothing if the widget has not been realized
195 if (XtIsRealized ( _w ))
197 _DtTurnOffHourGlass(_w);