home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
-
- /*******************************************************************************
- Message.c
-
- *******************************************************************************/
-
- #include <stdio.h>
- #include <Xm/Xm.h>
- #include <Xm/DialogS.h>
- #include <Xm/MenuShell.h>
- #include "UxXt.h"
-
- #include <Xm/MessageB.h>
-
- /*******************************************************************************
- Includes, Defines, and Global variables from the Declarations Editor:
- *******************************************************************************/
-
- #include "exinterfmotif.h"
- #include "exglobals.h"
-
- /*******************************************************************************
- The definition of the context structure:
- If you create multiple instances of your interface, the context
- structure ensures that your callbacks use the variables for the
- correct instance.
-
- For each Widget in the interface, each argument to the Interface
- function, and each variable in the Instance Specific section of the
- Declarations Editor, there is an entry in the context structure.
- and a #define. The #define makes the variable name refer to the
- corresponding entry in the context structure.
- *******************************************************************************/
-
- typedef struct
- {
- int mumble;
- } _UxCMessage;
-
-
- static _UxCMessage *UxMessageContext;
-
- Widget Message;
-
- /*******************************************************************************
- Forward declarations of functions that are defined later in this file.
- *******************************************************************************/
-
- Widget create_Message();
-
- /*******************************************************************************
- The following are callback functions.
- *******************************************************************************/
-
- static void okCallback_Message( UxWidget, UxClientData, UxCallbackArg )
- Widget UxWidget;
- XtPointer UxClientData, UxCallbackArg;
- {
- _UxCMessage *UxSaveCtx, *UxContext;
-
- UxSaveCtx = UxMessageContext;
- UxMessageContext = UxContext =
- (_UxCMessage *) UxGetContext( UxWidget );
- {
- MSwin = -1;
- DialogType = 0;
- UxNotify();
- }
-
- UxMessageContext = UxSaveCtx;
- }
-
-
- Widget Message_shell;
-
- static Widget _Uxbuild_Message()
- {
-
- Message_shell = XtVaCreatePopupShell( "Message_shell",
- xmDialogShellWidgetClass, DBtoplevel,
- XmNdefaultPosition, FALSE,
- XmNx, 650,
- XmNy, 670,
- XmNwidth, 520,
- XmNheight, 380,
- XmNshellUnitType, XmPIXELS,
- XmNtitle, "Message",
- NULL );
-
- Message = XtVaCreateWidget( "Message",
- xmMessageBoxWidgetClass, Message_shell,
- XmNdefaultPosition, FALSE,
- XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL,
- XmNdialogType, XmDIALOG_MESSAGE,
- RES_CONVERT( XmNtextFontList, "-Adobe-Courier-Bold-R-Normal--14-100-100-100-M-90-ISO8859-1" ),
- RES_CONVERT( XmNokLabelString, "Continue" ),
- RES_CONVERT( XmNmessageString, " " ),
- XmNmarginHeight, 10,
- XmNmarginWidth, 40,
- RES_CONVERT( XmNlabelFontList, "-Adobe-Helvetica-Bold-R-Normal--14-100-100-100-P-82-ISO8859-1" ),
- RES_CONVERT( XmNdialogTitle, "Message" ),
- RES_CONVERT( XmNbuttonFontList, "-Adobe-Helvetica-Bold-R-Normal--14-100-100-100-P-82-ISO8859-1" ),
- /*
- XmNshadowThickness, 5,
- RES_CONVERT( XmNforeground, "black" ),
- RES_CONVERT( XmNtopShadowColor, "#e5e5e5" ),
- RES_CONVERT( XmNbottomShadowColor, "#6c6c6c" ),
- RES_CONVERT( XmNbackground, "#BBBBBB" ),
- */
- XmNheight, 380,
- XmNwidth, 520,
- XmNunitType, XmPIXELS,
- NULL );
-
- UxPutContext( Message, (char *) UxMessageContext );
-
- XtAddCallback( Message, XmNdestroyCallback,
- UxFreeClientDataCB,
- (XtPointer) UxMessageContext );
- XtAddCallback( Message, XmNokCallback,
- okCallback_Message,
- (XtPointer) UxMessageContext );
-
- XtRealizeWidget ( Message_shell );
-
- SetWMhints( Message_shell );
-
-
- return ( Message );
- }
-
- /*******************************************************************************
- The following function includes the code that was entered
- in the 'Initial Code' and 'Final Code' sections of the
- Declarations Editor. This function is called from the
- 'Interface function' below.
- *******************************************************************************/
-
- static Widget _Ux_create_Message()
- {
- Widget rtrn;
- _UxCMessage *UxContext;
-
- UxMessageContext = UxContext =
- (_UxCMessage *) XtMalloc( sizeof(_UxCMessage) );
-
- rtrn = _Uxbuild_Message();
-
- XtUnmanageChild(XmMessageBoxGetChild
- (Message, XmDIALOG_CANCEL_BUTTON));
- XtUnmanageChild(XmMessageBoxGetChild
- (Message, XmDIALOG_HELP_BUTTON));
-
- return(rtrn);
- }
-
- /*******************************************************************************
- The following is the 'Interface function' which is the
- external entry point for creating this interface.
- This function should be called from your application or from
- a callback function.
- *******************************************************************************/
-
- Widget create_Message()
- {
- Widget _Uxrtrn;
-
- _Uxrtrn = _Ux_create_Message();
-
- return ( _Uxrtrn );
- }
-
- popup_Message()
- {
- char title_string[20];
- unsigned char type;
-
- if (MSwin == 99) {
- DialogType = 0;
- return;
- }
- MSwin = 99;
-
- if (DialogType == 1) {
- type = XmDIALOG_ERROR;
- strcpy (title_string, "Error Message");
- }
- else {
- type = XmDIALOG_MESSAGE;
- strcpy (title_string, "Message");
- }
- XtVaSetValues( Message_shell,
- XmNtitle, title_string,
- NULL );
-
- XtVaSetValues( Message,
- XmNdialogType, type,
- RES_CONVERT( XmNmessageString, msgstring ),
- NULL );
-
- UxPopupInterface(Message, exclusive_grab);
- }
-
- /*******************************************************************************
- END OF FILE
- *******************************************************************************/
-
-