stdErrDialog.c 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  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)
  10. * any later version.
  11. *
  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
  16. * details.
  17. *
  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
  22. */
  23. /* $XConsortium: stdErrDialog.c /main/4 1995/11/02 14:06:41 rswiston $ */
  24. /*********************************************************************
  25. * (c) Copyright 1993, 1994 Hewlett-Packard Company
  26. * (c) Copyright 1993, 1994 International Business Machines Corp.
  27. * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  28. * (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
  29. * Novell, Inc.
  30. **********************************************************************/
  31. /*******************************************************************************
  32. stdErrDialog.c
  33. *******************************************************************************/
  34. #include <stdio.h>
  35. #include <Xm/Xm.h>
  36. #include <Xm/DialogS.h>
  37. #include <Xm/MenuShell.h>
  38. #include <Xm/MwmUtil.h>
  39. #include "main.h"
  40. #include "externals.h"
  41. #include "process.h"
  42. #include <Xm/MessageB.h>
  43. /*******************************************************************************
  44. Includes, Defines, and Global variables from the Declarations Editor:
  45. *******************************************************************************/
  46. Widget stdErrDialog;
  47. /*******************************************************************************
  48. Forward declarations of functions that are defined later in this file.
  49. *******************************************************************************/
  50. Widget create_stdErrDialog();
  51. /*******************************************************************************
  52. The following are callback functions.
  53. *******************************************************************************/
  54. static void
  55. okCallback_stdErrDialog(
  56. Widget w,
  57. XtPointer clientData,
  58. XtPointer callbackArg )
  59. {
  60. Process_StdErr_OK();
  61. }
  62. /*******************************************************************************
  63. The 'build_' function creates all the widgets
  64. using the resource values specified in the Property Editor.
  65. *******************************************************************************/
  66. static Widget
  67. build_stdErrDialog( void )
  68. {
  69. Widget stdErrDialog_shell;
  70. XmString tmpXmStr, tmpXmStr2;
  71. Arg args[10];
  72. int n;
  73. stdErrDialog_shell = XtVaCreatePopupShell( "stdErrDialog_shell",
  74. xmDialogShellWidgetClass, mainWindow,
  75. XmNtitle, GETSTR(8,2, "Icon Editor - Error"),
  76. NULL );
  77. tmpXmStr = GETXMSTR(8,4, "Continue");
  78. tmpXmStr2= GETXMSTR(8,2, "Icon Editor - Error");
  79. stdErrDialog = XtVaCreateWidget( "stdErrDialog",
  80. xmMessageBoxWidgetClass, stdErrDialog_shell,
  81. XmNokLabelString, tmpXmStr,
  82. XmNdialogTitle, tmpXmStr2,
  83. XmNdialogType, XmDIALOG_ERROR,
  84. NULL );
  85. XmStringFree(tmpXmStr);
  86. XmStringFree(tmpXmStr2);
  87. XtAddCallback( stdErrDialog, XmNokCallback, okCallback_stdErrDialog, NULL);
  88. n = 0;
  89. XtSetArg (args[n], XmNuseAsyncGeometry, True); n++;
  90. XtSetArg (args[n], XmNmwmInputMode,MWM_INPUT_PRIMARY_APPLICATION_MODAL);n++;
  91. XtSetValues (stdErrDialog_shell, args, n);
  92. return ( stdErrDialog );
  93. }
  94. /*******************************************************************************
  95. The following is the 'Interface function' which is the
  96. external entry point for creating this interface.
  97. This function should be called from your application or from
  98. a callback function.
  99. *******************************************************************************/
  100. Widget
  101. create_stdErrDialog( void )
  102. {
  103. Widget rtrn;
  104. rtrn = build_stdErrDialog();
  105. {
  106. Widget w0, w1, w2;
  107. Arg arg[10];
  108. int i;
  109. w0 = rtrn;
  110. w1 = XmMessageBoxGetChild(w0, XmDIALOG_CANCEL_BUTTON);
  111. w2 = XmMessageBoxGetChild(w0, XmDIALOG_HELP_BUTTON);
  112. XtUnmanageChild(w1);
  113. XtUnmanageChild(w2);
  114. }
  115. return(rtrn);
  116. }
  117. /*******************************************************************************
  118. END OF FILE
  119. *******************************************************************************/