Ejemplo n.º 1
0
Widget make_text_widget(char *name, Widget parent, Arg *args, int n)
{
  /* white background when active, emacs translations */
  /* used only for comment widget in file data box (snd-xfile.c), but needs to be in this file to pick up actions etc */
  Widget df;
  if (!actions_loaded) 
    {
      XtAppAddActions(MAIN_APP(ss), acts, NUM_ACTS); 
      actions_loaded = true;
    }
  XtSetArg(args[n], XmNeditMode, XmMULTI_LINE_EDIT); n++;
  /* XmNblinkRate 0 turns off the cursor blink */
  XtSetArg(args[n], XmNcursorPositionVisible, false); n++;
  XtSetArg(args[n], XmNhighlightThickness, 1); n++;
  df = XmCreateScrolledText(parent, name, args, n);
  XtManageChild(df);
  XtAddCallback(df, XmNfocusCallback, textfield_focus_callback, NULL);
  XtAddCallback(df, XmNlosingFocusCallback, textfield_unfocus_callback, NULL);
  XtAddEventHandler(df, EnterWindowMask, false, mouse_enter_text_callback, NULL);
  XtAddEventHandler(df, LeaveWindowMask, false, mouse_leave_text_callback, NULL);
  if (!transTable3) 
    transTable3 = XtParseTranslationTable(TextTrans3);
  XtOverrideTranslations(df, transTable3);
  return(df);
}
Ejemplo n.º 2
0
static int motSetDragSourceAttrib(Ihandle* ih, const char* value)
{
  Widget w = (Widget)iupAttribGet(ih, "_IUPMOT_DND_WIDGET");
  if (!w)
    w = ih->handle;

  if(iupStrBoolean(value))
  {
    char dragTranslations[] = "#override <Btn2Down>: iupStartDrag()";
    static int do_rec = 0;

    if (!do_rec)
    {
      XtActionsRec rec = {"iupStartDrag", (XtActionProc)motDragStart};
      XtAppAddActions(iupmot_appcontext, &rec, 1);
      do_rec = 1;
    }
    XtOverrideTranslations(w, XtParseTranslationTable(dragTranslations));

    XtVaSetValues(w, XmNuserData, ih, NULL);  /* Warning: always check if this affects other controls */
  }
  else
    iupmotDisableDragSource(w);

  return 1;
}
Ejemplo n.º 3
0
/*
 * Initialize SubPopup(color)
 */
void InitSubPopupColor()
{
  int i;
  char buf[4];
  Pixmap checkmarkBitmap;
  String trans2 =
    "<Leave>:  SubPopdown(pctop)";

  checkmarkBitmap = XCreateBitmapFromData(XtDisplay(toplevel),
					  XDefaultRootWindow(XtDisplay(toplevel)),
					  coloritem_bits,
					  coloritem_width,coloritem_height);

  pcTop = Xt_P("pctop" ,simpleMenuWidgetClass,toplevel,NULL);
          Xt_W("pcline",smeLineObjectClass   ,pcTop   ,XtNlineWidth,2,NULL);

  for(i=0;i<POPUP_COLOR_NITEM;i++) {
    sprintf(buf,"pc%1d",i);
    pc[i] = Xt_W(buf,smeBSBObjectClass,pcTop,NULL);

    XtVaSetValues(pc[i],
		  XtNleftBitmap,checkmarkBitmap,
		  XtNleftMargin,72,
		  XtNlabel,"",
		  NULL);
    XtAddCallback(pc[i],XtNcallback,(XtCallbackProc)SelectColor,(XtPointer)i);
  }

  XtOverrideTranslations(pcTop,XtParseTranslationTable(trans2));
}
Ejemplo n.º 4
0
Archivo: em_menu.c Proyecto: Exim/exim
void create_dialog(uschar *label, uschar *value)
{
Arg warg[4];
Dimension x, y, xx, yy;
XtTranslations pop_trans;
Widget text;

/* Get the position of a reference widget so the dialog box can be put
near to it. */

get_pos_args[0].value = (XtArgVal)(&x);
get_pos_args[1].value = (XtArgVal)(&y);
XtGetValues(dialog_ref_widget, get_pos_args, 2);

/* When this is not a message_specific thing, the position of the reference
widget is relative to the window. Get the position of the top level widget and
add to the position. */

if (dialog_ref_widget != menushell)
  {
  get_pos_args[0].value = (XtArgVal)(&xx);
  get_pos_args[1].value = (XtArgVal)(&yy);
  XtGetValues(toplevel_widget, get_pos_args, 2);
  x += xx;
  y += yy;
  }

/* Create a transient shell for the dialog box. */

XtSetArg(warg[0], XtNtransientFor, queue_widget);
XtSetArg(warg[1], XtNx, x + 50);
XtSetArg(warg[2], XtNy, y + 50);
XtSetArg(warg[3], XtNallowShellResize, True);
dialog_shell = XtCreatePopupShell("forDialog", transientShellWidgetClass,
   toplevel_widget, warg, 4);

/* Create the dialog box. */

dialog_arg[0].value = (XtArgVal)label;
dialog_arg[1].value = (XtArgVal)value;
dialog_widget = XtCreateManagedWidget("dialog", dialogWidgetClass, dialog_shell,
  dialog_arg, XtNumber(dialog_arg));

/* Get the text widget from within the dialog box, give it the keyboard focus,
make it wider than the default, and override its translations to make Return
call the dialog action function. */

text = XtNameToWidget(dialog_widget, "value");
XawTextSetInsertionPoint(text, Ustrlen(value));
XtSetKeyboardFocus(dialog_widget, text);
xs_SetValues(text, 1, "width", 200);
pop_trans = XtParseTranslationTable(
  "<Key>Return:         dialogAction()\n");
XtOverrideTranslations(text, pop_trans);

/* Pop the thing up. */

XtPopup(dialog_shell, XtGrabExclusive);
XFlush(X_display);
}
Ejemplo n.º 5
0
/* AddToggleWidget will create a managed ToggleWidget in a radio_group,
   and set translation tables for correct behavior.
   Set radio_group to NULL to create the first widget in the group. */
Widget AddToggleWidget(
      String name,
      Widget parent,
      Widget radio_group,
      XtPointer radio_data,
      ArgList args,
      Cardinal num_args) {
  static String translation_table =
    "<EnterWindow>:        highlight(Always) \n \
     <LeaveWindow>:        unhighlight() \n \
     <Btn1Down>,<Btn1Up>:        set() notify()";
  static XtTranslations toggle_translations;

  Widget tw;
  Arg tw_args[2];
  Cardinal i;

  if(!toggle_translations)
    toggle_translations = XtParseTranslationTable(translation_table);

  i = 0;
  XtSetArg(tw_args[i], XtNradioData, radio_data); i++;
  XtSetArg(tw_args[i], XtNradioGroup, radio_group); i++;
  tw = XtCreateManagedWidget(name, toggleWidgetClass, parent, tw_args, i);
  
  XtSetValues(tw, args, num_args);
  XtOverrideTranslations(tw, toggle_translations);
  return(tw);
}
Ejemplo n.º 6
0
int
main (int argc, char **argv)
{
    XtAppContext xtcontext;
    Widget toplevel;

    ProgramName = argv[0];

    XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);

    toplevel = XtAppInitialize(&xtcontext, "XBiff", options, XtNumber (options),
			       &argc, argv, NULL, NULL, 0);
    if (argc != 1) Usage ();

    /*
     * This is a hack so that f.delete will do something useful in this
     * single-window application.
     */
    wm_delete_window = XInternAtom (XtDisplay(toplevel), "WM_DELETE_WINDOW",
                                    False);
    XtAppAddActions (xtcontext, xbiff_actions, XtNumber(xbiff_actions));
    XtOverrideTranslations(toplevel,
		   XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()"));

    (void) XtCreateManagedWidget ("mailbox", mailboxWidgetClass, toplevel,
				  NULL, 0);
    XtRealizeWidget (toplevel);
    (void) XSetWMProtocols (XtDisplay(toplevel), XtWindow(toplevel),
                            &wm_delete_window, 1);
    XtAppMainLoop (xtcontext);

    return 0;
}
Ejemplo n.º 7
0
PRIVATE void CreateLido ()
{
	Widget	sink;
	Arg	args[10];
	int	n;

      /* Create a new toplevel Shell */
	n = 0;
	if (LidoGeometry[0] != '\0')
	{
		XtSetArg (args[n], XtNgeometry, LidoGeometry); n++;
	}
	XtSetArg (args[n], XtNtitle, Res.lido_name); n++;
	LidoTop = XtCreatePopupShell ("lido", topLevelShellWidgetClass,
						Toplevel, args, n);

      /* Create the Text Widget */
	n = 0;
	XtSetArg (args[n], XtNtype, XawAsciiFile); n++;
	XtSetArg (args[n], XtNstring, Res.lido_name); n++;
	LidoText = XtCreateManagedWidget ("lidoText", asciiTextWidgetClass,
						LidoTop, args, n);

      /* Realize the new top level Widget */
	XtPopup (LidoTop, XtGrabNone);

      /*
       * This is a hack so that wm_delete_window will close the rule graph window.
       */
       
        /* Register Actions */
       XtAppAddActions (XtWidgetToApplicationContext(LidoTop), lido_actions, XtNumber(lido_actions));

       XtOverrideTranslations(LidoTop, 
		    XtParseTranslationTable ("<Message>WM_PROTOCOLS: close()"));
       
       wm_delete_window = XInternAtom (XtDisplay(LidoTop), "WM_DELETE_WINDOW", False);
       
       XSetWMProtocols (XtDisplay(LidoTop), XtWindow(LidoTop),
			    &wm_delete_window, 1);


      /* Try to find text sink */
	sink = XtNameToWidget (LidoTop, AsciiTextSinkName);
	if (sink == NULL)
	{
/* Don't give warnings... XtNameToWidget has never worked!
		fprintf (stderr,"%s: Couldn't find window of LIDO text.\n",
				ProgName);
		fprintf (stderr, "Menu will not work in LIDO window.\n");
*/
		return;
	}
	
      /* Register a passive grab for menu-popup */
	XGrabButton (XtDisplay (sink), AnyButton, AnyModifier, 
		XtWindow (sink), TRUE, ButtonPressMask|ButtonReleaseMask,
		GrabModeAsync, GrabModeAsync, None, None);
}
Ejemplo n.º 8
0
void 
launch_about(Widget w, XtPointer closure, XtPointer call_data)
{
    DeclareArgs(10);
    Widget    form, icon, ok;
    Position  x, y;
    char	  info[400];

    /* turn off Compose key LED */
    setCompLED(0);

    /* don't make more than one */
    if (!help_popup) {

	/* get the position of the help button */
	XtTranslateCoords(w, (Position) 0, (Position) 0, &x, &y);
	FirstArg(XtNx, x);
	NextArg(XtNy, y);
	help_popup = XtCreatePopupShell("About Xfig",transientShellWidgetClass,
				tool, Args, ArgCount);
	XtOverrideTranslations(help_popup,
			   XtParseTranslationTable(about_translations));
	XtAppAddActions(tool_app, about_actions, XtNumber(about_actions));

	FirstArg(XtNborderWidth, 0);
	form = XtCreateManagedWidget("help_form", formWidgetClass, help_popup,
				Args, ArgCount);
	/* put the xfig icon in a label and another label saying which version this is */
	FirstArg(XtNbitmap, fig_icon);
	NextArg(XtNinternalHeight, 0);
	NextArg(XtNinternalWidth, 0);
	NextArg(XtNborderWidth, 0);
	icon = XtCreateManagedWidget("xfig_icon", labelWidgetClass, form, Args, ArgCount);

	/* make up some information */
	strcpy(info,xfig_version);
	strcat(info,"\n  Parts Copyright \251 1989-2013 by Brian V. Smith ([email protected])");
	strcat(info,"\n  Parts Copyright \251 1991 by Paul King");
	strcat(info,"\n  Copyright \251 1985-1988 by Supoj Sutanthavibul");
	strcat(info,"\n  See source files and man pages for other copyrights");

	FirstArg(XtNlabel, info);
	NextArg(XtNfromHoriz, icon);
	NextArg(XtNhorizDistance, 20);
	NextArg(XtNborderWidth, 0);
	XtCreateManagedWidget("xfig_icon", labelWidgetClass, form, Args, ArgCount);

	FirstArg(XtNlabel, " Ok ");
	NextArg(XtNwidth, 50);
	NextArg(XtNheight, 30);
	NextArg(XtNfromVert, icon);
	NextArg(XtNvertDistance, 20);
	ok = XtCreateManagedWidget("help_ok", commandWidgetClass, form, Args, ArgCount);
	XtAddCallback(ok, XtNcallback, help_ok, (XtPointer) NULL);
    }
    XtPopup(help_popup,XtGrabNone);
    (void) XSetWMProtocols(tool_d, XtWindow(help_popup), &wm_delete_window, 1);
}
Ejemplo n.º 9
0
void ui_set_drive_menu(int drive, ui_menu_entry_t *flipmenu)
{
    char *leftmenuname;
    int i;
    Widget w;
    int num_app_shells = get_num_shells();

    if (drive < 0 || drive >= NUM_DRIVES) {
        return;
    }

    leftmenuname = lib_msprintf("leftDrive%iMenu", drive + 8);
    if (flipmenu != NULL) {
        w = ui_menu_create(leftmenuname, flipmenu, NULL);
        left_drive_menu[drive] = w;
    }

    if (!drive_menu_translations[drive]) {
        char *translation_table;
        char number[16];
        char *rightmenuname;

        sprintf(number, "%d", drive);
        rightmenuname = lib_msprintf("rightDrive%iMenu", drive + 8);

        translation_table = util_concat(
                "<Btn1Down>: "
                        "XawPositionSimpleMenu(", leftmenuname, ") "
                        "XtMenuPopup(", leftmenuname, ")\n",
                "Meta Shift <KeyDown>z: "
                        "FakeButton(1) "
                        "XawPositionSimpleMenu(", leftmenuname, ") "
                        "XtMenuPopup(", leftmenuname, ")\n",
                "<Btn3Down>: "
                        "RebuildDiskMenu(", number, ",", rightmenuname, ") "
                        "XawPositionSimpleMenu(", rightmenuname, ") "
                        "XtMenuPopup(", rightmenuname, ")\n",
                "Meta Shift <KeyDown>x: "
                        "RebuildDiskMenu(", number, ",", rightmenuname, ") "
                        "FakeButton(3) "
                        "XawPositionSimpleMenu(", rightmenuname, ") "
                        "XtMenuPopup(", rightmenuname, ")\n",
                NULL);
        drive_menu_translations[drive] =
                                XtParseTranslationTable(translation_table);
        lib_free(translation_table);
        lib_free(rightmenuname);

    }

    for (i = 0; i < num_app_shells; i++) {
        XtOverrideTranslations(app_shells[i].
                                        drive_widgets[drive].track_label,
                               drive_menu_translations[drive]);
    }

    lib_free(leftmenuname);
}
Ejemplo n.º 10
0
static void make_command_widget(int height)
{
  if (!listener_text)
    {
      Arg args[32];
      Widget wv, wh;
      int n;

      if (!actions_loaded) {XtAppAddActions(MAIN_APP(ss), acts, NUM_ACTS); actions_loaded = true;}

      n = attach_all_sides(args, 0);
      XtSetArg(args[n], XmNheight, height); n++;
      if ((sound_style(ss) == SOUNDS_IN_NOTEBOOK) || (sound_style(ss) == SOUNDS_HORIZONTAL))
	listener_pane = XtCreateManagedWidget("frm", xmFormWidgetClass, SOUND_PANE_BOX(ss), args, n);
      else listener_pane = XtCreateManagedWidget("frm", xmFormWidgetClass, SOUND_PANE(ss), args, n);
      /* this widget is not redundant at least in Metroworks Motif */

      n = 0;
      XtSetArg(args[n], XmNbackground, ss->sgx->listener_color); n++;
      XtSetArg(args[n], XmNforeground, ss->sgx->listener_text_color); n++;
      if (ss->sgx->listener_fontlist) {XtSetArg(args[n], XM_FONT_RESOURCE, ss->sgx->listener_fontlist); n++;}
      n = attach_all_sides(args, n);
      XtSetArg(args[n], XmNeditMode, XmMULTI_LINE_EDIT); n++;
      XtSetArg(args[n], XmNskipAdjust, true); n++;
      XtSetArg(args[n], XmNvalue, listener_prompt(ss)); n++;
      XtSetArg(args[n], XmNpendingDelete, false); n++; /* don't cut selection upon paste */
      XtSetArg(args[n], XmNpositionIndex, XmLAST_POSITION); n++;
      XtSetArg(args[n], XmNhighlightThickness, 1); n++;
      listener_text = XmCreateScrolledText(listener_pane, "lisp-listener", args, n);
      ss->sgx->listener_pane = listener_text;

      XtVaSetValues(MAIN_SHELL(ss), XmNallowShellResize, false, NULL);

      XtManageChild(listener_text);
      XmTextSetCursorPosition(listener_text, 1);
      if (!transTable4) 
	transTable4 = XtParseTranslationTable(TextTrans4);
      XtOverrideTranslations(listener_text, transTable4);
      printout_end = 0;
      XtAddCallback(listener_text, XmNactivateCallback, command_return_callback, NULL);
      XtAddCallback(listener_text, XmNmodifyVerifyCallback, command_modify_callback, NULL);
      XtAddCallback(listener_text, XmNmotionVerifyCallback, command_motion_callback, NULL);

      lisp_window = XtParent(listener_text);
      XtAddEventHandler(lisp_window, EnterWindowMask, false, listener_focus_callback, NULL);
      XtAddEventHandler(lisp_window, LeaveWindowMask, false, listener_unfocus_callback, NULL);
      
      XmChangeColor(lisp_window, ss->sgx->basic_color);
      XtVaGetValues(lisp_window, XmNverticalScrollBar, &wv, XmNhorizontalScrollBar, &wh, NULL);
      XmChangeColor(wv, ss->sgx->basic_color);
      XmChangeColor(wh, ss->sgx->basic_color);
      map_over_children(SOUND_PANE(ss), color_sashes);

      if (auto_resize(ss))
	XtVaSetValues(MAIN_SHELL(ss), XmNallowShellResize, true, NULL);
    }
}
Ejemplo n.º 11
0
/*
 * Function:
 *	AddInsertFileChildren
 *
 * Parameters:
 *	form - form widget for the insert dialog widget
 *	ptr  - pointer to the initial string for the Text Widget
 *	tw   - main text widget
 *
 * Description:
 *	Adds all children to the InsertFile dialog widget.
 */
static void
AddInsertFileChildren(Widget form, char *ptr, Widget tw)
{
    Arg args[10];
    Cardinal num_args;
    Widget label, text, cancel, insert;
    XtTranslations trans;

    num_args = 0;
    XtSetArg(args[num_args], XtNlabel, INSERT_FILE);	num_args++;
    XtSetArg(args[num_args], XtNleft, XtChainLeft);	num_args++;
    XtSetArg(args[num_args], XtNright, XtChainLeft);	num_args++;
    XtSetArg(args[num_args], XtNresizable, True);	num_args++;
    XtSetArg(args[num_args], XtNborderWidth, 0);	num_args++;
    label = XtCreateManagedWidget(LABEL_NAME, labelWidgetClass, form,
				  args, num_args);
  
    num_args = 0;
    XtSetArg(args[num_args], XtNfromVert, label);	num_args++;
    XtSetArg(args[num_args], XtNleft, XtChainLeft);	num_args++;
    XtSetArg(args[num_args], XtNright, XtChainRight);	num_args++;
    XtSetArg(args[num_args], XtNeditType, XawtextEdit);	num_args++;
    XtSetArg(args[num_args], XtNresizable, True);	num_args++;
    XtSetArg(args[num_args], XtNstring, ptr);		num_args++;
    text = XtCreateManagedWidget(TEXT_NAME, asciiTextWidgetClass, form,
				 args, num_args);

    num_args = 0;
    XtSetArg(args[num_args], XtNlabel, "Insert File");	num_args++;
    XtSetArg(args[num_args], XtNfromVert, text);	num_args++;
    XtSetArg(args[num_args], XtNleft, XtChainLeft);	num_args++;
    XtSetArg(args[num_args], XtNright, XtChainLeft);	num_args++;
    insert = XtCreateManagedWidget("insert", commandWidgetClass, form,
				   args, num_args);

    num_args = 0;
    XtSetArg(args[num_args], XtNlabel, "Cancel");	num_args++;
    XtSetArg(args[num_args], XtNfromVert, text);	num_args++;
    XtSetArg(args[num_args], XtNfromHoriz, insert);	num_args++;
    XtSetArg(args[num_args], XtNleft, XtChainLeft);	num_args++;
    XtSetArg(args[num_args], XtNright, XtChainLeft);	num_args++;
    cancel = XtCreateManagedWidget(DISMISS_NAME, commandWidgetClass, form,
				   args, num_args);

    XtAddCallback(cancel, XtNcallback, PopdownFileInsert, (XtPointer)tw);
    XtAddCallback(insert, XtNcallback, DoInsert, (XtPointer)tw);

    XtSetKeyboardFocus(form, text);

    /*
     * Bind <CR> to insert file
     */
    trans = XtParseTranslationTable("<Key>Return:InsertFileAction()");
    XtOverrideTranslations(text, trans);
}
Ejemplo n.º 12
0
Archivo: xsm.c Proyecto: aosm/X11
void
SetWM_DELETE_WINDOW(Widget widget, String delAction)
{
    char translation[64];

    sprintf (translation, "<Message>WM_PROTOCOLS: %s", delAction);
    XtOverrideTranslations (widget, XtParseTranslationTable (translation));

    XSetWMProtocols (XtDisplay(widget), XtWindow (widget),
	&wmDeleteAtom, 1);
}
Ejemplo n.º 13
0
/*
** This routine kludges around the problem of backspace not being mapped
** correctly when Motif is used between a server with a delete key in
** the traditional typewriter backspace position and a client that
** expects a backspace key in that position.  Though there are three
** distinct levels of key re-mapping in effect when a user is running
** a Motif application, none of these is really appropriate or effective
** for eliminating the delete v.s. backspace problem.  Our solution is,
** sadly, to eliminate the forward delete functionality of the delete key
** in favor of backwards delete for both keys.  So as not to prevent the
** user or the application from applying other translation table re-mapping,
** we apply re-map the key as a post-processing step, applied after widget
** creation.  As a result, the re-mapping necessarily becomes embedded
** throughout an application (wherever text widgets are created), and
** within library routines, including the Nirvana utility library.  To
** make this remapping optional, the SetDeleteRemap function provides a
** way for an application to turn this functionality on and off.  It is
** recommended that applications that use this routine provide an
** application resource called remapDeleteKey so savvy users can get
** their forward delete functionality back.
*/
void RemapDeleteKey(Widget w)
{
    static XtTranslations table = NULL;
    static char *translations =
    	"~Shift~Ctrl~Meta~Alt<Key>osfDelete: delete-previous-character()\n";

    if (RemapDeleteEnabled) {
    	if (table == NULL)
    	    table = XtParseTranslationTable(translations);
    	XtOverrideTranslations(w, table);
    }
}
Ejemplo n.º 14
0
void iupmotDisableDragSource(Widget w)
{
  char dragTranslations[] = "#override <Btn2Down>: iupDoNothing()";
  static int do_nothing_rec = 0;
  if (!do_nothing_rec)
  {
    XtActionsRec rec = {"iupDoNothing", (XtActionProc)motDoNothing};
    XtAppAddActions(iupmot_appcontext, &rec, 1);
    do_nothing_rec = 1;
  }
  XtOverrideTranslations(w, XtParseTranslationTable(dragTranslations));
}
Ejemplo n.º 15
0
/* if the window manager closes the window, tell the
   window manager to send a message to xt. xt will
   call the wm_quit callback.
*/
void grab_window_quit(Widget top)
{
    XtOverrideTranslations
	(TopLevel, XtParseTranslationTable ("<Message>WM_PROTOCOLS: wm_quit()"));

    /* http://www.lemoda.net/c/xlib-wmclose/ */
    static Atom wm_delete_window;
    wm_delete_window = XInternAtom(XtDisplay(top), "WM_DELETE_WINDOW",
				   False);
    (void) XSetWMProtocols (XtDisplay(top), XtWindow(top),
                            &wm_delete_window, 1);
}
Ejemplo n.º 16
0
void add_completer_to_textfield(Widget w, int completer)
{
  /* used to make file selection dialog act like other text field widgets */
  if (!actions_loaded) 
    {
      XtAppAddActions(MAIN_APP(ss), acts, NUM_ACTS); 
      actions_loaded = true;
    }
  if (!transTable2) 
    transTable2 = XtParseTranslationTable(TextTrans2);
  XtOverrideTranslations(w, transTable2);
  add_completer_widget(w, completer);
}
Ejemplo n.º 17
0
void Gflushlazyq (void) {
    if (Glazyq.flag & LAZYMANAGE) {
        XtManageChildren (Glazyq.mws, Glazyq.mwn);
        Glazyq.flag &= ~LAZYMANAGE;
    }
    if (Glazyq.flag & LAZYREALIZE) {
        XtRealizeWidget (Glazyq.rw);
        if (Glazyq.flag & LAZYRHINTS)
            XSetWMNormalHints (Gdisplay, XtWindow (Glazyq.rw), &Glazyq.hints);
        XSetWMProtocols (Gdisplay, XtWindow (Glazyq.rw), &Gwmdelatom, 1);
        XtOverrideTranslations (Glazyq.rw, Gwmdeltable);
        Glazyq.flag &= ~LAZYRHINTS;
        Glazyq.flag &= ~LAZYREALIZE;
    }
}
Ejemplo n.º 18
0
Archivo: bbox.c Proyecto: aosm/X11
static void bboxAddButton(
    ButtonBox	buttonbox,
    char	*name,
    WidgetClass	kind,
    Boolean	enabled,
    Boolean	radio)
{
    Button	button;
    Cardinal	i;
    Widget	radio_group;
    Arg		args[5];

    buttonbox->numbuttons++;
    buttonbox->button = (Button *) 
	XtRealloc((char *) buttonbox->button,
		  (unsigned) buttonbox->numbuttons * sizeof(Button));
    button = buttonbox->button[buttonbox->numbuttons - 1] = XtNew(ButtonRec);
    button->buttonbox = buttonbox;
    button->name = XtNewString(name);
    button->menu = (Widget) NULL;

    i = 0;
    if (!enabled) {
	XtSetArg(args[i], XtNsensitive, False);		i++;
    }

    if (radio && kind == toggleWidgetClass) {
	if (buttonbox->numbuttons > 1)
	    radio_group = (button == buttonbox->button[0]) 
		? (buttonbox->button[1]->widget)
		: (buttonbox->button[0]->widget);
	else radio_group = NULL;
	XtSetArg(args[i], XtNradioGroup, radio_group);		i++;
	XtSetArg(args[i], XtNradioData, button->name);		i++;
    }

    /* Prevent the folder buttons from picking up labels from resources */

    if (buttonbox == buttonbox->scrn->folderbuttons) {
	XtSetArg(args[i], XtNlabel, button->name);	i++;
    }

    button->widget =
	XtCreateManagedWidget(name, kind, buttonbox->inner, args, i);

    if (radio)
	XtOverrideTranslations(button->widget, RadioButtonTranslations);
}
Ejemplo n.º 19
0
void Glazyrealize (Widget w, int hintsflag, XSizeHints *hintsp) {
    if (Glazyq.flag & LAZYREALIZE) {
        XtRealizeWidget (Glazyq.rw);
        if (Glazyq.flag & LAZYRHINTS)
            XSetWMNormalHints (Gdisplay, XtWindow (Glazyq.rw), &Glazyq.hints);
        XSetWMProtocols (Gdisplay, XtWindow (Glazyq.rw), &Gwmdelatom, 1);
        XtOverrideTranslations (Glazyq.rw, Gwmdeltable);
    } else
        Glazyq.flag |= LAZYREALIZE;
    Glazyq.rw = w;
    if (hintsflag) {
        Glazyq.flag |= LAZYRHINTS;
        Glazyq.hints = *hintsp;
    } else
        Glazyq.flag &= ~LAZYRHINTS;
}
Ejemplo n.º 20
0
void
fe_InitRemoteServerWindow (MWContext *context)
{
  Widget widget = CONTEXT_WIDGET (context);
  Display *dpy = XtDisplay (widget);
  Window window = XtWindow (widget);
  XWindowAttributes attrs;
  unsigned char *data = (unsigned char *) fe_version;

  XtOverrideTranslations (widget, fe_prop_translations);

  XChangeProperty (dpy, window, XA_MOZILLA_VERSION, XA_STRING,
		   8, PropModeReplace, data, strlen (data));

  XGetWindowAttributes (dpy, window, &attrs);
  if (! (attrs.your_event_mask & PropertyChangeMask))
    XSelectInput (dpy, window, attrs.your_event_mask | PropertyChangeMask);
}
Ejemplo n.º 21
0
bool wxDialog::XmDoCreateTLW(wxWindow* parent,
                             wxWindowID WXUNUSED(id),
                             const wxString& WXUNUSED(title),
                             const wxPoint& WXUNUSED(pos),
                             const wxSize& WXUNUSED(size),
                             long WXUNUSED(style),
                             const wxString& name)
{
    Widget parentWidget = (Widget) 0;
    if( parent )
        parentWidget = (Widget) parent->GetTopWidget();
    if( !parent )
        parentWidget = (Widget) wxTheApp->GetTopLevelWidget();

    wxASSERT_MSG( (parentWidget != (Widget) 0),
                  "Could not find a suitable parent shell for dialog." );

    Arg args[2];
    XtSetArg (args[0], XmNdefaultPosition, False);
    XtSetArg (args[1], XmNautoUnmanage, False);
    Widget dialogShell =
        XmCreateBulletinBoardDialog( parentWidget,
                                     name.char_str(),
                                     args, 2);
    m_mainWidget = (WXWidget) dialogShell;

    // We don't want margins, since there is enough elsewhere.
    XtVaSetValues( dialogShell,
                   XmNmarginHeight,   0,
                   XmNmarginWidth,    0,
                   XmNresizePolicy, XmRESIZE_NONE,
                   NULL ) ;

    XtTranslations ptr ;
    XtOverrideTranslations(dialogShell,
        ptr = XtParseTranslationTable("<Configure>: resize()"));
    XtFree((char *)ptr);

    XtRealizeWidget(dialogShell);

    wxAddWindowToTable( (Widget)m_mainWidget, this );

    return true;
}
Ejemplo n.º 22
0
Archivo: light.c Proyecto: Thump/sceda
static void
Create_Light_Dialog()
{
	Arg	args[3];
	int	n;

	n = 0;
	XtSetArg(args[n], XtNtitle, "Intensity");	n++;
	XtSetArg(args[n], XtNallowShellResize, TRUE);	n++;
	light_shell =  XtCreatePopupShell("lightShell",
						transientShellWidgetClass, main_window.shell, args, n);

	n = 0;
	XtSetArg(args[n], XtNlabel, "Light Intensity");	n++;
	XtSetArg(args[n], XtNvalue, "");					n++;
	light_dialog = XtCreateManagedWidget("lightDialog", dialogWidgetClass,
							light_shell, args, n);

	XawDialogAddButton(light_dialog, "Done", Light_Intensity_Callback, NULL);
	XawDialogAddButton(light_dialog, "Cancel", Cancel_Light_Callback,
						(XtPointer)light_shell);

	XtOverrideTranslations(XtNameToWidget(light_dialog, "value"),
		XtParseTranslationTable(":<Key>Return: Light_Action()"));

	XtVaSetValues(XtNameToWidget(light_dialog, "label"),
				  XtNborderWidth, 0, NULL);
#if ( USE_ROUNDED_BUTTONS == 1 )
	XtVaSetValues(XtNameToWidget(light_dialog, "Done"),
				  XtNshapeStyle, XmuShapeRoundedRectangle,
				  XtNcornerRoundPercent, 30,
				  XtNhighlightThickness, 2,
				  NULL);
	XtVaSetValues(XtNameToWidget(light_dialog, "Cancel"),
				  XtNshapeStyle, XmuShapeRoundedRectangle,
				  XtNcornerRoundPercent, 30,
				  XtNhighlightThickness, 2,
				  NULL);
#endif

	XtRealizeWidget(light_shell);
}
Ejemplo n.º 23
0
/* if the window manager closes the window, tell the
   window manager to send a message to xt. xt will
   call the wm_quit callback.
*/
void grab_window_quit(Widget top)
{
    XtAppContext app = XtWidgetToApplicationContext(top);
    /* if the user closes the window
       the Window Manager will call our quit() function
    */
    /* xorg/app/oclock/oclock.c */
    static XtActionsRec actions[] = {
        {"quit",	wm_quit}
    };
    XtAppAddActions
	(app, actions, XtNumber(actions));
    XtOverrideTranslations
	(TopLevel, XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()"));
    Atom wm_delete_window;
    wm_delete_window = XInternAtom(XtDisplay(top), "WM_DELETE_WINDOW",
				   False);
    (void) XSetWMProtocols (XtDisplay(top), XtWindow(top),
                            &wm_delete_window, 1);
}
Ejemplo n.º 24
0
static void
create_menu_entries(struct button_info *item, Widget parent)
{
    size_t i;

    /* add our own popdown-submenus() action to the default translations of this menu */
    XtAccelerators menu_accels = XtParseAcceleratorTable("<BtnUp>:MenuPopdown()notify()unhighlight()popdown-submenus()");

    for (i = 0; item != NULL && i < item->size; i++) {
        Widget w;

        if (item->elems[i].submenu != NULL) { /* another submenu */
            XDVI_ERROR((stderr, "Xaw menus don't support nested pulldown menus (ignoring)"));
            continue;
        }

        if (item->elems[i].type == BT_SEP) { /* separator */
            w = XtCreateManagedWidget(item->elems[i].title, smeLineObjectClass, parent, NULL, 0);
        }
        else if (item->elems[i].action != NULL && item->elems[i].action->proc == Act_recent_files) {
            /* special case: submenu with recent files */
            w = XtVaCreateManagedWidget(item->elems[i].title, smeBSBObjectClass, parent,
                                        XtNlabel, item->elems[i].title,
                                        XtNleftMargin, 20,
                                        XtNrightMargin, 16,
                                        XtNrightBitmap, menu_arrow_bitmap,
                                        NULL);
            m_submenu = w;
            XtOverrideTranslations(parent, menu_accels);
        }
        else { /* normal menu entry */
            w = XtVaCreateManagedWidget(item->elems[i].title, smeBSBObjectClass, parent,
                                        XtNlabel, item->elems[i].title,
                                        XtNleftMargin, 20,
                                        NULL);
            XtAddCallback(w, XtNcallback, handle_command, item->elems[i].action);
        }
        item->elems[i].widget = w;
    }
}
Ejemplo n.º 25
0
Widget ui_menu_create(const char *menu_name, ...)
{
    Widget w;
    ui_menu_entry_t *list;
    va_list ap;

    w = ui_create_shell(_ui_top_level, menu_name, simpleMenuWidgetClass);
    XtAddCallback(w, XtNpopupCallback, menu_popup_callback, NULL);
    XtAddCallback(w, XtNpopdownCallback, menu_popdown_callback, NULL);

    /*
     * We want to be able to have either kind of menu:
     * stay-up when we release the mouse button before moving
     * (it starts on the edge of the menu).
     */
    if (!menu_translations) {
        menu_translations = XtParseTranslationTable(
            "<Motion>: Moved() highlight() PositionSubmenu()\n"
            "<LeaveWindow>: Unhighlight()\n"
            "<BtnUp>: ButtonUp()\n"     /* may do Select() depending on mode */
            "<KeyDown>Down: NextItem()\n"
            "<KeyDown>Up: PrevItem()\n"
            "<KeyDown>Left: ExitSubmenu()\n"
            "<KeyDown>Right: EnterSubmenu()\n"
            "<KeyDown>Return: Select()\n"
            "<KeyDown>space: Select(1)\n"
            "<KeyDown>Escape: Popdownsubmenus() XtMenuPopdown() unhighlight()\n"
          );
    }
    XtOverrideTranslations(w, menu_translations);

    va_start(ap, menu_name);
    while ((list = va_arg(ap, ui_menu_entry_t *)) != NULL) {
        ui_add_items_to_shell(w, 1, list);
    }
    va_end(ap);

    return w;
}
Ejemplo n.º 26
0
/*
 * Initialize SubPopup(font)
 */
void InitSubPopupFont()
{
  int i;
  char buf[4];
  String trans2 =
    "<Leave>:  SubPopdown(pftop)";

  pfTop = Xt_P("pftop" ,simpleMenuWidgetClass,toplevel,NULL);
          Xt_W("pfline",smeLineObjectClass   ,pfTop   ,XtNlineWidth,2,NULL);

  for(i=0;i<POPUP_FONT_NITEM;i++) {
    sprintf(buf,"pf%1d",i);
    pf[i] = Xt_W(buf,smeBSBObjectClass,pfTop,
		 XtNleftMargin,16,
		 XtNrightMargin,16,
		 NULL);

    XtAddCallback(pf[i],XtNcallback,(XtCallbackProc)SelectFont,(XtPointer)i);
  }

  XtOverrideTranslations(pfTop,XtParseTranslationTable(trans2));
}
Ejemplo n.º 27
0
static void motListEnableDragDrop(Widget w)
{
  Atom atomListItem = XInternAtom(iupmot_display, "LIST_ITEM", False);
  Atom importList[1];
  Arg args[40];
  int num_args = 0;
  char dragTranslations[] = "#override <Btn2Down>: iupListStartDrag()";
  static int do_rec = 0;
  if (!do_rec)
  {
    XtActionsRec rec = {"iupListStartDrag", (XtActionProc)motListDragStart};
    XtAppAddActions(iupmot_appcontext, &rec, 1);
    do_rec = 1;
  }
  XtOverrideTranslations(w, XtParseTranslationTable(dragTranslations));

  importList[0] = atomListItem;
  iupMOT_SETARG(args, num_args, XmNimportTargets, importList);
  iupMOT_SETARG(args, num_args, XmNnumImportTargets, 1);
  iupMOT_SETARG(args, num_args, XmNdropSiteOperations, XmDROP_MOVE|XmDROP_COPY);
  iupMOT_SETARG(args, num_args, XmNdropProc, motListDropProc);
  XmDropSiteRegister(w, args, num_args);
}
Ejemplo n.º 28
0
/*
 * Initialize Popup menu
 */
void InitPopup()
{
  int i;
  String trans =
    "<Btn3Motion>: highlight() SubPopup()\n\
    ";

  /* Initialize Popup menu */
  popup    = Xt_P("popup",simpleMenuWidgetClass,toplevel,NULL);
             Xt_W("pmLine"  ,smeLineObjectClass,popup,XtNlineWidth,2,NULL);
  pmAbout  = Xt_W("pmAbout" , smeBSBObjectClass,popup,NULL);
             Xt_W("pmLine"  ,smeLineObjectClass,popup,NULL);
  pmNew    = Xt_W("pmNew"   , smeBSBObjectClass,popup,NULL);
  pmLoad   = Xt_W("pmLoad"  , smeBSBObjectClass,popup,NULL);
  pmSave   = Xt_W("pmSave"  , smeBSBObjectClass,popup,NULL);
  pmClose  = Xt_W("pmClose" , smeBSBObjectClass,popup,NULL);
             Xt_W("pmLine"  ,smeLineObjectClass,popup,NULL);
  pmFont   = Xt_W("pmFont"  , smeBSBObjectClass,popup,NULL);
  pmColor  = Xt_W("pmColor" , smeBSBObjectClass,popup,NULL);
  pmIcon   = Xt_W("pmIcon"  , smeBSBObjectClass,popup,NULL);
  pmDup    = Xt_W("pmDup"   , smeBSBObjectClass,popup,NULL);
             Xt_W("pmLine"  ,smeLineObjectClass,popup,NULL);
  pmQuit   = Xt_W("pmQuit"  , smeBSBObjectClass,popup,NULL);

  XtAddCallback(pmAbout ,XtNcallback,(XtCallbackProc)About        ,(XtPointer)NULL);
  XtAddCallback(pmNew   ,XtNcallback,(XtCallbackProc)MakeVisWindow,(XtPointer)NULL);
  XtAddCallback(pmLoad  ,XtNcallback,(XtCallbackProc)FileDialog   ,(XtPointer)Fload);
  XtAddCallback(pmSave  ,XtNcallback,(XtCallbackProc)FileDialog   ,(XtPointer)Fsave);
  XtAddCallback(pmClose ,XtNcallback,(XtCallbackProc)DeleteWindow ,(XtPointer)NULL);
  XtAddCallback(pmFont  ,XtNcallback,(XtCallbackProc)SelectFont   ,(XtPointer)NULL);
  XtAddCallback(pmColor ,XtNcallback,(XtCallbackProc)SelectColor  ,(XtPointer)NULL);
  XtAddCallback(pmIcon  ,XtNcallback,(XtCallbackProc)Iconify      ,(XtPointer)NULL);
  XtAddCallback(pmDup   ,XtNcallback,(XtCallbackProc)Duplicate    ,(XtPointer)NULL);
  XtAddCallback(pmQuit  ,XtNcallback,(XtCallbackProc)Quit         ,(XtPointer)NULL);

  XtOverrideTranslations(popup,XtParseTranslationTable(trans));
}
Ejemplo n.º 29
0
void
MakeTopBox()
{
  Widget form, command, label; /* widgets. */
  Arg arglist[TOPARGS];		/* An argument list */
  Cardinal num_args = 0;	/* The number of arguments. */
  ManpageGlobals * man_globals;
  static char * full_size[] = {
    "topLabel", MANPAGE_BUTTON, NULL
  };
  static char * half_size[] = {
    HELP_BUTTON, QUIT_BUTTON, NULL
  };
  
/* create the top icon. */

  num_args = 0;
  XtSetArg(arglist[num_args], XtNiconPixmap,
	   XCreateBitmapFromData( XtDisplay(initial_widget), 
				 XtScreen(initial_widget)->root,
				 (char *)iconclosed_bits, iconclosed_width,
				 iconclosed_height));
  num_args++;
  XtSetArg(arglist[num_args], XtNtitle, resources.title);
  num_args++;
  XtSetArg(arglist[num_args], XtNiconic, resources.iconic);
  num_args++;
  top = XtCreatePopupShell(TOPBOXNAME, topLevelShellWidgetClass, 
			   initial_widget, arglist, num_args);

  form = XtCreateManagedWidget("form", formWidgetClass, top, 
			       NULL, (Cardinal) 0);

  label = XtCreateManagedWidget("topLabel", labelWidgetClass, form, 
			       NULL, (Cardinal) 0);

  num_args = 0;
  XtSetArg(arglist[num_args], XtNfromVert, label); num_args++;
  command = XtCreateManagedWidget(HELP_BUTTON, commandWidgetClass, form, 
				  arglist, num_args);

  /* use same vertical as help widget. */
  XtSetArg(arglist[num_args], XtNfromHoriz, command); num_args++;
  command = XtCreateManagedWidget(QUIT_BUTTON, commandWidgetClass, form, 
				  arglist, num_args);

  num_args = 0;
  XtSetArg(arglist[num_args], XtNfromVert, command); num_args++;
  command = XtCreateManagedWidget(MANPAGE_BUTTON, commandWidgetClass, form, 
				  arglist, num_args);

  help_widget = NULL;		/* We have not seen the help yet. */

  FormUpWidgets(form, full_size, half_size);

  XtRealizeWidget(top);
				/* add WM_COMMAND property */
  XSetCommand(XtDisplay(top), XtWindow(top), saved_argv, saved_argc);

  man_globals = (ManpageGlobals*) XtMalloc( (Cardinal) sizeof(ManpageGlobals));
  man_globals->label = NULL;
  man_globals->manpagewidgets.directory = NULL;
  man_globals->manpagewidgets.manpage = NULL;
  man_globals->manpagewidgets.box = NULL;
  man_globals->current_directory = 0;
  MakeSearchWidget(man_globals, top);
  MakeSaveWidgets(man_globals, top);

  SaveGlobals( (man_globals->This_Manpage = top), man_globals);
  XtMapWidget(top);
  AddCursor(top, resources.cursors.top);

/*
 * Set up ICCCM delete window.
 */
  wm_delete_window = XInternAtom(XtDisplay(top), "WM_DELETE_WINDOW",
				 False);
  XtOverrideTranslations
      (top, XtParseTranslationTable ("<Message>WM_PROTOCOLS: Quit()"));
  (void) XSetWMProtocols (XtDisplay(top), XtWindow(top),
			  &wm_delete_window, 1);
  

}
Ejemplo n.º 30
0
//
// Create a new foe window
// SG 09.02.91 : Create a new toplevel widget and give it an pixmap icon
// SG : 13.02.91 Fetch a caution box and save the id of the widget in the 
//               foe context for futher use
// SG : 24.02.91 Fetch a widget ( again !) . This time a message box
// SG : 24.03.91 Send the routine the desired position (x_top , y_top) 
// and the desired size ( width_adb , height_adb ) for the window to be created.
// The two first parameters are set to the top level widget
// and the two last paramters are set to the adb widget (see in uil file
// the widget hierarchy )
// SG 14.04.91 A new widget to fetch , the help widget ! 
// SG 2.05.91 New parameter : function ( edit , trace , view , simulate ..)
// to indicate which neted events and which menu entries should be alllowed.
//
pwr_tStatus WFoeMotif::create_window( int x_top,
				 int y_top,
				 int width_adb,
				 int height_adb, 
				 ldh_tSesContext ldhsession,
				 foe_eFuncAccess function_access)
{
  Arg	args[20];
  int	sts;
  Widget *children;
  int i, num_children;
  XmString   	TitleStr;
  Dimension icon_w, icon_h;

  /* DRM database hierarchy related variables */
  MrmHierarchy s_MrmH;
  MrmType dclass;
  char		uid_filename[200] = {"pwr_exe:wb_foe.uid"};
  char		*uid_filename_p = uid_filename;
  static Atom	MwmDeleteWind = 0;
  static char translations[] = "\
<FocusIn>: foe_inputfocus()\n";
  static XtTranslations compiled_translations = NULL;

  static XtActionsRec actions[] =
    {
      {(char*) "foe_inputfocus",      (XtActionProc) action_inputfocus}
    };
       
  sts = dcli_translate_filename( uid_filename, uid_filename);
  if ( EVEN(sts)) {
    printf( "** pwr_exe is not defined\n");
    exit(0);
  }

  /*
   * Now start the module creation
   */

  /* Save the context structure in the widget */
  XtSetArg (args[0], XmNuserData, (XtPointer) this);

  /*
   * Create a new main widget
   */
  /*
   * Open the UID files (the output of the UIL compiler) in the hierarchy
   * Register the items DRM needs to bind for us.
   * Create a new neted-widget
   * Close the hierarchy
   * Compile the additional button translations and augment and add actions
   */ 
  sts = MrmOpenHierarchy( 1, &uid_filename_p, NULL, &s_MrmH);
  if (sts != MrmSUCCESS) {
    printf("can't open hierarchy\n");
    return 0;
  }

  register_callbacks();

  /* SG 09.02.91 : create the new hierarchy. By the way use a pixmap define
  with help of wb_foe_ptrn.h */

  /* create a pixmap for the icon */
  if ( icon_pixmap == 0 )
    sts = MrmFetchBitmapLiteral(s_MrmH,(char*) "icon",
				XtScreen(parent_wid), XtDisplay(parent_wid),
				&icon_pixmap, &icon_w, &icon_h);  
 
  i=0;
  XtSetArg(args[i],XmNiconName,name);  i++;
  XtSetArg(args[i],XtNiconPixmap,icon_pixmap);  i++;
  
  /* SG 11.02.91 Save the id of the top in the context */ 
  parent_wid = XtCreatePopupShell("plcEditor", 
		     topLevelShellWidgetClass, parent_wid, args, i);

  if (compiled_translations == NULL) 
    XtAppAddActions( XtWidgetToApplicationContext( parent_wid), 
						actions, XtNumber(actions));

  /* the positioning of a top level can only be define after the creation
      of the widget . So i do it know: 
     SG 24.02.91 use the parameters received x and y 
  */

  i=0;
  XtSetArg(args[i],XmNx,x_top);i++;
  XtSetArg(args[i],XmNy,y_top);i++;
  XtSetArg(args[i],XtNallowShellResize,TRUE), i++;

  if ( ! map_window) {
    XtSetArg(args[i],XmNmappedWhenManaged,FALSE); i++;
  }

  XtSetValues( parent_wid, args, i);

  XtSetArg (args[0], XmNuserData, (XtPointer) this);

  /* now that we have a top level we can get the main window */
  sts = MrmFetchWidgetOverride(s_MrmH, (char*) "foe_window", parent_wid ,
		name, args, 1,
		&widgets.foe_window, &dclass);
  if (sts != MrmSUCCESS) printf("can't fetch foedit widget\n");

  /* SG 24.02.91 Set the width and hight desired for the main window to his
	child the adb widget */
  i=0;
  XtSetArg(args[i],XmNwidth,width_adb);i++;
  XtSetArg(args[i],XmNheight,height_adb);i++;
  XtSetValues( widgets.adb  ,args,i);

  /* SG 24.02.91
     Get a litle message box widget that you will make appears when you want by
     calling foe_msgbox
  */

  if (MrmFetchWidget (s_MrmH, 
			(char*) "foe_msgbox", 
			widgets.foe_window,
			&widgets.msgbox,
			&dclass) != MrmSUCCESS)
	printf("can't fetch msgbox \n");

  TitleStr = XmStringCreateLtoR((char*) "PlcEdit Message" , (char*) "ISO8859-1");    
  XtSetArg(args[0],XmNdialogTitle,TitleStr);
  XtSetValues( widgets.msgbox, args, 1);
  XmStringFree(TitleStr);


  /* SG 13.02.91 
     Get a litle caution widget that you will make appears when you want by
     calling foe_popupmsg 
  */

  if (MrmFetchWidget (s_MrmH, 
			(char*) "foe_popupmsg", 
			widgets.foe_window,
			&widgets.caution,
			&dclass) != MrmSUCCESS)
    printf("can't fetch popupmsg\n");

  TitleStr = XmStringCreateLtoR((char*) "PlcEdit Confirm" , (char*) "ISO8859-1");    
  XtSetArg(args[0],XmNdialogTitle,TitleStr);
  XtSetValues( widgets.caution, args, 1);
  XmStringFree(TitleStr);


  /* create the pane widgets */
  /* create the palette module */
  /* SG 07.03.91 put two palletes in the sub pane widget */

  node_palctx = new PalMotif( this, widgets.subpane, "Objects",
		ldhsession, "PlcEditorPalette", 
		&widgets.node_palette, &sts);
  node_palette_managed = 1;

  navctx = new NavMotif( this, widgets.subpane, "Plant",
		ldhsession, "NavigatorW1",
		&widgets.nav_palette, &sts);
  XtUnmanageChild( widgets.nav_palette);

  con_palctx = new PalMotif( this, widgets.subpane, "Connections",
		ldhsession, "PlcEditorConPalette", 
		&widgets.con_palette, &sts);
  XtUnmanageChild( widgets.con_palette);


  /* Turn off traversal for sash widgets */
  XtVaGetValues(widgets.subpane, 
		XmNchildren, &children,
		XmNnumChildren, &num_children,
		NULL);
  for (i = 0; i < num_children; i++) {
    if (XmIsSash(children[i]))
      XtVaSetValues(children[i], XmNtraversalOn, False, NULL);
  }

  /* create the gredit module */
  XtManageChild(widgets.foe_window);


  gre = new WGreMotif( this, widgets.pane, "Name");

  ((WGreMotif *)gre)->new_navigator( widgets.subpane);

  if ( map_window)
    XtPopup(parent_wid, XtGrabNone);
  else
    XtRealizeWidget( parent_wid);

  gre->init();

  /* create the setup ie:
     enable netedevents,
     enable menu entries
     setup backcalls from the gredit module */

  function_setup();

  MrmCloseHierarchy(s_MrmH);

  if (compiled_translations == NULL) 
    compiled_translations = XtParseTranslationTable(translations);
  XtOverrideTranslations( widgets.foe_window, compiled_translations);

  XtUnmanageChild(widgets.textinput);

  if ( !(CoLogin::privilege() & pwr_mPrv_DevPlc ) || 
       (function_access == foe_eFuncAccess_View)) {
    /* Mode Edit and Simulate is not allowed */
    i=0;
    XtSetArg(args[i],XmNsensitive,0); i++;

    XtSetValues( widgets.edit_togg,args,i);
    XtSetValues( widgets.simulate_togg,args,i);
  }

  if (MwmDeleteWind == 0)
    MwmDeleteWind = XInternAtom(XtDisplay(parent_wid), "WM_DELETE_WINDOW", FALSE);

  if (MwmDeleteWind != 0) {
    XtVaSetValues(parent_wid, XmNdeleteResponse, XmDO_NOTHING, NULL);
    XmAddWMProtocolCallback(parent_wid, MwmDeleteWind, 
			    (XtCallbackProc)activate_quit, this);
  }

  CoWowMotif::GetAtoms( parent_wid, 0, &objid_atom, 0);

  /* SG 09.02.91 a top level should always be realized !
   * ML 16.03.94 changed Realize to Popup
   */

  return FOE__SUCCESS;
}