Exemple #1
0
/*************************************<->*************************************
 *
 *  static void wmq_bump_xids ()
 *
 *
 *  Description:
 *  -----------
 *  This function allocates more xids in our local buffer 
 *
 *  Inputs:
 *  ------
 *  w - widget
 *  pSelection - pointer to selection type (atom)
 *  pTarget - pointer to requested target type (atom)
 *
 *  Outputs:
 *  ------
 *
 *  Comments:
 *  --------
 *  This is here to prevent Xt from freeing our buffers.
 *
 *************************************<->***********************************/
static void
wmq_bump_xids ( void )
{
    XID *px;

    if (pXids)
    {
	if (!(px = (XID *) 
	  XtRealloc ((char *) pXids, (numXids + 32) * (sizeof (XID)))))
	{
	  Warning (((char *)GETMESSAGE(56, 5, "Insufficient memory to convert _MOTIF_WM_QUERY_nn selection")));
	}
	else
	{
	    pXids = px;
	    numXids += 32;
	}
    }
    else
    {
	if (!(pXids = (XID *) 
	  XtMalloc (32 * (sizeof (XID)))))
	{
	  Warning (((char *)GETMESSAGE(56, 5, "Insufficient memory to convert _MOTIF_WM_QUERY_nn selection")));
	}
	else
	{
	    numXids = 32;
	}
    }
}
Exemple #2
0
static Widget   _Uxbuild_OpenFile(void)
{
        Widget          _UxParent;

        /* Creation of OpenFile */
        _UxParent = XtVaCreatePopupShell( "OpenFile_shell",
                        xmDialogShellWidgetClass, UxTopLevel,
                        XmNx, 200,
                        XmNy, 290,
                        XmNwidth, 398,
                        XmNheight, 500,
                        XmNallowShellResize, TRUE,
                        XmNshellUnitType, XmPIXELS,
                        XmNtitle, GETMESSAGE(12, 25, "Create Action - Open"),
                        NULL );

        OpenFile = XtVaCreateWidget( "OpenFile",
                        xmFileSelectionBoxWidgetClass,
                        _UxParent,
                        XmNresizePolicy, XmRESIZE_GROW,
                        XmNunitType, XmPIXELS,
                        XmNwidth, 398,
                        XmNheight, 500,
                        RES_CONVERT( XmNdialogTitle, GETMESSAGE(12, 25, "Create Action - Open")),
                        RES_CONVERT( XmNdirectory, "" ),
                        RES_CONVERT( XmNtextString, "" ),
                        RES_CONVERT( XmNdirSpec, "" ),
                        XmNdialogType, XmDIALOG_FILE_SELECTION,
                        XmNtextColumns, 20,
                        XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL,
                        XmNallowOverlap, FALSE,
                        RES_CONVERT( XmNchildPlacement, "place_below_selection" ),
                        XmNdefaultPosition, FALSE,
                        RES_CONVERT( XmNdirMask, "" ),
                        RES_CONVERT( XmNpattern, "" ),
                        NULL );
        XtAddCallback( OpenFile, XmNcancelCallback,
                (XtCallbackProc) cancelCB_OpenFile,
                (XtPointer) UxOpenFileContext );
        XtAddCallback( OpenFile, XmNokCallback,
                (XtCallbackProc) okCallback_OpenFile,
                (XtPointer) UxOpenFileContext );
        XtAddCallback( OpenFile, XmNhelpCallback,
                (XtCallbackProc) helpCallback_OpenFile,
                (XtPointer) UxOpenFileContext );
        XtVaSetValues(OpenFile, XmNuserData, OpenFile, NULL);

        UxPutContext( OpenFile, (char *) UxOpenFileContext );

        XtAddCallback( OpenFile, XmNdestroyCallback,
                (XtCallbackProc) UxDestroyContextCB,
                (XtPointer) UxOpenFileContext);

        return ( OpenFile );
}
Exemple #3
0
/*+++++++++++++++++++++++++++++++++++++++*/
void 
popup_startupBB(
        Widget shell )
{

    if (style.startupDialog == NULL) 
    {
      if (smWindow != NULL)
      {
          if (style.smState.smCompatMode) 
          {
               InfoDialog(((char *)GETMESSAGE(7, 13, 
               "This session was started from an X Window System\n\
startup script.  Startup settings are not valid,\n\
since the session cannot be restored.")), 
                style.startupDialog ? style.startupDialog : style.shell, False);

               return;
          }

          _DtTurnOnHourGlass(shell);  
          GetStartupValues();
          BuildStartup(shell);
          XtManageChild(style.startupDialog);
          _DtTurnOffHourGlass(shell);  
      }

      else /* SM not running - post error dialog */
      {
Exemple #4
0
void
HelpModeCB(
        Widget w,
        caddr_t client_data,
        caddr_t call_data )
{
   Widget widget;

   switch(DtHelpReturnSelectedWidgetId(style.shell, (Cursor)NULL, &widget))
   {
      /*
       * There are additional cases (e.g. user aborts request) but I
       * don't feel they warrant an error dialog.
       */
      case DtHELP_SELECT_VALID:

          while (!XtIsShell(widget))
          {
             if (XtHasCallbacks(widget, XmNhelpCallback) == XtCallbackHasSome)
             {
                XtCallCallbacks(widget, XmNhelpCallback, (XtPointer)NULL);
                return;
             }
             widget = XtParent(widget);
          }
          break;

      case DtHELP_SELECT_INVALID:

          ErrDialog((char *)GETMESSAGE(2, 8, "You must select an item\nwithin the Style Manager."), style.shell);
          break;

   }
}
Exemple #5
0
int
do_finddef(
        int argc,
        char **argv )
{
   unsigned long found;
   struct symarray dummy;
   char * errmsg;

   if (argc < 2) 
      XK_USAGE(argv[0]);

   if (fdef(argv[1], &found)) 
   {
      if (argc >= 3) 
      {
         char buf[50];

         sprintf(buf, use2, argv[2], found);
         env_set(buf);
      }
      else 
      {
         sprintf(xk_ret_buffer, use, found);
         xk_ret_buf = xk_ret_buffer;
      }
      return(SH_SUCC);
   }
   errmsg = strdup(GETMESSAGE(3, 2, "Unable to locate the define '%s'"));
   printerrf(argv[0], errmsg, argv[1], NULL, NULL, NULL,
             NULL, NULL, NULL, NULL);
   free(errmsg);
   return(SH_FAIL);
}
Exemple #6
0
/*************************************<->*************************************
 *
 *  void wmq_lose (w, pSelection)
 *
 *
 *  Description:
 *  -----------
 *  This function is called when we lose the WM_QUERY selection
 *
 *  Inputs:
 *  ------
 *  w - widget
 *  pSelection - pointer to selection type (atom)
 *
 *  Outputs:
 *  ------
 *
 *  Comments:
 *  --------
 *  This shouldn't happen!
 *
 *************************************<->***********************************/
static void
wmq_lose (
    Widget w,
    Atom *pSelection
    )
{
  Warning (((char *)GETMESSAGE(56, 4, "Lost _MOTIF_WM_QUERY_nn selection")));
} /* END OF FUNCTION wmq_lose */
Exemple #7
0
static void
SetValues(
        ChangeDirRec *change_dir_rec,
        ChangeDirData *change_dir_data )
{
   Arg args[4];
   char *tmp_str, *host_name;
   XmString host_string;
   DialogData * dialog_data;
   FileMgrData * file_mgr_data;

   dialog_data = _DtGetInstanceData (change_dir_data->file_mgr_rec);
   file_mgr_data = (FileMgrData *) dialog_data->data;

   if(change_dir_data->string_path)
      XmStringFree (change_dir_data->string_path);

   if( restrictMode
       && file_mgr_data->toolbox == False )
      change_dir_data->string_path =
              XmStringCreateLocalized( users_home_dir);
   else if( file_mgr_data->restricted_directory )
      change_dir_data->string_path =
        XmStringCreateLocalized( file_mgr_data->current_directory);
   else
      change_dir_data->string_path = NULL;

   XtSetArg (args[0], XmNlistItemCount, change_dir_data->list_count);
   XtSetArg (args[1], XmNlistVisibleItemCount, change_dir_data->visible_count);
   XtSetArg (args[2], XmNtextString, change_dir_data->string_path);
   XtSetArg (args[3], XmNlistItems, change_dir_data->history_list);

   XtSetValues (change_dir_rec->change_dir, args, 4);

   if( change_dir_data->string_path )
   {
      Widget text;

      text = XmSelectionBoxGetChild(change_dir_rec->change_dir, XmDIALOG_TEXT);
      XtAddCallback (text, XmNmodifyVerifyCallback,
                     (XtCallbackProc)TextChange, (XtPointer)file_mgr_data );
      XtAddCallback (text, XmNmotionVerifyCallback,
                     (XtCallbackProc)TextChange, (XtPointer)file_mgr_data );
      XtAddCallback (text, XmNvalueChangedCallback,
                     (XtCallbackProc)TextChange, (XtPointer)file_mgr_data );
   }

   tmp_str = GETMESSAGE(2, 16, "System Name: ");
   host_name = XtMalloc(strlen(tmp_str) + strlen(change_dir_data->host_name)+1);
   sprintf(host_name, "%s%s", tmp_str, change_dir_data->host_name);
   host_string = XmStringCreateLocalized (host_name);
   XtSetArg (args[0], XmNlabelString, host_string);
   XtSetValues (XmSelectionBoxGetChild (change_dir_rec->change_dir,
                                        XmDIALOG_LIST_LABEL), args, 1);

   XtFree(host_name);
   XmStringFree(host_string);
}
Exemple #8
0
/*************************************<->*************************************
 *
 *  wspCreateLabel (mgrW, pchName, pchString)
 *
 *
 *  Description:
 *  -----------
 *  Creates a label widget as a child of the passed in manager
 *
 *  Inputs:
 *  ------
 *  mgrW = manager widget (parent of this label)
 *  pchName = name of the widget
 *  pchString = string that is to be in label
 * 
 *  Outputs:
 *  -------
 *  Return = Widget created.
 *
 *  Comments:
 *  ---------
 ******************************<->***********************************/
static Widget 
wspCreateLabel(
        Widget mgrW,
        unsigned char *pchName,
        unsigned char *pchString )
{
    Arg setArgs[20];
    int i;
    Widget labelW;
    XmString tmpXmString = (XmString)NULL;

    i = 0;

    if (!strcmp((char *)pchName, "window"))
    {
	if (windowLabelString != (XmString)NULL)
	    XmStringFree(windowLabelString);
	if (iconLabelString != (XmString)NULL)
	    XmStringFree(iconLabelString);

	windowLabelString = 
	    XmStringCreateLocalized ((char *)GETMESSAGE(52, 2, "Window: "));
	/* 
	 * If we do this, USE the message catalog for iconLabelString 
	 * just as we do for windowLabelString !!! 
	 */
	iconLabelString = 
	    XmStringCreateLocalized ((char *)GETMESSAGE(52, 6, "Icon: "));

	XtSetArg (setArgs[i], XmNlabelString, windowLabelString );   i++;
    }
    else
    {
	tmpXmString = XmStringCreateLocalized ((char *)pchString);
	XtSetArg (setArgs[i], XmNlabelString, tmpXmString);   i++;
    }
    
    labelW = XmCreateLabelGadget (mgrW, (char *)pchName, setArgs, i);
    XtManageChild (labelW);

    if (tmpXmString != (XmString)NULL)
	XmStringFree(tmpXmString);

    return (labelW);
} /* END OF FUNCTION   */
Exemple #9
0
int
xk_get_pardelim(
        memtbl_t *tbl,
        char *p )
{
	memtbl_t *dtbl = &tbl[tbl->delim];
        char * errmsg;

	if (tbl->delim == 0) {
		return(-1);
	}
	if (_Prdebug)
        {
	   errmsg=strdup(GETMESSAGE(8,14, 
              "xk_get_pardelim: The delimiter for field '%s' is field '%s'\n"));
	   fprintf(stderr, errmsg, tbl->name, dtbl->name);
           free(errmsg);
        }
	p += dtbl->offset;
	switch (dtbl->kind) {
	   case K_DLONG:
		return(-1);
	   case K_LONG:
		return(((long *)p)[0]);
	   case K_DSHORT:
		return(-1);
	   case K_CHAR:
		return(((char *)p)[0]);
	   case K_SHORT:
		return(((short *)p)[0]);
	   case K_DINT:
		return(-1);
	   case K_INT:
		return(((int *)p)[0]);
	   default:
	   if (_Prdebug)
           {
	      errmsg=strdup(GETMESSAGE(8,15, 
                 "xk_get_pardelim: Cannot find a delimiter value in '%s'\n"));
	      fprintf(stderr, errmsg, tbl->name);
              free(errmsg);
           }
	   return(0);
	}
}
Exemple #10
0
void display_question_message (Widget parent, char *message,
                               char *button1, XtCallbackProc cb_button1,
                               char *button2, XtCallbackProc cb_button2,
                               char *button3, XtCallbackProc cb_button3)
{
  Widget tmpw;

  QuestionDialog = XmCreateQuestionDialog(parent, "questionDialog", NULL, 0);

  tmpw = XmMessageBoxGetChild(QuestionDialog, XmDIALOG_OK_BUTTON);
  if (button1) {
     XtVaSetValues(tmpw,
                   RES_CONVERT( XmNlabelString, button1),
                   NULL);
     XtAddCallback( QuestionDialog, XmNokCallback,
             (XtCallbackProc) cb_button1,
             (XtPointer) NULL );
  } else {
     XtUnmanageChild (tmpw);
  }

  tmpw = XmMessageBoxGetChild(QuestionDialog, XmDIALOG_CANCEL_BUTTON);
  if (button2) {
     XtVaSetValues(tmpw,
                   RES_CONVERT( XmNlabelString, button2),
                   NULL);
     XtAddCallback( QuestionDialog, XmNcancelCallback,
             (XtCallbackProc) cb_button2,
             (XtPointer) NULL );
  } else {
     XtUnmanageChild (tmpw);
  }

  tmpw = XmMessageBoxGetChild(QuestionDialog, XmDIALOG_HELP_BUTTON);
  if (button3) {
     XtVaSetValues(tmpw,
                   RES_CONVERT( XmNlabelString, button3),
                   NULL);
     XtAddCallback( QuestionDialog, XmNhelpCallback,
             (XtCallbackProc) cb_button3,
             (XtPointer) NULL );
  } else {
     XtUnmanageChild (tmpw);
  }

  XtVaSetValues (QuestionDialog,
                 RES_CONVERT(XmNdialogTitle, GETMESSAGE(6, 51, "Create Action - Question")),
                 RES_CONVERT(XmNmessageString, message),
                 NULL);

  XtManageChild (QuestionDialog);
  return;
}
Exemple #11
0
/*************************************<->*************************************
 *
 *  static void OwnWMSelections ()
 *
 *
 *  Description:
 *  -----------
 *  Get the selection ownership for each managed screen.  The selection mwm
 *  will own is WM_Si.
 *
 *  Inputs:
 *  ------
 *  
 *  
 *  
 *
 *  Outputs:
 *  ------
 *
 *  Comments:
 *  --------
 *  
 *
 *************************************<->***********************************/
static void
OwnWMSelections ( Time timestamp )
{
  int scr;
  
  
  wmGD.xa_WM = (Atom *) XtMalloc (wmGD.numScreens * (sizeof (Atom)));
  
  for (scr = 0; scr < wmGD.numScreens; scr++)
    {
      if (wmGD.Screens[scr].managed)
	{
	  char wm_scr[8];
	  
 	  sprintf(wm_scr, "WM_S%d", DefaultScreen(DISPLAY));
	  wmGD.xa_WM[scr] = XInternAtom (DISPLAY, wm_scr, False);
	  
#ifdef MWM_WSM
	  /*
	   * This registers the callback to be invoked when a request
	   * is made against a WSM Protocol target.  The request
	   * callback is stored by the WSM Protocol code and is
	   * invoked in the convert routine (WMiConvert) below.
	   * See WSMProcessProtoTargets().
	   */

	  WSMRegisterRequestCallback(DISPLAY, scr, HandleWsmConvertRequest,
				     NULL);
#endif

	  /*
	   * Own the selection through UTM.  This sets-up a convert function
	   * that is invoked when a convert request is made on this selection.
	   * The convert function is specified in the drawing area's
	   * XmNconvertCallback resource.
	   */

	  XtAddCallback(wmGD.Screens[scr].utmShell, XmNconvertCallback,
			WMiConvertCB, NULL);

	  if (! XmeNamedSource(wmGD.Screens[scr].utmShell,
			       wmGD.xa_WM[scr], timestamp))
	    {
	      Warning (((char *)GETMESSAGE(56, 6,
					   "Failed to own WM_nn selection")));
	    }
	  else
	    {
	      PRINT("Owning selection %s\n", wm_scr);
	    }
	}
    }
}
Exemple #12
0
void 
AddSuLog(
        char *FromName,
        char *ToName,
        char *ChangeType )

{
    char        *toString;
    struct tm  *localtime ();

    register    FILE * f;
    struct stat st;
    time_t    timenow;
    struct tm  *now;

#ifdef hpV4  /* 10.* versions */
    char * SULog = "/var/adm/sulog";
#elif  defined( hpux )	/* 9.* versions */
    char * SULog = "/usr/adm/sulog";
#else
    char * SULog = "/var/adm/sulog";
#endif

    if ((f = fopen (SULog, "a")) == NULL)
	return;

    (void) time (&timenow);
    now = localtime (&timenow);

    /* build toString... */
    if (ToName && *ToName) 
	    toString = ToName;
    else 
	    toString = FromName;

    fprintf(f, (GETMESSAGE(1,1, 
           "dtaction %1$.2d/%2$.2d %3$.2d:%4$.2d %5$1.1s %6$s %7$s-%8$s\n")),
	   now -> tm_mon + 1, now -> tm_mday, now -> tm_hour,
	   now -> tm_min, ChangeType, "?", FromName, toString);

    (void) fclose (f);

    /*
     * take away write access from SULog
     */

    if (stat (SULog, &st) == 0)
       chmod (SULog, (int) (st.st_mode & 07777) & ~0222);

    return;
}
Exemple #13
0
/* ARGSUSED */
void 
OkCallback(
        Widget w,
        XtPointer clientData,
        XtPointer callData )

{
   Boolean valid = False;

   /* Do any verification here */

   /* check for primary passwd... */
   if (!strcmp (crypt (password, toPword), toPword))
      valid = True;

   /* check for secondary passwd ... */
   if (rootPword && *rootPword &&
       !strcmp (crypt (password, rootPword), rootPword))
   {
      valid = True;
   }
   else if (((rootPword == NULL) || (*rootPword == '\0')) &&
            (*password == '\0'))
   {
      /* No root password, and the user entered no password */
      valid = True;
   }


   /* If valid password, then unpost */
   if (valid)
   {
      XtUnmanageChild(dlog);
      XFlush(XtDisplay(dlog));
      finished = True;
      LogSuccess();
   }
   else
   {
      /* Invalid password */
      Widget err;
      int n;
      Arg args[10];
      XmString okLabel;
      XmString message;
      char * template;
      char * title;
      char * master;

      okLabel = XmStringCreateLocalized(GETMESSAGE(1, 2, "OK"));
Exemple #14
0
void
DtkshCvtStringToNamedValue(
        XrmValue *args,
        Cardinal *nargs,
        XrmValuePtr fval,
        XrmValuePtr toval )
{
	/*
	 * same buffer will get used each time
	 */
	static int ret;
	struct named_integer *table;
	int numtable;
	char *value;
	register int i;
        char * errbuf;
        char * errmsg;

	value = (String)fval->addr;

	if (*nargs != 1) {
		toval->addr = NULL;
		toval->size = 0;
		return;
	}
	table = (struct named_integer *)args[0].addr;
	numtable = args[0].size/sizeof(struct named_integer);

	for (i = 0; i < numtable; i++) {
		if (DtCompareISOLatin1(value, (char *)(table[i].name))) {
			toval->addr = (caddr_t)&table[i].value;
			toval->size = sizeof(table[i].value);
			return;
		}
	}
	errmsg =strdup(GETMESSAGE(16,2, 
             "DtkshCvtStringToNamedValue: Unable to convert the string '%s'"));
        errbuf = XtMalloc(strlen(errmsg) + strlen(value) + 10);
        sprintf(errbuf, errmsg, value);
	XtWarning(errbuf);
        free(errmsg);
        XtFree(errbuf);
	toval->addr = NULL;
	toval->size = 0;
	return;
}
Exemple #15
0
void
InfoDialog(
        char *infoString,
        Widget parent,
        Boolean unmapParent )
{
    int             n;
    Arg             args[10];
    static XmString ok = NULL;
    Widget          w;

    /* create the compound string */
    style.tmpXmStr = CMPSTR(infoString);

    if (ok == NULL)
	ok = CMPSTR((String) _DtOkString);

    /* create it */
    n = 0;
    XtSetArg(args[n], XmNokLabelString, ok);                            n++;
    XtSetArg(args[n], XmNmessageString, style.tmpXmStr);                n++;
    XtSetArg(args[n], XmNdialogStyle, XmDIALOG_MODELESS);               n++;
    XtSetArg(args[n], XmNmwmFunctions, DIALOG_MWM_FUNC);                n++;
    w = XmCreateInformationDialog(parent, "Notice", args, n);

    if (unmapParent)
        XtAddCallback (w, XmNokCallback, DestroyCB, parent);
    else
        XtAddCallback (w, XmNokCallback, DestroyCB, NULL);
    XtUnmanageChild ( XmMessageBoxGetChild(w, XmDIALOG_CANCEL_BUTTON) );
    XtUnmanageChild ( XmMessageBoxGetChild(w, XmDIALOG_HELP_BUTTON) );

    /* set the dialog shell parent title */
    n=0;
    XtSetArg (args[n], XmNuseAsyncGeometry, True); n++;
    XtSetArg (args[n], XmNtitle, ((char *)GETMESSAGE(2, 2, "Notice")));   n++;
    XtSetValues (XtParent(w), args, n);

    /* free the compound string */
    XmStringFree (style.tmpXmStr);

    /* manage the info dialog */
    XtManageChild(w);

}
Exemple #16
0
static Widget
Get_Help_Dialog()
{
    Widget dialog;
    Arg args[5];
    int n;

    n = 0;
    XtSetArg(args[n], XmNtitle, GETMESSAGE(6, 5, "Directory Copy Help"));
    n++;
    dialog = DtCreateHelpDialog(G_toplevel, "helpDlg",  args, n);

    XtAddCallback(dialog, DtNhyperLinkCallback,
                  (XtCallbackProc)help_hyperyperlink_callback, NULL);
    XtAddCallback(dialog, DtNcloseCallback,
                  (XtCallbackProc)help_close_callback, NULL);
    return dialog;
}
Exemple #17
0
void createbdf(Exc_data * ed)
{
    int i = 0;
    char *comment_list[] = {""};
    int comment_num = 0;
    char *msg;
    int	ans;

    msg = GETMESSAGE(10, 2, "Failed to make the BDF file");

    i =  ExpGpftoBDF(ed->fontfile, ed->bdffile,
		     ed->code_num, ed->gpf_code_list,
		     comment_num, comment_list, 0);
    if (i != 0) {
	AskUser(ed->toplevel, ed, msg, &ans, "error");
    }
    excterminate(ed);
}
Exemple #18
0
void
Help(
    char *helpVolume,
    char *locationId)
{
    Arg args[10];
    int n;

    if(G_help_dialog == NULL)
    {
        n = 0;
        XtSetArg(args[n], DtNhelpType, DtHELP_TYPE_TOPIC);
        n++;
        XtSetArg(args[n], DtNhelpVolume, helpVolume);
        n++;
        XtSetArg(args[n], DtNlocationId, locationId);
        n++;
        XtSetArg (args[n], XmNtitle,  GETMESSAGE(6, 5, "Directory Copy Help"));
        n++;

        G_help_dialog = DtCreateHelpDialog(G_toplevel, "helpDlg", args, n);

        XtAddCallback(G_help_dialog, DtNhyperLinkCallback,
                      (XtCallbackProc)help_hyperyperlink_callback, NULL);
        XtAddCallback(G_help_dialog, DtNcloseCallback,
                      (XtCallbackProc)help_close_callback, NULL);

        XtManageChild(G_help_dialog);
    }
    else
    {
        n = 0;
        XtSetArg(args[n], DtNhelpType, DtHELP_TYPE_TOPIC);
        n++;
        XtSetArg(args[n], DtNhelpVolume, helpVolume);
        n++;
        XtSetArg(args[n], DtNlocationId, locationId);
        n++;
        XtSetValues(G_help_dialog, args, n);
    }

    XtMapWidget(XtParent(G_help_dialog));
}
Exemple #19
0
int WmReturnIdentity ( int argc, char *argv[], char *environ[]) 
{
	char *tempString;
	char *origPtr;

	/* assume it's dtwm until proven differently */

 	int retVal = DT_MWM;

	if (!(tempString = 
	      (char *)(XtMalloc ((unsigned int)(strlen (argv[0]) + 1)))))
	{
		Warning(((char *)GETMESSAGE(44, 2, "Insufficient memory for name of window manager")));
		exit(WM_ERROR_EXIT_VALUE);
	}

	origPtr = tempString;

	if (strrchr(argv[0], '/'))
	{
		
		strcpy(tempString, (strrchr(argv[0], '/')));

		tempString++;
	}
	else
		strcpy(tempString, argv[0]);

	if (!(strcmp(tempString, WM_RESOURCE_NAME)))
	/*
	 *
	 *   If it's explicity "mwm", then set our identity anew.
	 *
	 */
	{
		retVal = MWM;
	}

	XtFree((char *)origPtr);

	return(retVal);

} /* END OF FUNCTION WmReturnIdentity */
Exemple #20
0
Boolean 
MakePresenceBox(
        WmScreenData *pSD )

{
    PtrWsPresenceData pPres = &pSD->presence;
    Boolean	  rval;

    /*
     * Create the widgets for the workspace presence dialog
     */   

    pPres->onScreen = False;

    if (wspCreateWidgets (pSD))
    {
	/*
	 * lay out the form
	 */
	wspLayout (pPres);

	/*
	 * Set the ClientData fields.
	 */   
	XtRealizeWidget (pPres->shellW);
#ifdef PANELIST
	DtWsmRemoveWorkspaceFunctions (DISPLAY1, XtWindow(pPres->shellW));
#endif /* PANELIST */

	ProcessPresenceResources (pSD);

	rval = True;
    }
    else
    {
	Warning(((char *)GETMESSAGE(52, 1, "Unable to create Occupy Workspace dialog.")));
	rval = False;
    }

    return (rval);

} /* END OF FUNCTION MakePresenceBox */
Exemple #21
0
void display_confirmed_message (Widget parent, char *message)
{

  Confirmed = XmCreateInformationDialog(parent, "confirmedDialog", NULL, 0);
  XtUnmanageChild (XmMessageBoxGetChild (Confirmed, XmDIALOG_CANCEL_BUTTON));
  XtUnmanageChild (XmMessageBoxGetChild (Confirmed, XmDIALOG_HELP_BUTTON));

  XtAddCallback( Confirmed, XmNokCallback,
          (XtCallbackProc) activateCB_Confirmed_OkButton,
          (XtPointer) NULL );

  XtVaSetValues (Confirmed,
                 RES_CONVERT(XmNdialogTitle, GETMESSAGE(6, 41, "Create Action - Confirmation")),
                 RES_CONVERT(XmNmessageString, message),
                 NULL);
  XtRealizeWidget(Confirmed);

  XtManageChild (Confirmed);
  return;
}
Exemple #22
0
void selcharokCB(Widget widget, ListData * ld, XtPointer call_data)
{
    int		num;
    Exc_data	*ed;
    int		ans;
    char	*msg;

    msg = GETMESSAGE(10, 4, "No indexes are selected");

    XtVaGetValues(ld->list, XmNselectedItemCount, &num, NULL);
    if (num == 0) {
/*	AskUser(widget, ld->ed, msg, &ans, "error");*/
	return;
    } else {
	setselectedcode(ld);
	XtUnmanageChild(XtParent(widget));
	ed = ld->ed;
	freeld(ld);
	getbdffn(ed);
    }
}
Exemple #23
0
/************************************************************************
 * restoreMain()
 *
 * restore any state information saved with saveMain.
 * This is called from restoreSession with the application
 * shell and the special xrm database retrieved for restore.
 ************************************************************************/
void 
restoreMain(
        Widget shell,
        XrmDatabase db )
{
    XrmName xrm_name[5];
    XrmRepresentation rep_type;
    XrmValue value;

    xrm_name [0] = XrmStringToQuark ("mainWindow");
    xrm_name [1] = XrmStringToQuark ("ismapped");
    xrm_name [2] = NULL;

    if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value)) {
      /* Are we supposed to be mapped? */
      if (strcmp(value.addr, "True") == 0) {
        save.poscnt = 0;

        /* get x position */
        xrm_name [1] = XrmStringToQuark ("x");
        if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value)) {
          XtSetArg (save.posArgs[save.poscnt], XmNx, atoi((char *)value.addr));
	  save.poscnt++;
        }

        /* get y position */
        xrm_name [1] = XrmStringToQuark ("y");
        if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value)) {
          XtSetArg (save.posArgs[save.poscnt], XmNy, atoi((char *)value.addr));
	  save.poscnt++;
        }

	save.restoreFlag = True;
        init_mainWindow(shell);
      }
    }
    else
      _DtSimpleError (progName, DtWarning, NULL, ((char *)GETMESSAGE(4,36,
	"No Dtstyle restore information available for current session")), NULL);
}
Exemple #24
0
Boolean AddWmTimer (unsigned int timerType, unsigned long timerInterval, ClientData *pCD)
{
    WmTimer *pWmTimer;


    if (!(pWmTimer = (WmTimer *)XtMalloc (sizeof (WmTimer))))
    {
	Warning (((char *)GETMESSAGE(56, 1, "Insufficient memory for window manager data")));
	return (False);
    }

    /* !!! handle for XtAppAddTimeOut error !!! */
    pWmTimer->timerId = XtAppAddTimeOut (wmGD.mwmAppContext, 
			    timerInterval, (XtTimerCallbackProc)TimeoutProc, (caddr_t)pCD);
    pWmTimer->timerCD = pCD;
    pWmTimer->timerType = timerType;
    pWmTimer->nextWmTimer = wmGD.wmTimers;
    wmGD.wmTimers = pWmTimer;

    return(True);

} /* END OF FUNCTION AddWmTimer */
Exemple #25
0
void getbdffn(Exc_data * ed)
{
    Widget	filesb;
    Arg		args[20];
    Cardinal	n;
    char	*selectlabel;
    XmString	xms;

    selectlabel = GETMESSAGE(2, 2, "BDF file selection");
    n = 0;
    XtSetArg(args[n], XmNtitle, maintitle); n++;
    xms = XmStringCreateLocalized(selectlabel);
    XtSetArg(args[n], XmNselectionLabelString, xms); n++;
    filesb = XmCreateFileSelectionDialog(ed->toplevel, "filesb", args, n);
    XtAddCallback(filesb, XmNokCallback,
		  (XtCallbackProc) filesbokCB,
		  (XtPointer) ed);
    XtAddCallback(filesb, XmNcancelCallback,
		  (XtCallbackProc) filesbcancelCB,
		  (XtPointer) ed);
    XtUnmanageChild(XmFileSelectionBoxGetChild(filesb, XmDIALOG_HELP_BUTTON));
    XtManageChild(filesb);
}
Exemple #26
0
/*-------------------------
 *
 *  display_cancel_warning
 *
 *------------------------*/
void
display_cancel_warning(Widget parent)

{
   XmString  msg, dialogTitle, cancelMsg, resumeMsg;
   int       n;
   Arg       args[20];
   Widget    dialog;

   String   copyWarnMessage = "This will stop the copy process. Any files that have\n\
already been copied will remain in the destination folder.";
   String   moveWarnMessage = "This will stop the move process. Any files that have\n\
already been moved will remain in the destination folder.";



   if (G_move)
   {
      dialogTitle = XmStringCreateLocalized (GETMESSAGE(3, 12, "Folder Move - Warning"));
      msg         = XmStringCreateLocalized (GETMESSAGE(3, 10, moveWarnMessage));
      cancelMsg   = XmStringCreateLocalized (GETMESSAGE(3, 15, "Cancel Move"));
      resumeMsg   = XmStringCreateLocalized (GETMESSAGE(3, 16, "Continue Move"));
   }
   else
   {
      dialogTitle = XmStringCreateLocalized (GETMESSAGE(3, 11, "Folder Copy - Warning"));
      msg         = XmStringCreateLocalized (GETMESSAGE(3,  7, copyWarnMessage));
      cancelMsg   = XmStringCreateLocalized (GETMESSAGE(3, 13, "Cancel Copy"));
      resumeMsg   = XmStringCreateLocalized (GETMESSAGE(3, 14, "Continue Copy"));
   }


   n = 0;
   XtSetArg(args[n], XmNmessageString, msg); n++;
   XtSetArg(args[n], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); n++;
   XtSetArg(args[n], XmNdialogTitle, dialogTitle); n++;
   dialog = (Widget) XmCreateWarningDialog(parent, "warnDialog", args, n);

   XmStringFree(msg);
   XmStringFree(dialogTitle);

   n = 0;
   XtSetArg(args[n], XmNlabelString, cancelMsg); n++;
   XtSetValues((Widget) XmMessageBoxGetChild(dialog, XmDIALOG_OK_BUTTON), args, n);
   XmStringFree(cancelMsg);

   n = 0;
   XtSetArg(args[n], XmNlabelString, resumeMsg); n++;
   XtSetValues((Widget) XmMessageBoxGetChild(dialog, XmDIALOG_CANCEL_BUTTON), args, n);
   XmStringFree(resumeMsg);

   XtAddCallback((Widget) XmMessageBoxGetChild(dialog, XmDIALOG_OK_BUTTON),
                 XmNactivateCallback,
   		 warning_yes_callback,
   		 dialog);
   XtAddCallback((Widget) XmMessageBoxGetChild(dialog, XmDIALOG_CANCEL_BUTTON),
                 XmNactivateCallback,
   		 warning_no_callback,
   		 dialog);
   XtAddCallback((Widget) XmMessageBoxGetChild(dialog, XmDIALOG_HELP_BUTTON),
                 XmNactivateCallback,
   		 help_callback,
   		 (XtPointer) STOPW_HELP_DIALOG);
   		
   XtManageChild(dialog);

}  /* end display_cancel_warning */
Exemple #27
0
/*++++++++++++++++++++++++++++++++++++++*/
int 
main(
        int argc,
        char **argv )
{
    int             n;
    Arg             args[MAX_ARGS];
    XEvent          event;
    XPropertyEvent *pEvent=(XPropertyEvent *)&event;
    long            mwmFunc;
    Boolean         useMaskRtn, useIconFileCacheRtn;    
    char           *dirs = NULL;
    char           *string;
	Visual         *visual;

#ifdef USERHELP
malloc_check(1);
malloc_trace(0);
#endif

    XtSetLanguageProc(NULL, NULL, NULL);
    _DtEnvControl(DT_ENV_SET); 
    

    /* Initialize the toolkit and open the display */
    style.shell = 
        XtInitialize(argv[0], XMCLASS, option_list, 1, (int *)&argc, argv);

#ifdef __osf__
    _XmColorObjCreate(style.shell, NULL, NULL);
#endif

    /* Allow all WS manipulation functions except resize and maximize */
    mwmFunc = MWM_FUNC_ALL ^ (MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE); 

    n = 0;
    XtSetArg(args[n], XmNmwmFunctions, mwmFunc); n++;
    XtSetArg(args[n], XmNuseAsyncGeometry, True); n++;
    XtSetValues(style.shell, args, n);

    /* initialize global style data */

    style.display    = XtDisplay(style.shell);
    style.screen     = DefaultScreenOfDisplay(style.display);
    style.screenNum  = DefaultScreen(style.display);
    style.colormap   = DefaultColormap(style.display, style.screenNum);
    style.root       = DefaultRootWindow(style.display);
    style.execName   = argv[0];
    style.errDialog  = NULL;
    style.tmpXmStr   = NULL;
    style.home = (char *) XtMalloc(strlen((char *) getenv("HOME")) + 1);
    strcpy(style.home, (char *) getenv("HOME"));
    style.colorDialog = NULL;
    style.backdropDialog = NULL;
    style.fontDialog = NULL;
    style.kbdDialog = NULL;
    style.mouseDialog = NULL;
    style.audioDialog = NULL;
    style.screenDialog = NULL;
    style.startupDialog = NULL;
    style.dtwmDialog = NULL;
    style.i18nDialog = NULL;
	visual = XDefaultVisual(style.display,style.screenNum);
	style.visualClass = visual->class;
    
    if (progName = DtStrrchr(argv[0], '/')) progName++;
    else progName = argv[0];

    /* Get the lock established to ensure only one dtstyle process
     * is running per screen .. first malloc enough space*/

    if (_DtGetLock (style.display, STYLE_LOCK) == 0)
    {
        _DtSimpleError (progName, DtError, NULL, "%s",
	     ((char *)GETMESSAGE(2, 5, "Style Manager is already running, second attempt aborted.")));
        exit(1);
    }

    InitDtstyleProtocol();
    SetWindowProperties();

    /* Register error handlers */
    XSetErrorHandler(ErrorHandler);
    XSetIOErrorHandler(IOErrorHandler);
    XtAppSetErrorHandler(XtWidgetToApplicationContext(style.shell),
                         ToolkitErrorHandler);
    XtAddEventHandler(style.shell, StructureNotifyMask, 0,
                         (XtEventHandler)MwmReparentNotify, NULL);

    /* set up resolution dependent layout variables */
    switch (_DtGetDisplayResolution(style.display, style.screenNum))
    {
        case LOW_RES_DISPLAY:
            style.horizontalSpacing = 
            style.verticalSpacing = 3;
            break;
            
        case MED_RES_DISPLAY:
            style.horizontalSpacing = 
            style.verticalSpacing = 5;
            break;
            
        case HIGH_RES_DISPLAY:
            style.horizontalSpacing = 
            style.verticalSpacing = 8;
            break;
    }
    
    GetApplicationResources();
    
    XmeGetIconControlInfo(style.screen, &useMaskRtn,
			  &style.useMultiColorIcons, &useIconFileCacheRtn);
    
    
    /* add the directory $HOME/.dt/backdrops */
    
    string = (char *)XtMalloc(strlen(style.home) + strlen("/.dt/backdrops:") + 1);
    sprintf(string, "%s/.dt/backdrops:", style.home);

    dirs = (char *)XtCalloc(1, strlen("/etc/dt/backdrops:/usr/dt/backdrops") + 
			    (style.xrdb.backdropDir == NULL ? 2 :
			    strlen(style.xrdb.backdropDir)) + 
			    strlen(string) + 2);
  

    strcpy(dirs, string);
    if (style.xrdb.backdropDir) 
      {
	strcat(dirs, style.xrdb.backdropDir);
	strcat(dirs, ":"); 
      }
    strcat(dirs, "/etc/dt/backdrops:/usr/dt/backdrops");

    _DtWsmSetBackdropSearchPath(style.screen, dirs, style.useMultiColorIcons);

    if (string != NULL)
      XtFree((char *)string);
    
    if (dirs != NULL)
      XtFree((char *)dirs); 
    
    

    style.count = 0;
    /* if this is started from save session we need to set up the BMS
       first, otherwise do it after making the window. (for user perception
       for how long it takes for the dtstyle to come up) */
    if(style.xrdb.session != NULL) {
      DtInitialize (style.display, style.shell, progName, progName);
      /*Restore a session or build and display the main Window.*/
      if(!restoreSession(style.shell,style.xrdb.session))
	init_mainWindow(style.shell);
    }
    else {
      init_mainWindow(style.shell);
      DtInitialize (style.display, style.shell, progName, progName);
      InitializeAtoms();
      CheckMonitor(style.shell);
      GetDefaultPal(style.shell);
    }
    
    signal(SIGINT,(void (*)())activateCB_exitBtn); 
    signal(SIGTERM,(void (*)())activateCB_exitBtn); 

    /* to avoid defunct screen saver processes */    
    signal(SIGCHLD, (void (*)())WaitChildDeath);

    /* backdrop dialog  needs to know when the workspace changes to recolor 
       the bitmap displayed in the dialog */
    ListenForWorkspaceChange();

    /* if using COLOR builtin, style.workProcs is True */

    if ((XmeUseColorObj() != FALSE) && style.workProcs)

        XtAppAddWorkProc(XtWidgetToApplicationContext(style.shell), 
                        NewCreateD, style.shell);

    XtAppMainLoop(XtWidgetToApplicationContext(style.shell));

    return 0;
}
Exemple #28
0
void 
ErrDialog(
        char *errString,
        Widget visualParent )
{
    int           n;
    Arg           args[10];
    XmString      ok;

    /* create the compound string */
    style.tmpXmStr = CMPSTR(errString);

    style.errParent = visualParent;

    if (style.errDialog == NULL)     /* create it */
    {
        ok = XmStringCreateLocalized((String) _DtOkString);

        n = 0;
        XtSetArg(args[n], XmNokLabelString, ok); n++;
        XtSetArg(args[n], XmNmessageString, style.tmpXmStr);                n++;
        XtSetArg(args[n], XmNmwmFunctions, DIALOG_MWM_FUNC);                n++;
        XtSetArg (args[n], XmNautoUnmanage, False);                         n++;
        XtSetArg (args[n], XmNdefaultPosition, False);                      n++;
        style.errDialog = XmCreateErrorDialog(style.shell,"ErrorNotice",args,n);

        XtAddCallback (style.errDialog, XmNokCallback, UnmanageCB, NULL);
        XtAddCallback (style.errDialog, XmNcancelCallback, UnmanageCB, NULL);
        XtAddCallback (style.errDialog, XmNmapCallback, CenterMsgCB, NULL);
        XtUnmanageChild ( XmMessageBoxGetChild (style.errDialog,
                                                XmDIALOG_CANCEL_BUTTON));
        XtUnmanageChild ( XmMessageBoxGetChild (style.errDialog,
                                                XmDIALOG_HELP_BUTTON));

        /* set the dialog shell parent title */
        n=0;
        XtSetArg (args[n], XmNmwmInputMode,
                        MWM_INPUT_PRIMARY_APPLICATION_MODAL); n++;
        XtSetArg (args[n], XmNuseAsyncGeometry, True); n++;
        XtSetArg (args[n], XmNtitle, ((char *)GETMESSAGE(2, 3, "Error")));   n++;
        XtSetValues (XtParent(style.errDialog), args, n);
    }
    else                 /* change the string */
    {
        n = 0;
        XtSetArg(args[n], XmNmessageString, style.tmpXmStr); n++;
        XtSetValues (style.errDialog, args, n);
    }

    /* free the compound string */
    XmStringFree (style.tmpXmStr);

    if (XtIsManaged(style.errParent) || XtParent(style.errParent) == NULL)
    {
        XtManageChild(style.errDialog);
        /* ring the bell (PM behavior) */
        XBell(style.display, 0);
    }
    else
    {
        XtAddEventHandler(XtParent(style.errParent), StructureNotifyMask, 0,
                          (XtEventHandler)errParentMap, NULL);
    }

}
Exemple #29
0
/*+++++++++++++++++++++++++++++++++++++++*/
static void 
ButtonCB(
        Widget w,
        XtPointer client_data,
        XtPointer call_data )
{
  int         n;
  Arg         args[MAX_ARGS];
  char        *resPtr;
  Boolean     state;
  Boolean     changeFlag = 0;
  DtDialogBoxCallbackStruct *cb = (DtDialogBoxCallbackStruct *) call_data;
  
  switch (cb->button_position)
    {
    case OK_BUTTON:
      
      XtUnmanageChild (w);
      
      /* create the Dtwm resource specs for xrdb */
      
      state = XmToggleButtonGadgetGetState (dtwm.explicitTG);
      if ( state != dtwm.origKeyboardFocusPolicy)
	{
	  sprintf(dtwmRes, "Dtwm.keyboardFocusPolicy: %s\n",
		  XmToggleButtonGadgetGetState (dtwm.pointerTG)
		  ? POINTER_STR : EXPLICIT_STR);
	  changeFlag = 1;
	}
      
      /* write out FocusAutoRaise if toggle has changed or if
       * KeyboardFocusPolicy has changed.  FAR default value is 
       * based off of KFP so must set explicitly or visible toggle 
       * will be inacurate */
      state = XmToggleButtonGadgetGetState (dtwm.autoRaiseTG);
      if (state !=  dtwm.origFocusAutoRaise || changeFlag)
	{
	  sprintf(dtwmRes+strlen(dtwmRes), "Dtwm*focusAutoRaise: %s\n",
		  XmToggleButtonGadgetGetState (dtwm.autoRaiseTG)
		  ? "True" : "False");
	  changeFlag = 1;
	}
      
      state = !XmToggleButtonGadgetGetState (dtwm.secStackTG);
      if ( state != dtwm.origSecStack)
	{
	  sprintf(dtwmRes+strlen(dtwmRes), "Dtwm*secondariesOnTop: %s\n",
		  XmToggleButtonGadgetGetState (dtwm.secStackTG)
		  ? "False" : "True");
	  changeFlag = 1;
	}
      
      state = XmToggleButtonGadgetGetState (dtwm.moveOpaqueTG);
      if ( state != dtwm.origMoveOpaque)
	{
	  sprintf(dtwmRes+strlen(dtwmRes), "Dtwm*moveOpaque: %s\n",
		  XmToggleButtonGadgetGetState (dtwm.moveOpaqueTG)
		  ? "True" : "False");
	  changeFlag = 1;
	}
      
      state = XmToggleButtonGadgetGetState (dtwm.iconBoxTG);
      if (state != dtwm.origUseIconBox)
	{
	  sprintf(dtwmRes+strlen(dtwmRes), "Dtwm*useIconBox: %s\n",
		  XmToggleButtonGadgetGetState (dtwm.iconBoxTG)
		  ? "True" : "False");
	  changeFlag = 1;
	}
      
      if (changeFlag)
	{
	  if (dtwm.warnDialog == NULL)
	    {
	      n = 0;
	      XtSetArg(args[n], XmNokLabelString, CMPSTR((String) _DtOkString)); n++;
	      XtSetArg(args[n], XmNcancelLabelString, CMPSTR((String) _DtCancelString)); n++;
	      XtSetArg(args[n], XmNborderWidth, 3); n++;
	      XtSetArg(args[n], XmNmwmFunctions, DIALOG_MWM_FUNC ); n++;
	      XtSetArg(args[n], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); n++; 
	      XtSetArg(args[n], XmNdialogTitle, CMPSTR((char *)GETMESSAGE(2,2, "Notice"))); n++;
	      XtSetArg(args[n], XmNmessageString, CMPSTR(WARN_MSG)); n++;
              dtwm.warnDialog = XmCreateInformationDialog(style.shell, "warnDialog", args, n);
	      
	      XtUnmanageChild (XmMessageBoxGetChild(dtwm.warnDialog, XmDIALOG_HELP_BUTTON)); 
	      
	      XtAddCallback(dtwm.warnDialog, XmNokCallback, okWarnCB, 
			    client_data); 
	      XtAddCallback(dtwm.warnDialog, XmNcancelCallback, cancelWarnCB, 
			    client_data); 
	    }
	  XtManageChild(dtwm.warnDialog);  
	   
	}
      break;
      
      
    case CANCEL_BUTTON:
    
      /* reset to dtwm values from when dialog is mapped */ 
      XtUnmanageChild(w);
      
      XmToggleButtonGadgetSetState (dtwm.pointerTG, 
				    dtwm.origKeyboardFocusPolicy ? POINTER : EXPLICIT , True); 
      
      XmToggleButtonGadgetSetState (dtwm.explicitTG, 
				    dtwm.origKeyboardFocusPolicy ? EXPLICIT : POINTER , True); 
      
      XmToggleButtonGadgetSetState (dtwm.autoRaiseTG, 
				    dtwm.origFocusAutoRaise ? True : False , True); 
      
      XmToggleButtonGadgetSetState (dtwm.secStackTG, 
				    dtwm.origSecStack ? False : True , True); 
      
      XmToggleButtonGadgetSetState (dtwm.moveOpaqueTG, 
				    dtwm.origMoveOpaque ? True : False , True); 
      
      XmToggleButtonGadgetSetState (dtwm.iconBoxTG, 
				    dtwm.origUseIconBox ? True : False , True); 
      
      XmToggleButtonGadgetSetState (dtwm.desktopTG, 
				    dtwm.origUseIconBox ? False : True , True); 
      
      break;
    
  case HELP_BUTTON:
    XtCallCallbacks(style.dtwmDialog, XmNhelpCallback, (XtPointer)NULL);
    break;
    
  default:
    break;
  }
}
Exemple #30
0
/*+++++++++++++++++++++++++++++++++++++++*/
static Widget 
build_dtwmDlg(
        Widget shell )
{
    register int     i, n;
    Arg              args[MAX_ARGS];
    XmString         button_string[NUM_LABELS]; 
    XmString         string; 
    Widget           form;
    Widget           windowFocusForm;
    Widget           iconPlacementForm;
    int              count = 0;
    Widget           widgetList1[6];

    /* get dtwm resource values  */

    /* Set up DialogBoxDialog button labels */
    button_string[0] = CMPSTR((String) _DtOkString);
    button_string[1] = CMPSTR((String) _DtCancelString);
    button_string[2] = CMPSTR((String) _DtHelpString);

    /* Create toplevel DialogBox */
    /* saveRestore
     * Note that save.poscnt has been initialized elsewhere.  
     * save.posArgs may contain information from restoreBeep().*/

    XtSetArg(save.posArgs[save.poscnt], XmNbuttonCount, NUM_LABELS);  save.poscnt++;
    XtSetArg(save.posArgs[save.poscnt], XmNbuttonLabelStrings, button_string);  save.poscnt++;
    XtSetArg(save.posArgs[save.poscnt], XmNdefaultPosition, False);
    save.poscnt++;
    style.dtwmDialog = 
        __DtCreateDialogBoxDialog(shell, "dtwmDialog", save.posArgs, save.poscnt);
    XtAddCallback(style.dtwmDialog, XmNhelpCallback,
            (XtCallbackProc)HelpRequestCB, (XtPointer)HELP_DTWM_DIALOG);

    XmStringFree(button_string[0]);
    XmStringFree(button_string[1]);
    XmStringFree(button_string[2]);

    widgetList1[0] = _DtDialogBoxGetButton(style.dtwmDialog,2);
    n=0;
    XtSetArg(args[n], XmNautoUnmanage, False); n++;
    XtSetArg(args[n], XmNcancelButton, widgetList1[0]); n++;
    XtSetValues (style.dtwmDialog, args, n);

    n=0;
    XtSetArg(args[n], XmNtitle, ((char *)GETMESSAGE(18, 1, "Style Manager - Window"))); n++;
    XtSetArg (args[n], XmNuseAsyncGeometry, True); n++;
    XtSetArg(args[n], XmNmwmFunctions, DIALOG_MWM_FUNC); n++;
    XtSetValues (XtParent(style.dtwmDialog), args, n);

    n = 0;
    XtSetArg(args[n], XmNallowOverlap, False); n++;
    XtSetArg(args[n], XmNchildType, XmWORK_AREA);  n++;
    form = XmCreateForm(style.dtwmDialog, "dtwmForm", args, n);

    n = 0;
    XtSetArg(args[n], XmNfillMode, XmFILL_SELF); n++;
    XtSetArg(args[n], XmNbehavior, XmICON_LABEL); n++;
    XtSetArg(args[n], XmNpixmapForeground, style.secBSCol); n++;
    XtSetArg(args[n], XmNpixmapBackground, style.secTSCol); n++;
    XtSetArg(args[n], XmNstring, NULL); n++;  
    XtSetArg(args[n], XmNshadowThickness, 0); n++;  
    XtSetArg(args[n], XmNimageName, DTWM_ICON); n++;  
    XtSetArg(args[n], XmNtraversalOn, False); n++;  
    widgetList1[count++] = 
    dtwm.pictLabel = _DtCreateIcon(form, "dtwmpictLabel", args, n);

    n = 0;
    XtSetArg(args[n], XmNmarginHeight, LB_MARGIN_HEIGHT);  n++;
    XtSetArg(args[n], XmNmarginWidth, LB_MARGIN_WIDTH);  n++;
    string = CMPSTR(((char *)GETMESSAGE(18, 2, "Default")));
    XtSetArg(args[n], XmNlabelString, string); n++;
    widgetList1[count++] = dtwm.systemDefault = 
        XmCreatePushButtonGadget(form, "systemDefault", args, n);
    XmStringFree(string);

    n = 0;
    string = CMPSTR((char *)GETMESSAGE(18, 3, "Window Behavior"));
    XtSetArg(args[n], XmNtitleString, string);  n++;
    widgetList1[count++] = dtwm.windowFocusTB
        = _DtCreateTitleBox(form, "windowFocusTB", args, n);
    XmStringFree(string);
    
    n = 0;
    XtSetArg(args[n], XmNallowOverlap, False); n++;
    XtSetArg(args[n], XmNchildType, XmWORK_AREA);  n++;
    windowFocusForm = 
        XmCreateForm(dtwm.windowFocusTB, "windowFocusForm", args, n);

    n = 0;
    string = CMPSTR((char *)GETMESSAGE(18, 4, "Window Icons"));
    XtSetArg(args[n], XmNtitleString, string);  n++;
    widgetList1[count++] = dtwm.iconPlacementTB
        = _DtCreateTitleBox(form, "iconPlacementTB", args, n);
    XmStringFree(string);

    n = 0;
    XtSetArg(args[n], XmNallowOverlap, False); n++;
    XtSetArg(args[n], XmNchildType, XmWORK_AREA);  n++;
    iconPlacementForm = 
        XmCreateForm(dtwm.iconPlacementTB, "iconPlacementForm", args, n);

    n = 0;
    XtSetArg(args[n], XmNmarginWidth, 0); n++;
    XtSetArg(args[n], XmNmarginHeight, 0); n++;
    dtwm.focusPolicyRC = 
        XmCreateRadioBox(windowFocusForm, "focusPolicyRC", args, n);

    n = 0;
    string = CMPSTR((char *)GETMESSAGE(18, 13, "Point In Window To Make Active"));
    XtSetArg(args[n], XmNlabelString, string); n++;
    dtwm.pointerTG = 
        XmCreateToggleButtonGadget(dtwm.focusPolicyRC, "pointerTG", args, n);
    XmStringFree(string);

    n = 0;
    string = CMPSTR((char *)GETMESSAGE(18, 14, "Click In Window To Make Active"));
    XtSetArg(args[n], XmNlabelString, string); n++;
    dtwm.explicitTG = 
        XmCreateToggleButtonGadget(dtwm.focusPolicyRC, "explicitTG", args, n);
    XmStringFree(string);

    n = 0;
    XtSetArg(args[n], XmNmargin, 0); n++;
    dtwm.focusSeparator = 
        XmCreateSeparatorGadget(windowFocusForm, "focusSeparator", args, n);

    n = 0;
    string = CMPSTR((char *)GETMESSAGE(18, 15, "Raise Window When Made Active"));
    XtSetArg(args[n], XmNnavigationType, XmTAB_GROUP); n++;  
    XtSetArg(args[n], XmNlabelString, string);  n++;
    XtSetArg(args[n], XmNalignment, XmALIGNMENT_BEGINNING);  n++;
    dtwm.autoRaiseTG = 
        XmCreateToggleButtonGadget(windowFocusForm, "autoRaiseTG", args, n);
    XmStringFree(string);


    n = 0;
    string = CMPSTR((char *)GETMESSAGE(18, 11, "Allow Primary Windows On Top"));
    XtSetArg(args[n], XmNnavigationType, XmTAB_GROUP); n++;  
    XtSetArg(args[n], XmNlabelString, string);  n++;
    XtSetArg(args[n], XmNalignment, XmALIGNMENT_BEGINNING);  n++;
    dtwm.secStackTG = 
        XmCreateToggleButtonGadget(windowFocusForm, "secStackTG", args, n);
    XmStringFree(string);

    n = 0;
    string = CMPSTR((char *)GETMESSAGE(18, 16, "Show Contents During Move"));
    XtSetArg(args[n], XmNnavigationType, XmTAB_GROUP); n++;  
    XtSetArg(args[n], XmNlabelString, string);  n++;
    XtSetArg(args[n], XmNalignment, XmALIGNMENT_BEGINNING);  n++;
    dtwm.moveOpaqueTG = 
        XmCreateToggleButtonGadget(windowFocusForm, "moveOpaqueTG", args, n);
    XmStringFree(string);

    n = 0;
    XtSetArg(args[n], XmNmarginWidth, 0); n++;
    XtSetArg(args[n], XmNmarginHeight, 0); n++;
    dtwm.useIconBoxRC = 
        XmCreateRadioBox(iconPlacementForm, "useIconBoxRC", args, n);

    n = 0;
    string = CMPSTR((char *)GETMESSAGE(18, 9, "Use Icon Box"));
    XtSetArg(args[n], XmNlabelString, string); n++;
    dtwm.iconBoxTG = 
        XmCreateToggleButtonGadget(dtwm.useIconBoxRC, "iconBoxTG", args, n);
    XmStringFree(string);

    n = 0;
    string = CMPSTR((char *)GETMESSAGE(18, 10, "Place On Workspace"));
    XtSetArg(args[n], XmNlabelString, string); n++;
    dtwm.desktopTG = 
        XmCreateToggleButtonGadget(dtwm.useIconBoxRC, "desktopTG", args, n);
    XmStringFree(string);

    XtAddCallback(style.dtwmDialog, XmNmapCallback, formLayoutCB, NULL);
    XtAddCallback(style.dtwmDialog, XmNmapCallback, _DtmapCB_dtwmDlg, shell);
    XtAddCallback(style.dtwmDialog, XmNcallback, ButtonCB, NULL);
    XtAddCallback(dtwm.systemDefault, XmNactivateCallback, systemDefaultCB, NULL);

    XtManageChild(form);
    XtManageChildren(widgetList1,count); 

    XtManageChild(windowFocusForm);
    XtManageChild(iconPlacementForm);

    XtManageChild(dtwm.focusPolicyRC);
    XtManageChild(dtwm.pointerTG);
    XtManageChild(dtwm.explicitTG);

    XtManageChild(dtwm.focusSeparator);
    XtManageChild(dtwm.autoRaiseTG);
    XtManageChild(dtwm.secStackTG);
    XtManageChild(dtwm.moveOpaqueTG);

    XtManageChild(dtwm.useIconBoxRC);
    XtManageChild(dtwm.iconBoxTG);
    XtManageChild(dtwm.desktopTG);

    return(style.dtwmDialog);
}