void display_note_equip_poplist (Widget w, XtPointer client_data, XtPointer call_data) { if (notesc_poplist_shell == NULL) create_notesc_poplist_shell (notes_create_shell); /* Populate the list. The subscr_no values are not saved in a ** list structure, but are retrieved from the db every time the ** poplist button is activated. */ XmListDeleteAllItems (notesc_poplist); populate_note_subscr_no_list(); XmListAddItems (notesc_poplist, note_subscr_no_strings, num_note_subscr_no_codes, 0); /* Set the text field that will be populated when user selects * a value from the list. */ XtVaSetValues (notesc_poplist, XmNuserData, notes_equip_txt, NULL); position_poplist (w, notesc_poplist_shell); XtManageChild (notesc_poplist_form); XtPopup (notesc_poplist_shell, XtGrabNone); XmProcessTraversal (notesc_poplist, XmTRAVERSE_CURRENT); }
/*ARGSUSED*/ static Boolean SetValues( Widget current, Widget request, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { Widget child ; XmDialogSavvyTrait trait ; if(!current->core.mapped_when_managed && new_w->core.mapped_when_managed) { if((child = GetRectObjKid ((CompositeWidget) new_w)) && !child->core.being_destroyed ) { if ((trait = (XmDialogSavvyTrait) XmeTraitGet((XtPointer) XtClass(child), XmQTdialogShellSavvy)) != NULL) { trait->callMapUnmapCB(child, True); /* call Map callback */ } XtPopup(new_w, XtGrabNone) ; } } return (FALSE); }
void display_notes_create_screen (Widget w, XtPointer client_data, XtPointer call_data) { /* Display the screen that lets the user enter a new note */ if (notes_create_shell == NULL) { create_notes_create_shell(notes_shell); notes_create_add_event_handlers(); get_user_note_duration(); } init_notes_create_screen (); /* Get account_no from global var */ XmTextSetString (nc_accountid_txt, gacct_external_id); XmTextSetString (nc_accountname_txt, gaccount_name); set_editable_off (nc_accountid_txt); set_editable_off (nc_accountname_txt); set_editable_off (notes_text_txt); XtManageChild(notes_create_form); XtPopup (notes_create_shell, XtGrabNone); /* Set global to indicate that this window is up */ notes_create_shell_up = TRUE; /* Position the cursor on the subscr_no field */ XmProcessTraversal (notes_equip_txt, XmTRAVERSE_CURRENT); }
void display_note_text_poplist (Widget w, XtPointer client_data, XtPointer call_data) { int status; if (notesc_poplist_shell == NULL) create_notesc_poplist_shell (notes_create_shell); /* Populate the list */ XmListDeleteAllItems (notesc_poplist); status = populate_note_text_list(); if (status != SUCCESS) return; XmListAddItems (notesc_poplist, note_text_strings, num_note_text_codes, 0); /* Set the text field that will be populated when user selects * a value from the list. */ XtVaSetValues (notesc_poplist, XmNuserData, notes_text_txt, NULL); position_poplist (w, notesc_poplist_shell); XtManageChild (notesc_poplist_form); XtPopup (notesc_poplist_shell, XtGrabNone); XmProcessTraversal (notesc_poplist, XmTRAVERSE_CURRENT); }
void cc_main_credit_hold_btn_cb (Widget w, XtPointer *client_data, XmPushButtonCallbackStruct *call_data) { show_busy_cursor (cc_main_shell, True); if (cc_credit_hold_shell == NULL) { create_cc_credit_hold_shell (cc_main_shell); if(refresh_credit_hold_screen() == FAILURE) { show_busy_cursor (cc_main_shell, False); return; } } else { if(refresh_credit_hold_screen() == FAILURE) { show_busy_cursor (cc_main_shell, False); return; } } XtManageChild (cc_credit_hold_form); XtPopup (cc_credit_hold_shell, XtGrabNone); XMapRaised (XtDisplay(cc_credit_hold_shell), XtWindow(cc_credit_hold_shell)); show_busy_cursor (cc_main_shell, False); } /* end display_credit_hold_review_screen */
void UIDialogFormPopup (Widget widget) { Dimension actionHeight; if (!XtIsManaged (XtNameToWidget (widget,UIDialogBulletinName))) { Widget *children; int numChildren; XtVaGetValues (XtNameToWidget (widget,UIDialogPaneName), XmNchildren, &children, XmNnumChildren, &numChildren, NULL); XtManageChild (XtNameToWidget (widget,UIDialogBulletinName)); while (numChildren-- > 0) if (XmIsTraversable (children [numChildren])) XtVaSetValues (children [numChildren],XmNtraversalOn, false, NULL); XtVaGetValues (XtNameToWidget (widget,UIDialogActionFormName),XmNheight, &actionHeight, NULL); XtVaSetValues (XtNameToWidget (widget,UIDialogActionFormName),XmNpaneMaximum, actionHeight, XmNpaneMinimum, actionHeight, NULL); } XtPopup (widget,XtGrabNone); UILoop (); }
void display_manual_history_screen(Widget w, XtPointer *client_data, XmListCallbackStruct *call_data) { int *position_list; int num_selected; show_busy_cursor (cc_manual_hold_shell, True); if (cc_manual_hist_shell == NULL) { create_cc_manual_hist_shell (cc_manual_hold_shell); set_editable_off(cc_hist_account_id_txt); set_editable_off(cc_hist_amount_txt); set_editable_off(cc_hist_bill_ref_no_txt); } if (XmListGetSelectedPos (cc_manual_hold_list, &position_list,&num_selected)) { selected_manual_hold = position_list[0]; if(refresh_manual_history_screen() == FAILURE) { show_busy_cursor (cc_manual_hold_shell, False); return; } XtManageChild (cc_manual_hist_form); XtPopup (cc_manual_hist_shell, XtGrabNone); cc_manual_hist_shell_up = True; } else post_dialog(cc_manual_hold_shell,XmDIALOG_ERROR, "Please select an item."); show_busy_cursor (cc_manual_hold_shell, False); } /* end display_manual_history_screen */
static void quit_prompt (Widget button, XtPointer client_data, XtPointer call_data) { Widget parent, dialog; Arg args[10]; Position x, y; if (quit_popup == NULL) { parent = XtParent (button); XtTranslateCoords (button, (Position) 0, (Position) 0, &x, &y); XtSetArg (args[0], XtNx, x); XtSetArg (args[1], XtNy, y); quit_popup = XtCreatePopupShell ("prompt", transientShellWidgetClass, parent, args, TWO); XtAddCallback (quit_popup, XtNdestroyCallback, quit_prompt_destroyed, (XtPointer) 0); XtSetArg (args[0], XtNlabel, "quit?"); dialog = XtCreateManagedWidget ("quit", dialogWidgetClass, quit_popup, args, ONE); XawDialogAddButton (dialog, "quit", quit_action, (XtPointer) dialog); XawDialogAddButton (dialog, "abort command", destroy_popup_prompt, (XtPointer) dialog); } confirmAction = quit_action; XtPopup (quit_popup, XtGrabNone); }
void continue_prompt (int interrupt_seen) { Widget dialog; Arg args[10]; Position x, y; char msg[256]; if (continue_popup != NULL) XtDestroyWidget (continue_popup); XtTranslateCoords (breakpointButton, (Position) 0, (Position) 0, &x, &y); XtSetArg (args[0], XtNx, x); XtSetArg (args[1], XtNy, y); continue_popup = XtCreatePopupShell ("prompt", transientShellWidgetClass, breakpointButton, args, TWO); XtAddCallback (continue_popup, XtNdestroyCallback, continue_prompt_destroyed, (XtPointer) 0); if (interrupt_seen) sprintf (msg, "execution interrupt at 0x%08x", PC); else sprintf (msg, "breakpoint encountered at 0x%08x", PC); XtSetArg (args[0], XtNlabel, msg); dialog = XtCreateManagedWidget ("continue", dialogWidgetClass, continue_popup, args, ONE); XawDialogAddButton (dialog, "continue", continue_action, (XtPointer) dialog); XawDialogAddButton (dialog, "abort command", destroy_popup_prompt, (XtPointer) dialog); confirmAction = continue_action; XtPopup (continue_popup, XtGrabNone); }
// MEMBER FUNCTION void fermi_view::notify_page( DPV_pointer page_view, DPV_message msg ) { Widget page_widget; PageViewNode *page_view_node = (PageViewNode *)page_view; if (msg == SHOW_WINDOW) { page_widget = page_view_node->dialog_shell_widget; if (page_widget != NULL ) { XtPopup(page_widget, XtGrabNone); } } else if (msg == RAISE_WINDOW) { page_widget = page_view_node->dialog_shell_widget; if (page_widget != NULL ) { XRaiseWindow( XtDisplay(page_widget), XtWindow(page_widget)); } } else { int i, n_plots; // Propagate the notification to subordinate plots. n_plots = (int)page_view_node->plot_node_list.size(); for (i=0 ; i<n_plots ; i++ ) { PlotViewNode *plot_view_node; plot_view_node = page_view_node->plot_node_list[i]; notify_plot( (DPV_pointer)plot_view_node, msg ); } } }
void fontpane_popup(int *psfont_adr, int *latexfont_adr, int *psflag_adr, void (*showfont_fn) (/* ??? */), Widget show_widget) { DeclareArgs(2); Position xposn, yposn; Widget widg; font_ps_sel = psfont_adr; font_latex_sel = latexfont_adr; flag_sel = psflag_adr; font_setimage = showfont_fn; font_widget = show_widget; if (first_fontmenu) { first_fontmenu = False; /* don't reposition it if user has already popped it */ XtTranslateCoords(tool, CANVAS_WD/4, CANVAS_HT/4, &xposn, &yposn); FirstArg(XtNx, xposn); /* position about 1/4 from upper-left corner of canvas */ NextArg(XtNy, yposn); SetValues(ps_fontmenu); SetValues(latex_fontmenu); } widg = *flag_sel ? ps_fontmenu : latex_fontmenu; XtPopup(widg, XtGrabExclusive); /* if the file message window is up add it to the grab */ file_msg_add_grab(); /* insure that the most recent colormap is installed */ set_cmap(XtWindow(widg)); XSetWMProtocols(tool_d, XtWindow(widg), &wm_delete_window, 1); }
void manage_and_raise(Widget w) { if (w != 0) { // If top-level shell is withdrawn or iconic, realize dialog as icon bool iconic = false; Widget shell = find_shell(w); if (shell != 0) { XWindowAttributes attr; iconic = (!XtIsRealized(shell) || XGetWindowAttributes(XtDisplay(shell), XtWindow(shell), &attr) && attr.map_state != IsViewable); if (iconic) XtVaSetValues(w, XmNinitialState, IconicState, XtPointer(0)); } XtManageChild(w); shell = w; while (shell != 0 && !XtIsShell(shell)) shell = XtParent(shell); if (shell != 0 && !XmIsDialogShell(shell)) { if (!XtIsRealized(shell)) XtRealizeWidget(shell); XtPopup(shell, XtGrabNone); } raise_shell(w); } }
void pp_add_package_cb(Widget w, XtPointer *call_data, XmAnyCallbackStruct *client_data) { char *today = NULL; /* create screen */ if (pp_provision_shell == NULL) { create_pp_provision_shell (product_packages_shell); create_ppp_confirm_shell (pp_provision_shell); XtAddEventHandler(ppp_start_date_txt,KeyPressMask,False, check_date,NULL); } /* erase the list */ XmListDeleteAllItems (ppp_prov_list); XmListDeselectAllItems(ppp_prov_list); gprov_new_package = 0; today = get_todays_date(); XmTextSetString (ppp_start_date_txt, today); XtFree (today); XmTextSetString (ppp_packageid_txt,""); /* display screen */ XtManageChild (pp_provision_form); XtPopup (pp_provision_shell, XtGrabNone); }
void BindResidualProg() { char tmpstr[TEMPSTRINGLEN]; Cardinal n = 0; static Arg dialogArgs [] = { {XtNlabel, (XtArgVal) ""}, {XtNvalue, (XtArgVal) ""} }; if (exitFlag == True) StartSimilix(); if (shellFlag == True) XtDestroyWidget(dialogShell); dialogShell = CreateShell(); n = 0; XtSetArg(dialogArgs[n], XtNlabel, "Bind residual program --- Input the name of bound variable:"); n++; XtSetArg(dialogArgs[n], XtNvalue, VARNAME); n++; dialog[15] = XtCreateManagedWidget("Var15", dialogWidgetClass, dialogShell, dialogArgs, XtNumber(dialogArgs)); XtVaSetValues(dialog[15], XtNfont, font1Struct, NULL); XawDialogAddButton(dialog[15], "OK", BindResProgOK, NULL); XawDialogAddButton(dialog[15], "Cancel", BindResProgCancel, NULL); XtPopup(dialogShell, XtGrabNone); shellFlag = True; }
void pushed(Widget pb, XtPointer foo, XtPointer bar) { static Widget dialog; XmString t = XmStringCreateSimple("Enter New Button Name:"); extern void read_name(Widget, XtPointer, XtPointer); extern void toggle_callback(Widget, XtPointer, XtPointer); Arg args[3]; XtSetArg(args[0], XmNselectionLabelString, t); XtSetArg(args[1], XmNautoUnmanage, False); XtSetArg(args[2], XmNuserData, 0); dialog = XmCreatePromptDialog(XtParent(pb), "notice", args, 3); XmStringFree(t); XtAddCallback(dialog, XmNokCallback, read_name, NULL); XtAddCallback(dialog, XmNcancelCallback, (XtCallbackProc)XtDestroyWidget, NULL); XtUnmanageChild(XmSelectionBoxGetChild(dialog, XmDIALOG_HELP_BUTTON)); { XmString btn1 = XmStringCreateSimple("Change Name"); XmString btn2 = XmStringCreateSimple("Change Color"); Widget toggle_box = XmVaCreateSimpleRadioBox(dialog, "radio_box", 0, toggle_callback, XmVaRADIOBUTTON, btn1, 0, NULL, NULL, XmVaRADIOBUTTON, btn2, 0, NULL, NULL, NULL); XtManageChild(toggle_box); } XtManageChild(dialog); XtPopup(XtParent(dialog), XtGrabNone); }
void pp_display_filter_acct_cb(Widget w, XtPointer *call_data, XmAnyCallbackStruct *client_data) { int i; XmString temp; if (pp_main_poplist_shell == NULL) { create_pp_main_poplist_shell(product_packages_shell); } XmListDeleteAllItems (pp_main_poplist); XmListDeselectAllItems (pp_main_poplist); for (i = 0; i < num_pp_ext_ids_list; i++) { temp = XmStringCreateSimple (pp_ext_ids_list[i].description); XmListAddItem (pp_main_poplist, temp, 0); XmStringFree (temp); } /* Set the text field that will be populated when user selects * a value from the list. */ XtVaSetValues (pp_main_poplist, XmNuserData, pp_filter_account_no_txt, NULL); position_poplist (w,pp_main_poplist_shell); XtManageChild (pp_main_poplist_form); XtPopup (pp_main_poplist_shell, XtGrabNone); }
void HelpCB ( Widget parent ) { char *file, *dpath; int verbose; /* * Callback to popup HTML dialog. */ verbose = GetVerboseLevel(); if( verbose > VERBOSE_0 ) printf ("HelpCB\n"); dpath = GetConfigValue ("GarpHTML"); file = builddirpath ( dpath, home_html ); /* * Initialize hypertext file list. */ historyList = ListCreate(); if ( file ) ListAddEntry ( historyList, strdup(file) ); /* * Popup HTML dialog. */ XtManageChild ( help.dialog ); XtPopup ( XtParent ( help.dialog ), XtGrabNone); Free ( dpath ); Free ( file ); }
/*----------------------------------------------------------------------*/ int main(int argc,char *argv[]) { Widget form; Widget frame; Widget tb; Cardinal i; XfeAppCreateSimple("ToolBoxTest",&argc,argv,"MainFrame",&frame,&form); tb = XfeCreateLoadedToolBox(form,"ToolBox",NULL,0); for (i = 0; i < NUM_TOOLS; i++) { tool_widgets[i] = create_tool_item(tb, tool_names[i], tool_heights[i]); } XtPopup(frame,XtGrabNone); XfeAppMainLoop(); return 0; }
int MwAlertBox(Widget pw, char *text, char *buttons[], int nbuttons) { Widget topbox, buttonbox, label, command; int i; XtAppContext app_context = XtWidgetToApplicationContext(pw); alert = XtVaCreatePopupShell("alert", transientShellWidgetClass, pw, XtNtitle, _("Alert"), (char *)0); topbox = XtVaCreateManagedWidget("topbox", boxWidgetClass, alert, (char *)0); label = XtVaCreateManagedWidget("label", labelWidgetClass, topbox, (char *)0); MwLabelSet(label, text); buttonbox = XtVaCreateManagedWidget("buttonbox", boxWidgetClass, topbox, (char *)0); for (i = 0; i < nbuttons; i++) { command = add_button(buttonbox, "command", buttons[i], alert_clicked, (XtPointer)i); } status = MW_WAITING; MwCenter(alert); XtPopup(alert, XtGrabNonexclusive); wm_del(alert); while (status == MW_WAITING) { XEvent event_return; XtAppNextEvent(app_context, &event_return); XtDispatchEvent(&event_return); } XtDestroyWidget(alert); return status; }
/* button callbacks */ void PosFileButCB (Widget w, XtPointer clientData, XtPointer callData) /* File button hit - get info from a file */ { ImageDisplay *IDdata; XmString wierdstring; Arg wargs[5]; IDdata = (ImageDisplay *)clientData; mark.posfilebox = (Widget) XmCreateFileSelectionDialog (w, "filebox", NULL, 0); XtAddCallback (mark.posfilebox, XmNokCallback, PosFileOKCB, clientData); XtAddCallback (mark.posfilebox, XmNcancelCallback, PosFileCancelCB, clientData); /* set directory if it is defined */ if (mark_dir) { wierdstring = XmStringCreateSimple (mark_dir->sp); XtSetArg (wargs[0], XmNdirectory, wierdstring); XtSetValues (mark.posfilebox, wargs, 1); XmStringFree(wierdstring); } /* Shazam appear: */ XtManageChild (mark.posfilebox); XtPopup (XtParent (mark.posfilebox), XtGrabNone); /* all the action is in the callback routine */ /* XtDestroyWidget (mark.dialog); */ /* PositionBoxActive = 0; mark as inactive */ } /* end PosFileButCB */
/**************************************************************** ... *****************************************************************/ static void spy_steal_popup(Widget w, XtPointer client_data, XtPointer call_data) { struct city *pvcity = game_city_by_number(diplomat_target_id); struct player *pvictim = NULL; if(pvcity) pvictim = city_owner(pvcity); /* it is concievable that pvcity will not be found, because something has happened to the city during latency. Therefore we must initialize pvictim to NULL and account for !pvictim in create_advances_list. -- Syela */ destroy_message_dialog(w); diplomat_dialog = NULL; if(!spy_tech_shell){ Position x, y; Dimension width, height; spy_tech_shell_is_modal=1; create_advances_list(client.conn.playing, pvictim, spy_tech_shell_is_modal); XtVaGetValues(toplevel, XtNwidth, &width, XtNheight, &height, NULL); XtTranslateCoords(toplevel, (Position) width/10, (Position) height/10, &x, &y); XtVaSetValues(spy_tech_shell, XtNx, x, XtNy, y, NULL); XtPopup(spy_tech_shell, XtGrabNone); } }
/* This makes sure the submenu is fully visible. */ static void position_submenu(Widget w, Widget parent) { Position parent_x, parent_y, my_x, my_y; Dimension parent_width, my_width, my_height; int foo; unsigned int root_width, root_height, ufoo; Window foowin; /* Make sure the widget is realized--otherwise, we get 0 as width and height. */ XtRealizeWidget(w); XtVaGetValues(parent, XtNx, &parent_x, XtNy, &parent_y, XtNwidth, &parent_width, NULL); XtVaGetValues(w, XtNwidth, &my_width, XtNheight, &my_height, NULL); XtTranslateCoords(XtParent(parent), parent_x, parent_y, &parent_x, &parent_y); my_x = parent_x + parent_width - 2; my_y = parent_y + 1; XGetGeometry(my_display, RootWindow(my_display, my_screen), &foowin, &foo, &foo, &root_width, &root_height, &ufoo, &ufoo); if (my_x + my_width > (int)root_width) { my_x -= my_width + parent_width - 2; } if (my_y + my_height > (int) root_height) { my_y = root_height - my_height; } XtVaSetValues(w, XtNx, my_x, XtNy, my_y, NULL); XtPopup(w, XtGrabNonexclusive); }
void XmdsRaiseWindow(Widget w) { Widget shell; for (shell = w; shell && !XtIsShell(shell); shell = XtParent(shell)); if (shell) XtPopup(shell,XtGrabNone); }
void PopupCallback( Widget w, XtPointer client_data, XtPointer call_data) { Widget widget; Widget *children; int numChildren; if( w || call_data ) { /* to satisfy IRIX646 compiler */ } widget = (Widget) client_data; if( XtIsShell( widget ) ) { XtVaGetValues(widget, XtNchildren, &children, XtNnumChildren, &numChildren, NULL); if( numChildren ) { XtManageChild(*children); XtMapWidget(*children); } XtPopup( widget, XtGrabNone ); } }
void ShowResidualProg() { char tmpstr[TEMPSTRINGLEN]; static Arg arglist [] = { {XtNlabel, (XtArgVal) ""}, {XtNvalue, (XtArgVal) ""}, }; Cardinal n = 0; if (exitFlag == True) StartSimilix(); if (shellFlag == True) XtDestroyWidget(dialogShell); dialogShell = CreateShell(); n = 0; XtSetArg(arglist[n], XtNlabel, "Show residual program --- Input the name of residual program:"); n++; XtSetArg(arglist[n], XtNvalue, RESNAME); n++; dialog[11] = XtCreateManagedWidget("Res11", dialogWidgetClass, dialogShell, arglist, XtNumber(arglist)); XtVaSetValues(dialog[11], XtNfont, font1Struct, NULL); XawDialogAddButton(dialog[11], "OK", ShowResProgOK, NULL); XawDialogAddButton(dialog[11], "Cancel", ShowResProgCancel, NULL); XawDialogAddButton(dialog[11], "Help", ShowResProgHelp, NULL); XtPopup(dialogShell, XtGrabNone); shellFlag = True; }
/***** * Name: drawBalloonSquared * Return Type: void * Description: pops up the balloon widget as a simple square * In: * w: XmBalloon Widget id; * x: absolute x popup position; * y: absolute y popup position; * width: desired widget width; * Returns: * nothing *****/ static void drawBalloonSquared(Widget w, Position x, Position y, int width) { XmBalloonWidget balloon = (XmBalloonWidget)w; Display *dpy = XtDisplay(w); /* resize to fit */ XtResizeWidget((Widget)balloon, 2*ATTR(margin_width) + width, 2*ATTR(margin_height) + ATTR(font_height), balloon->core.border_width); /* move to correct location */ XtMoveWidget(w, x + ATTR(left_offset), y + ATTR(top_offset)); /***** * pop it up. * Note that the label can change when the widget is already popped. *****/ if(!ATTR(popped)) XtPopup((Widget)balloon, XtGrabNone); ATTR(popped) = True; /* do a FillRect to clear current label */ XSetForeground(dpy, ATTR(gc), balloon->core.background_pixel); XFillRectangle(dpy, XtWindow((Widget)balloon), ATTR(gc), 0, 0, balloon->core.width, balloon->core.height); XSetForeground(dpy, ATTR(gc), ATTR(foreground)); /* draw the text in the window */ drawText(dpy, balloon, XtWindow((Widget)balloon), ATTR(gc), 0, 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); }
void RtTraceMotif::pop() { XtPopup( toplevel, XtGrabNone); /* XtUnmapWidget( tractx->toplevel); XtMapWidget( tractx->toplevel); */ }
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); }
/************************************************************************** Popup a dialog to display information about an event that has a specific location. The user should be given the option to goto that location. **************************************************************************/ void popup_notify_goto_dialog(const char *headline, const char *lines, const struct text_tag_list *tags, struct tile *ptile) { Widget notify_dialog_shell, notify_form, notify_command, notify_goto_command; Widget notify_headline, notify_label; Dimension width, width2, width_1, width_2; if (!ptile) { popup_notify_dialog("Message:", headline, lines); return; } notify_dialog_shell = XtCreatePopupShell("Message:", transientShellWidgetClass, toplevel, NULL, 0); notify_form = XtVaCreateManagedWidget("notifyform", formWidgetClass, notify_dialog_shell, NULL); notify_headline=XtVaCreateManagedWidget("notifyheadline", labelWidgetClass, notify_form, XtNlabel, headline, NULL); notify_label=XtVaCreateManagedWidget("notifylabel", labelWidgetClass, notify_form, XtNlabel, lines, NULL); notify_command = I_L(XtVaCreateManagedWidget("notifycommand", commandWidgetClass, notify_form, NULL)); notify_goto_command = I_L(XtVaCreateManagedWidget("notifygotocommand", commandWidgetClass, notify_form, NULL)); XtVaGetValues(notify_label, XtNwidth, &width, NULL); XtVaGetValues(notify_headline, XtNwidth, &width2, NULL); XtVaGetValues(notify_command, XtNwidth, &width_1, NULL); XtVaGetValues(notify_goto_command, XtNwidth, &width_2, NULL); if (width_1 + width_2 > width) width = width_1 + width_2; if(width>width2) XtVaSetValues(notify_headline, XtNwidth, width, NULL); XtAddCallback(notify_command, XtNcallback, notify_no_goto_command_callback, NULL); XtAddCallback(notify_goto_command, XtNcallback, notify_goto_command_callback, NULL); notify_goto_add_widget_tile(notify_goto_command, ptile); xaw_set_relative_position(toplevel, notify_dialog_shell, 25, 5); XtPopup(notify_dialog_shell, XtGrabNone); /* XtSetSensitive(toplevel, FALSE); */ }