GraphMotif::GraphMotif( void *xn_parent_ctx, Widget xn_parent_wid, const char *xn_name, Widget *w, pwr_tStatus *status, const char *xn_default_path, graph_eMode graph_mode, int scrollbar, int xn_gdh_init_done, const char *xn_object_name, int xn_use_default_access, unsigned int xn_default_access, unsigned int xn_options) : Graph( xn_parent_ctx, xn_name, xn_default_path, graph_mode, xn_gdh_init_done, xn_object_name, xn_use_default_access, xn_default_access, xn_options), parent_wid(xn_parent_wid) { default_access = xn_default_access; if ( scrollbar) form_widget = ScrolledGrowCreate( parent_wid, name, NULL, 0, graph_init_grow_base_cb, this, (Widget *)&grow_widget); else grow_widget = form_widget = GrowCreate( parent_wid, name, NULL, 0, graph_init_grow_base_cb, this); XtManageChild( form_widget); // Create the root item *w = form_widget; gbl.load_config( this); *status = 1; }
extern "C" Widget ScrolledGrowCreate( Widget parent, char *name, ArgList args, int argCount, int (*init_proc)(GlowCtx *ctx, void *client_data), void *client_data, Widget *grow_w ) { Widget form, scroll_h, scroll_v; GrowWidget grow; Arg arg[20]; int i; int scroll_width = 15; form = XtCreateWidget( name, xmFormWidgetClass, parent, args, argCount); i = 0; XtSetArg( arg[i], XmNorientation, XmHORIZONTAL); i++; XtSetArg( arg[i], XmNrightAttachment, XmATTACH_FORM);i++; XtSetArg( arg[i], XmNleftAttachment, XmATTACH_FORM);i++; XtSetArg( arg[i], XmNbottomAttachment, XmATTACH_FORM);i++; XtSetArg( arg[i], XmNheight, scroll_width);i++; XtSetArg( arg[i], XmNrightOffset, scroll_width);i++; scroll_h = XtCreateWidget( "scroll_horizontal", xmScrollBarWidgetClass, form, arg, i); XtManageChild( scroll_h); i = 0; XtSetArg( arg[i], XmNorientation, XmVERTICAL); i++; XtSetArg( arg[i], XmNtopAttachment, XmATTACH_FORM);i++; XtSetArg( arg[i], XmNrightAttachment, XmATTACH_FORM);i++; XtSetArg( arg[i], XmNbottomAttachment, XmATTACH_FORM);i++; XtSetArg( arg[i], XmNwidth, scroll_width);i++; XtSetArg( arg[i], XmNbottomOffset, scroll_width);i++; scroll_v = XtCreateWidget( "scroll_vertical", xmScrollBarWidgetClass, form, arg, i); XtManageChild( scroll_v); i = 0; XtSetArg( arg[i], XmNtopAttachment, XmATTACH_FORM);i++; XtSetArg( arg[i], XmNleftAttachment, XmATTACH_FORM);i++; XtSetArg( arg[i], XmNbottomAttachment, XmATTACH_WIDGET);i++; XtSetArg( arg[i], XmNbottomWidget, scroll_h);i++; XtSetArg( arg[i], XmNrightAttachment, XmATTACH_WIDGET);i++; XtSetArg( arg[i], XmNrightWidget, scroll_v);i++; /* XtSetArg( arg[i], XmNbottomAttachment, XmATTACH_FORM);i++; XtSetArg( arg[i], XmNrightAttachment, XmATTACH_FORM);i++; */ grow = (GrowWidget) GrowCreate( form, (char*) "grow", arg, i, init_proc, client_data); XtManageChild( (Widget) grow); grow->grow.scroll_h = scroll_h; grow->grow.scroll_v = scroll_v; grow->grow.form = form; *grow_w = (Widget) grow; return (Widget) form; }
GeCurveMotif::GeCurveMotif( void *gc_parent_ctx, Widget parent_widget, char *curve_name, char *filename, GeCurveData *curve_data, int pos_right) : GeCurve( gc_parent_ctx, curve_name, filename, curve_data, pos_right) { char uid_filename[120] = {"xtt_curve.uid"}; char *uid_filename_p = uid_filename; Arg args[20]; pwr_tStatus sts; int i; MrmHierarchy s_DRMh; MrmType dclass; Widget ge_curve_widget; char name[] = "PwR GeCurve"; static MrmRegisterArg reglist[] = { {(char*) "gec_ctx", 0 }, {(char*) "gec_activate_exit",(caddr_t)activate_exit }, {(char*) "gec_activate_configure",(caddr_t)activate_configure }, {(char*) "gec_activate_print",(caddr_t)activate_print }, {(char*) "gec_activate_zoomin",(caddr_t)activate_zoomin }, {(char*) "gec_activate_zoomout",(caddr_t)activate_zoomout }, {(char*) "gec_activate_zoomreset",(caddr_t)activate_zoomreset }, {(char*) "gec_activate_background",(caddr_t)activate_background }, {(char*) "gec_activate_showname",(caddr_t)activate_showname }, {(char*) "gec_activate_filledcurves",(caddr_t)activate_filledcurves }, {(char*) "gec_activate_xlimits",(caddr_t)activate_xlimits }, {(char*) "gec_activate_help",(caddr_t)activate_help }, {(char*) "gec_create_pane",(caddr_t)create_pane }, {(char*) "gec_create_growform",(caddr_t)create_growform }, {(char*) "gec_create_nameform",(caddr_t)create_nameform }, {(char*) "gec_create_curveform",(caddr_t)create_curveform }, {(char*) "gec_create_minmax_textmin",(caddr_t)create_minmax_textmin }, {(char*) "gec_create_minmax_textmax",(caddr_t)create_minmax_textmax }, {(char*) "gec_activate_minmax_ok",(caddr_t)activate_minmax_ok } }; static int reglist_num = (sizeof reglist / sizeof reglist[0]); Lng::get_uid( uid_filename, uid_filename); // Motif MrmInitialize(); cdh_StrncpyCutOff( title, curve_name, sizeof(title), 1); reglist[0].value = (caddr_t) this; toplevel = XtCreatePopupShell(title, topLevelShellWidgetClass, parent_widget, args, 0); // Save the context structure in the widget XtSetArg (args[0], XmNuserData, (XtPointer) this); sts = MrmOpenHierarchy( 1, &uid_filename_p, NULL, &s_DRMh); if (sts != MrmSUCCESS) printf("can't open %s\n", uid_filename); MrmRegisterNames(reglist, reglist_num); sts = MrmFetchWidgetOverride( s_DRMh, (char*) "ge_curve_window", toplevel, name, NULL, 0, &ge_curve_widget, &dclass); if (sts != MrmSUCCESS) printf("can't fetch %s\n", name); sts = MrmFetchWidget(s_DRMh, (char*) "minmax_dialog", toplevel, &minmax_widget, &dclass); if (sts != MrmSUCCESS) printf("can't fetch input dialog\n"); MrmCloseHierarchy(s_DRMh); i = 0; XtSetArg(args[i],XmNwidth,800);i++; XtSetArg(args[i],XmNheight,600);i++; XtSetArg(args[i], XmNdeleteResponse, XmDO_NOTHING);i++; XtSetValues( toplevel ,args,i); XtManageChild( ge_curve_widget); Widget w; grownames_main_widget = ScrolledGrowCreate( nameform_widget, (char*) "GeCurveNames", NULL, 0, init_grownames_cb, this, &w); i = 0; XtSetArg(args[i],XmNwidth,200);i++; XtSetValues( grownames_main_widget, args,i); XtManageChild( grownames_main_widget); growaxis_main_widget = GrowCreate( axisform_widget, (char*) "GeCurveAxis", NULL, 0, init_growaxis_cb, this); i = 0; XtSetArg(args[i],XmNwidth,200);i++; XtSetValues( growaxis_main_widget, args,i); XtManageChild( growaxis_main_widget); growcurve_main_widget = CurveCreate( curveform_widget, (char*) "GeCurve", NULL, 0, init_growcurve_cb, this); XtManageChild( growcurve_main_widget); i = 0; XtSetArg(args[i],XmNwidth,200);i++; XtSetArg(args[i],XmNheight,200);i++; XtSetArg(args[i],XmNpaneMinimum,75);i++; XtSetArg(args[i],XmNpaneMaximum,100);i++; nav_widget = CurveCreateNav( pane_widget, (char*) "navigator", args, i, growcurve_main_widget); XtManageChild( nav_widget); XtPopup( toplevel, XtGrabNone); XtRealizeWidget( toplevel); wow = new CoWowMotif( toplevel); // Connect the window manager close-button to exit flow_AddCloseVMProtocolCb( toplevel, (XtCallbackProc)activate_exit, this); }