Example #1
0
static void 
InitPanedWindow (Widget w, XtPointer client_data, XtPointer call_data) 
{
    Widget child_w[2], sub_pane, temp, form, frame;

    child_w[0] = XtVaCreateWidget("Arrow1", xmArrowButtonWidgetClass,
				  w, NULL);
    sub_pane = child_w[1] = XtVaCreateWidget("SubPane", 
					     xmPanedWindowWidgetClass,
					     w, NULL);
    XtManageChildren(child_w, 2);

    child_w[0] = XtVaCreateWidget("Arrow2", xmArrowButtonWidgetClass,
				  sub_pane, NULL);
    temp = child_w[1] = XtVaCreateWidget("Temp", xmMessageBoxWidgetClass,
					 sub_pane, NULL);
    XtRealizeWidget(temp);
    XtManageChildren(child_w, 2);

    form = XtVaCreateManagedWidget("Form", xmFormWidgetClass,
				   temp, NULL);

    frame = child_w[0] = XtVaCreateWidget("Frame", xmFrameWidgetClass,
					  form, NULL);
    child_w[1] = XtVaCreateWidget("TextF", xmTextFieldWidgetClass,
				  form, NULL);
    XtManageChildren(child_w, 2);
    XtAddCallback (temp, XmNokCallback, OKCB, (XtPointer)child_w[1]);

    child_w[0] = XtVaCreateWidget("Title", xmLabelGadgetClass,
				  frame, NULL);
    child_w[1] = XtVaCreateWidget("Label", xmLabelWidgetClass,
				  frame, NULL);
    XtManageChildren(child_w, 2);
}
Example #2
0
	int main(int argc, char *argv[])
	{
		int i, n;
		Arg args[10];
		char buf[80];
		XtAppContext app;
		Widget toplevel, notebook, page[6], label[6], frame[6], text[6];

		setlocale(LC_ALL, "");

		//建立顶级窗口
		toplevel = XtVaAppInitialize(&app, "Notebook", NULL, 0,
			&argc, argv, NULL, NULL);

		//建立Notebook
		n = 0;
		XtSetArg(args[n], XmNwidth, 600 ); 			n++;
		XtSetArg(args[n], XmNheight, 400 ); 			n++;
		XtSetArg(args[n], XmNfirstPageNumber, 1); 		n++;
		XtSetArg(args[n], XmNlastPageNumber, 6); 		n++;

		notebook  = XmCreateNotebook(toplevel, "notebook", args, n);
		XtManageChild(notebook);

		//建立页面
		for(i=0; i<6; i++){
			n = 0;
			sprintf(buf, "页面 %d", i + 1);
			label[i] = XmCreateLabel(notebook, buf, args, n);
			page[i] = XmCreatePushButton(notebook, buf, args, n);
		}
		XtManageChildren(label, 6);
		XtManageChildren(page, 6);

		for(i=0; i<6; i++){
			XtSetArg(args[n], XmNpageNumber, i + 1); n++;
			text[i] = XmCreateScrolledText(notebook, buf, args, n);
			XtManageChild(text[i]);
		}


		//显示窗口
		XtRealizeWidget(toplevel);

		//进入事件循环
		XtAppMainLoop(app);

	}
Example #3
0
void
WComposite :: ManageChildren (void) const
{
	CompositeWidget cw = (CompositeWidget)widget;

	XtManageChildren(cw->composite.children, cw->composite.num_children);
}
Example #4
0
static void 
SetImsToggleList(I18nEnv *env)
{
    Cardinal n,i;
    XmString string;
    Widget *im_tog = NULL;
    Arg args[5];
    Boolean found = FALSE;
    Cardinal default_index = 0;

    /* create new toggles */

    if (env->ims_sel->ims_list_size > 0)
	im_tog = (Widget*)XtMalloc(sizeof(Widget) 
				   * env->ims_sel->ims_list_size);


    for (i=0; i< env->ims_sel->ims_list_size; i++) {
	string = XmStringCreateLocalized(env->ims_sel->ims_list[i].im_label);
	n = 0;
	XtSetArg(args[n], XmNlabelString, string); n++;
	XtSetArg(args[n], XmNsensitive, 
		 !(env->ims_sel->ims_list[i].inactive)); n++;
	XtSetArg(args[n], XmNuserData, 
		 env->ims_sel->ims_list[i].im_name); n++;

	/* Need to default to the file_sel->im_name, if in the list */
	if (strcmp(env->file_sel->im_name, 
		   env->ims_sel->ims_list[i].im_name) == 0) {
	    found = TRUE;
	    XtSetArg(args[n], XmNset, True); n++;
	}

	if (env->ims_sel->ims_list[i].im_default) {
	    default_index = i;
	}

	im_tog[i] = XmCreateToggleButtonGadget(i18n.inputMethodRC, 
					       "IM", args, n);
	XmStringFree(string);
    }

    if (env->ims_sel->ims_list_size > 0)
	XtManageChildren(im_tog, env->ims_sel->ims_list_size);

    /* If we provided toggle buttons, but the file_sel->im_name was not 
       found, default it to the default from the locale file. */

    if (im_tog && !found) {
	n = 0;
	XtSetArg(args[n], XmNset, True); n++;
	XtSetValues(im_tog[default_index], args, n);
    }

    if (im_tog)
	XtFree((char *) im_tog);

    _DtTurnOffHourGlass(i18n.inputMethodTB);
}
Example #5
0
/* -------------------------------------------------------------------- */
static void CreatePreferences()
{
  int		i;
  Cardinal	n;
  Arg		args[2];
  Widget	frame, RC, plRC, label, b[3];

  PreferShell = XtCreatePopupShell("prefParmsShell",
                   topLevelShellWidgetClass, AppShell, NULL, 0);

  PreferWindow = XmCreateRowColumn(PreferShell, (char *)"prefRC", NULL, 0);

  n = 0;
  frame = XmCreateFrame(PreferWindow, (char *)"prefFrame", args, n);
  XtManageChild(frame);

  n = 0;
  RC = XmCreateRowColumn(frame, (char *)"prefRC", args, n);

  for (i = 0; i < TOTAL_PREFERS; ++i)
    {
    plRC = XmCreateRowColumn(RC, (char *)"plRC", args, n);
    XtManageChild(plRC);

    sprintf(buffer, "prefer%d", i);
    label = XmCreateLabel(plRC, buffer, args, n);
    XtManageChild(label);

    prefText[i] = XmCreateTextField(plRC, (char *)"prefText", args, n);
    XtManageChild(prefText[i]);
    XtAddCallback(prefText[i], XmNlosingFocusCallback, ApplyPreferences, NULL);
    }


  /* Command buttons.
   */
  n = 0;
  frame = XmCreateFrame(PreferWindow, (char *)"buttonFrame", args, 0);
  XtManageChild(frame);

  n = 0;
  plRC = XmCreateForm(frame, (char *)"buttonRC", args, n);

  n = 0;
  b[0] = XmCreatePushButton(plRC, (char *)"dismissButton", args, n);
  XtAddCallback(b[0], XmNactivateCallback, DismissWindow, PreferWindow);

  n = 0;
  b[1] = XmCreatePushButton(plRC, (char *)"saveButton", args, n);
  XtAddCallback(b[1], XmNactivateCallback, SavePreferences, NULL);

  XtManageChildren(b, 2);

  XtManageChild(plRC);
  XtManageChild(RC);

}	/* END CREATEPREFERENCES */
Example #6
0
void NxmColorbarReset ( int type )
/************************************************************************
 * NxmColorBarReset                                                     *
 *                                                                      *
 * This function resets the display of the color bar. Different title   *
 * string will be displayed based on the input parameter.               *
 *                                                                      *
 * void NxmColorBarReset( type )                                        *
 *                                                                      *
 * Input parameters:                                                    *
 *  type            int   0 --- title string = "Active Colors:"         *
 *                        1 --- title string = "Colors:"                *
 *                                                                      *
 * Output parameters:                                                   *
 *                      NULL                                            *
 *                                                                      *
 * Return parameters:                                                   *
 *                      NULL                                            *
 *                                                                      *
 **                                                                     *
 * Log:                                                                 *
 * C. Lin/EAI       	05/94                                           *
 * E. Safford/GSC	01/99	clean up				*
 * S. Law/GSC		07/00	added XmStringFree calls		*
 ***********************************************************************/
{
    XmString	xmstr;
/*---------------------------------------------------------------------*/

    if (type == 0) {
	xmstr = XmStringCreateLocalized("Active Colors:");
        XtVaSetValues( _activeColLabel, 
		       XmNlabelString, xmstr,
		       NULL);
	XmStringFree (xmstr);

	if ( NXMcolrCells != NULL ) {
	    XtUnmanageChildren( NXMcolrCells, NXMtotalEditColor );
	    XtManageChild( NXMcolrCells[0]);
	}
    }
    else {
	xmstr = XmStringCreateLocalized("Colors:");
        XtVaSetValues( _activeColLabel, 
		       XmNlabelString, xmstr,
		       NULL);
	XmStringFree (xmstr);

	if ( NXMcolrCells != NULL ) {
	    XtManageChildren( NXMcolrCells, NXMtotalEditColor );
	}
    }
}
Example #7
0
void CtrlBox(int argc,  char **argv) {
	XtAppContext app;
       	Widget 	toplevel, box, temp;
       	Widget   buttons[10];
       	int  	nbuttons;
        char*	exitPoint = names[EXIT_PROGRAM];
	if (argc > 1) {
		argv[0] = "Remote";
		if (argc > 2) exitPoint = "Back to PC desktop    ";
	}
	else argv[0] = "Local";
       	argc = 1;

       	toplevel =  XtVaAppInitialize(&app,"CtrlBox",NULL, 0, &argc, argv, NULL, NULL);

       	box = XtVaCreateManagedWidget("box",xmRowColumnWidgetClass, toplevel, NULL);

       	nbuttons = 0;
       	while(names[nbuttons] != 0) {
		if (nbuttons == EXIT_PROGRAM )
		buttons[nbuttons] = XtVaCreateManagedWidget(exitPoint,
                        xmPushButtonWidgetClass, box, NULL, 0);
		else
		buttons[nbuttons] = XtVaCreateManagedWidget(names[nbuttons],
			xmPushButtonWidgetClass, box, NULL, 0);
		XtAddCallback(buttons[nbuttons],XmNactivateCallback, callback,
			&values[nbuttons]);
	    nbuttons++;
	}

	// Create a popup error message dialog; no cancel, no help button 
	errorDialog = XmCreateErrorDialog(box, "errorDialog", NULL, 0);
	temp = XmMessageBoxGetChild(errorDialog, XmDIALOG_CANCEL_BUTTON);
	XtUnmanageChild(temp);
	temp = XmMessageBoxGetChild(errorDialog, XmDIALOG_HELP_BUTTON);
	XtUnmanageChild(temp);

	// Create a popup dialog to get the filename; no help button 
	fileDialog = XmCreateFileSelectionDialog(box, "fileDialog", NULL, 0);
	XtVaSetValues(fileDialog, XmNwidth, 400, NULL);
  	temp = XmFileSelectionBoxGetChild(fileDialog, XmDIALOG_HELP_BUTTON);
  	XtUnmanageChild(temp);

  	XtAddCallback(fileDialog, XmNokCallback, OpenFile, NULL);
	XtAddCallback(fileDialog, XmNcancelCallback, Cancel, NULL);

	XtManageChildren(buttons,nbuttons);
	XtRealizeWidget(toplevel);
        XMoveWindow (XtDisplay(toplevel), XtWindow(toplevel), 0, 0);
	XWarpPointer(XtDisplay(box), None, XtWindow(box), 0, 0, 0, 0, 400, 300);
	XtAppMainLoop(app);
}
Example #8
0
static void 
InitContainerOutline (Widget w, XtPointer client_data, XtPointer call_data) 
{
    Widget container, *icongs; 
    Cardinal i ;

    /* get the number of classes in Xt/Motif */
    i = InitClassArray() ;

    /* allocate space for the array of icongadgets to be managed
       at once */
    icongs = (Widget*) XtMalloc(i * sizeof(Widget));

    XtAddCallback (w, XmNtraverseObscuredCallback, TravCB, NULL);

    /* create the container */
    container = XtVaCreateManagedWidget("ContainerOutline",
					xmContainerWidgetClass, w,
					NULL);

    /* setup our clipwindow/workwindow constraint stuff */
    XmdSWAdjustView (w) ;

    /* create the root */
    icongs[0] = XtVaCreateWidget(
		                 ClassName(icong_array[0]->class_info.w_class),
				 xmIconGadgetClass, container,
				 XmNentryParent, NULL,
				 XmNsensitive, 
				 icong_array[0]->class_info.documented,
				 XmNuserData, 
				 &(icong_array[0]->class_info),
				 NULL);
    i = 1 ;
    while (icong_array[i]) {
	/* parent_index has been set during InitClassArray */
	icongs[i] = XtVaCreateWidget(
				ClassName(icong_array[i]->class_info.w_class),
				   xmIconGadgetClass, container,
				   XmNentryParent, 
				      icongs[icong_array[i]->parent_index],
				   XmNsensitive, 
				      icong_array[i]->class_info.documented,
				   XmNuserData, 
				       &(icong_array[i]->class_info),
				   NULL);
	i++ ;
    }

    XtManageChildren(icongs, i);
	 
}
Example #9
0
void
CreateScale(Widget parent_of_scale)
{
#define BOTTOM_OF_THERMOMETER -20
#define TOP_OF_THERMOMETER 40
#define NUM_TICS (((TOP_OF_THERMOMETER - BOTTOM_OF_THERMOMETER) / 10) + 1)
 Widget          scale1, tics[NUM_TICS];
 Arg             args[10];
 Cardinal        i, n;
 unsigned char   scale_orientation, tic_orientation;
 Dimension       tic_long_dim = 10, tic_short_dim = 5;
 Dimension       tic_width, tic_height;
 char            tic_name[10];

 /* Build the Scale. */
   scale1 = XtVaCreateManagedWidget("scale1",
                 xmScaleWidgetClass, parent_of_scale,
                 XmNslidingMode, XmTHERMOMETER,
                 XmNeditable, True,
                 XmNshowValue, True,
                 XmNminimum, BOTTOM_OF_THERMOMETER,
                 XmNmaximum, TOP_OF_THERMOMETER, 
                 NULL);
   
 /* Now build the tic marks. */
   n = 0;
   XtSetArg(args[n], XmNorientation, &scale_orientation);   n++;
   XtGetValues(scale1, args, n);
   if (scale_orientation == XmHORIZONTAL) {
       tic_orientation = XmVERTICAL;
       tic_width = tic_short_dim;
       tic_height = tic_long_dim;
   } else {
       tic_orientation = XmHORIZONTAL;
       tic_width = tic_long_dim;
       tic_height = tic_short_dim;
   }
   
   for (i = 0; i < NUM_TICS; i++) {
       sprintf(tic_name, "tic_%d", i);
       n = 0;
       XtSetArg(args[n], XmNseparatorType, XmSINGLE_LINE);  n++;
       XtSetArg(args[n], XmNorientation, tic_orientation);  n++;
       XtSetArg(args[n], XmNwidth, tic_width);              n++;
       XtSetArg(args[n], XmNheight, tic_height);            n++;
       tics[i] = XmCreateSeparatorGadget(scale1, tic_name,
                                           args, n);
   }

   XtManageChildren(tics, NUM_TICS);
}
Example #10
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;
    }
}
Example #11
0
void Glazymanage (Widget w) {
    if (Glazyq.flag & LAZYMANAGE) {
        if (
            XtParent (Glazyq.mws[Glazyq.mwn - 1]) != XtParent (w) ||
            Glazyq.mwn >= LAZYQNUM
        ) {
            XtManageChildren (Glazyq.mws, Glazyq.mwn);
            Glazyq.mwn = 0;
        }
    } else {
        Glazyq.flag |= LAZYMANAGE;
        Glazyq.mwn = 0;
    }
    Glazyq.mws[Glazyq.mwn++] = w;
}
Example #12
0
/* -------------------------------------------------------------------- */
static void CreateStatsWindow()
{
  Arg         args[8];
  Cardinal    n;
  Widget      drFrame, drRC, b[3];

  n = 0;
  StatsShell = XtCreatePopupShell("statsShell",
                  topLevelShellWidgetClass, AppShell, args, n);

  n = 0;
  StatsWindow = XmCreateForm(StatsShell, (char *)"statsForm", args, n);

  n = 0;
  XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
  XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
  XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
  drFrame = XmCreateFrame(StatsWindow, (char *)"buttonFrame", args, n);
  XtManageChild(drFrame);

  n = 0;
  drRC = XmCreateRowColumn(drFrame, (char *)"buttonRC", args, n);
  XtManageChild(drRC);


  n = 0;
  b[0] = XmCreatePushButton(drRC, (char *)"dismissButton", args, n);
  b[1] = XmCreatePushButton(drRC, (char *)"printButton", args, n);
  b[2] = XmCreatePushButton(drRC, (char *)"parmsButton", args, n);
  XtManageChildren(b, 3);
  XtAddCallback(b[0], XmNactivateCallback, DismissStats, StatsWindow);
  XtAddCallback(b[1], XmNactivateCallback, PrintStats, NULL);
  XtAddCallback(b[2], XmNactivateCallback, EditStatsParms, NULL);


  n = 0;
  XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  XtSetArg(args[n], XmNtopWidget, drFrame); n++;
  XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
  XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
  XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++;
  statsText = XmCreateScrolledText(StatsWindow, (char *)"statsText", args, n);
  XtManageChild(statsText);

}	/* END CREATESTATSWINDOW */
Example #13
0
static void 
InitTogglesWindow (Widget w, XtPointer client_data, XtPointer call_data) 
{
    Cardinal i ;
#define NUM_TOG 50
    Widget work_area, toggles[NUM_TOG] ;

    work_area = XtVaCreateManagedWidget("RowColumn", xmRowColumnWidgetClass,
					w, NULL);
    for (i=0; i<NUM_TOG; i++) {
	char child_name[20] ;

	sprintf(child_name, "RCChild%d", i);
	toggles[i] = XtVaCreateWidget(child_name, xmToggleButtonWidgetClass,
				      work_area, NULL);
    }
    XtManageChildren(toggles, i);
}
Example #14
0
static void 
InitContainerSpatial (Widget w, XtPointer client_data, XtPointer call_data) 
{
    Cardinal i ;
#define NUM_ICONS 10
    Widget icons[NUM_ICONS ] ;

    for (i=0; i<NUM_ICONS ; i++) {
	char icon_name[20] ;
	
	sprintf(icon_name, "IconGadget%d", i);
	icons[i] = XtVaCreateWidget(icon_name, xmIconGadgetClass,
				    w, NULL);
    }
    XtManageChildren(icons, i);

    /* add a handler to turn teh Container to NONE once it is all set */
    XtAddEventHandler (w, ExposureMask, False, ContainerExpose, NULL);
}
Example #15
0
void AttachArea::DisplayAttachmentsInRow(unsigned int X)
{
    int i;
    int managecount, unmanagecount;

    Attachment **list = getList();
    WidgetList manageIconList, unmanageIconList;

    if (getIconCount())
    {
        manageIconList = (WidgetList) XtMalloc(sizeof(Widget)*getIconCount());
        unmanageIconList = (WidgetList) XtMalloc(sizeof(Widget)*getIconCount());
     
        managecount = unmanagecount = 0;
        for(i=0;i<getIconCount();i++) {
 	    if(!list[i]->isDeleted()) {
 	        if(list[i]->getRow() == X) {
		    if(!list[i]->isManaged()) {
		        manageIconList[managecount] = list[i]->baseWidget();
		        managecount++;
		    } 
	        }
	        else { // if deleted
		    if(list[i]->isManaged()) {
		        unmanageIconList[unmanagecount] = list[i]->baseWidget();
		        unmanagecount++;
		    }
	        }
	    }
        }

        XtUnmanageChildren(unmanageIconList, unmanagecount);
        XtManageChildren(manageIconList, managecount);


        XtFree((char *)manageIconList);
        XtFree((char *)unmanageIconList);
    }

    this->attachment_summary(_iconCount - _deleteCount, _deleteCount);
}
Example #16
0
/* -------------------------------------------------------------------- */
static Widget CreateDropDownMenu(Widget parent, char menu_name[],
	struct ccb_info menu_info[])
{
  int           i;
  Widget        PD, OM, buttons[16];
  Cardinal      n;
  Arg           args[4];
  XmString      name;


  /* Pre-filter menu
   */
  n = 0;
  PD = XmCreatePulldownMenu(parent, "pullDown", args, n);

  n = 0;
  XtSetArg(args[n], XmNsubMenuId, PD); ++n;
  OM = XmCreateOptionMenu(parent, menu_name, args, n);
  XtManageChild(OM);


  for (i = 0; menu_info[i].name; ++i)
    {
    name = XmStringCreateLocalized(menu_info[i].name);

    n = 0;
    XtSetArg(args[n], XmNlabelString, name); ++n;
    buttons[i] = XmCreatePushButton(PD, "opMenB", args, n);
    XtAddCallback(buttons[i], XmNactivateCallback, menu_info[i].callBack,
                  (XtPointer)menu_info[i].client);

    XmStringFree(name);
    }

  XtManageChildren(buttons, i);

  return(OM);

}	/* END CREATEDROPDOWNMENU */
Example #17
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);
}
Example #18
0
File: ssX.c Project: q3k/ski
void scrnInitX(void)
{
    Widget toplevel, control;
    Widget mb, fileMenu, viewMenu, confMenu, helpMenu;
    Widget procFrame = NULL, bboxFrame = NULL;
#ifdef ICON_DEFINED
    Pixmap icon;
#endif
    XmString s;
    Arg args[10];
    unsigned i, n;
    int argc = 0;

    addRegwRsrcOpts();
    addDatwRsrcOpts();
    toplevel = XtAppInitialize(&app_context, "XSki",
			       options, topopts, &argc, NULL,
			       NULL, NULL, 0);
    top_level = toplevel;	/* XXX - temporary for Platform only */
    XtGetApplicationResources(toplevel, &app_data,
			      resources, toprsrc, NULL, 0);
    XtAppAddActions(app_context, actions, XtNumber(actions));
    dpy = XtDisplay(toplevel);

#ifdef ICON_DEFINED
    /* set default icon */
    icon = XCreateBitmapFromData(dpy, RootWindowOfScreen(XtScreen(toplevel)),
				 icon_bits, icon_width, icon_height);
    XtSetArg(args[0], XmNiconPixmap, icon);
    XtSetValues(toplevel, args, 1);
#endif

#if 0
    XSynchronize(dpy, True);
#endif

    /* create control window manager */
    control = XmCreateForm(toplevel, "control", NULL, 0);
    XtManageChild(control);

    /* Control window menubar */
    n = 0;
    XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);		n++;
    XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);	n++;
    XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);	n++;
    mb = XmCreateMenuBar(control, "mb", args, n);
    XtManageChild(mb);
    fileMenu = createMBitem(mb, "File");
    viewMenu = createMBitem(mb, "View");
    confMenu = createMBitem(mb, "Configure");
    helpMenu = createMBitem(mb, "Help");

#if 0
    createSubmenuItem(fileMenu, "load", loadCallback);
#else
    createSubmenuItem(fileMenu, "load", 0);
#endif
    createSubmenuItem(fileMenu, "save", 0);
    createSubmenuItem(fileMenu, "trace", 0);
    createSubmenuItem(fileMenu, "traceOn", 0);
    createSubmenuItem(fileMenu, "traceOff", 0);
    createSubmenuItem(fileMenu, "read", 0);
    XtManageChild(XmCreateSeparatorGadget(fileMenu, "", NULL, 0));
    createSubmenuItem(fileMenu, "quit", simCmdCallback);

    createSubmenuItem(viewMenu, "program", programCallback);
    createSubmenuItem(viewMenu, "data", dataCallback);
    createSubmenuItem(viewMenu, "registers", regCallback);
    createSubmenuItem(viewMenu, "cache", 0);
    createSubmenuItem(viewMenu, "tlb", sdtCallback);
    XtManageChild(XmCreateSeparatorGadget(viewMenu, "", NULL, 0));
    createSubmenuItem(viewMenu, "callstack", cstCallback);
    createSubmenuItem(viewMenu, "statistics", 0);
    createSubmenuItem(viewMenu, "breakpoints", blistCallback);
    createSubmenuItem(viewMenu, "branches", 0);
    createSubmenuItem(viewMenu, "symbols", symlistCallback);
    createSubmenuItem(viewMenu, "macros", 0);

#if 0
/* No support for window format yet */
    createSubmenuItem(confMenu, "program", prgFmtCallback);
#else
    createSubmenuItem(confMenu, "program", 0);
#endif

    createSubmenuItem(confMenu, "data", 0);

#if 0
/* No support for window format yet */
    createSubmenuItem(confMenu, "registers", regFmtCallback);
#else
    createSubmenuItem(confMenu, "registers", 0);
#endif

    createSubmenuItem(helpMenu, "context", 0);
    createSubmenuItem(helpMenu, "overview", 0);
    createSubmenuItem(helpMenu, "commands", cmdHelpCallback);
    createSubmenuItem(helpMenu, "product", prodInfoCallback);

    /* Control window processor option menu */
    if (nproc > 1) {
	Widget procMenu, proc[NPROC];

	n = 0;
	XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET);	n++;
	XtSetArg(args[n], XmNtopWidget, mb);			n++;
	XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);	n++;
	XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);	n++;
	procFrame = XmCreateFrame(control, "", args, n);
	XtManageChild(procFrame);

	procMenu = XmCreatePulldownMenu(procFrame, "", NULL, 0);
	for (i = 0; i < nproc; i++) {
	    char name[4];

	    (void)sprintf(name, "p%d", i);
	    proc[i] = XmCreatePushButton(procMenu, name, NULL, 0);
	    XtAddCallback(proc[i], XmNactivateCallback,
			  changeCprocCallback, (XtPointer)i);
	}
	XtManageChildren(proc, nproc);
	n = 0;
	XtSetArg(args[n], XmNsubMenuId, procMenu);		n++;
	XtManageChild(XmCreateOptionMenu(procFrame, "procOption", args, n));
    }

    /* Control window button box */
    if (app_data.numButtons) {
	Widget bbox, btns[20];

	/* create button box manager */
	n = 0;
	XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET);		n++;
	XtSetArg(args[n], XmNtopWidget, procFrame ? procFrame : mb);	n++;
	XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);		n++;
	XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);		n++;
	bboxFrame = XmCreateFrame(control, "", args, n);
	XtManageChild(bboxFrame);

	/* create button box window */
	bbox = XmCreateRowColumn(bboxFrame, "bbox", NULL, 0);
	XtManageChild(bbox);
	/* create each button */
	for (i = 0; i < app_data.numButtons; i++) {
	    char name[8];

	    (void)sprintf(name, "bb%d", i);
	    btns[i] = XmCreatePushButton(bbox, name, NULL, 0);
	}
	XtManageChildren(btns, app_data.numButtons);
    }

    /* Control window command area */
    n = 0;
    XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET);		n++;
    XtSetArg(args[n], XmNtopWidget,
	     bboxFrame ? bboxFrame : procFrame ? procFrame : mb);	n++;
    XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);		n++;
    XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);		n++;
    cmd = XmCreateCommand(control, "cmd", args, n);
    XtManageChild(cmd);
    XtAddCallback(cmd, XmNcommandEnteredCallback, simCmdCallback, 0);

    /* command history box */
    n = 0;
    XtSetArg(args[0], XmNinitialFocus, cmd);	n++;
    XtSetValues(control, args, n);
    cmdHist = XmCommandGetChild(cmd, XmDIALOG_HISTORY_LIST);

    /* message window */
    msgs = XmCreateScrolledText(control, "msgs", NULL, 0);
    XtManageChild(msgs);
    n = 0;
    XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET);		n++;
    XtSetArg(args[n], XmNtopWidget, cmd);				n++;
    XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);		n++;
    XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);		n++;
    XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);		n++;
    XtSetValues(XtParent(msgs), args, n);

    /* create stop simulation dialog */
	/* Consider changing this to a button.  This would allow other
	   functionality to still be active when simulation is going on.
	   For example, Help, Quit, opening and closing windows, etc. */
    stopsim = XmCreateWorkingDialog(control, "stopsim", NULL, 0);
    n = 0;
    XtSetArg(args[n], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL);	n++;
    s = XmStringCreateLocalized("Running...");
    XtSetArg(args[n], XmNdialogTitle, s);				n++;
    s = XmStringCreateLocalized(" icnt: 0 ");
    XtSetArg(args[n], XmNmessageString, s);				n++;
    s = XmStringCreateLocalized("Stop");
    XtSetArg(args[n], XmNcancelLabelString, s);				n++;
    XtSetValues(stopsim, args, n);
    XtAddCallback(stopsim, XmNcancelCallback, stop_execLoopXCB, NULL);
    XtUnmanageChild(XmMessageBoxGetChild(stopsim, XmDIALOG_OK_BUTTON));
    XtUnmanageChild(XmMessageBoxGetChild(stopsim, XmDIALOG_HELP_BUTTON));
    XmStringFree(s);

    /* XXX - This should probably be inside regwInit */
    for (i = 0; i < topregw; i++)
	regwtbl[i].show = app_data.showRs[i];

    /* XXX - This should probably be inside datwInit */
    for (i = 0; i < topdatw; i++)
	datwtbl[i].show = app_data.viewDw[i];

    prgwInit();
    datwInit();
    regwInit();
    if (app_data.viewProg)
	prgwDrawX();
    datwDrawX();
    if (app_data.viewRegs)
	regwDrawX();

    noscreen = NO;
    XtRealizeWidget(toplevel);
}
Example #19
0
void create_emfpr_dr_shell (Widget parent)
{
	Widget children[6];      /* Children to manage */
	Arg al[64];                    /* Arg List */
	register int ac = 0;           /* Arg Count */

	XtSetArg(al[ac], XmNallowShellResize, TRUE); ac++;
	XtSetArg(al[ac], XmNminWidth, 492); ac++;
	XtSetArg(al[ac], XmNminHeight, 182); ac++;
	XtSetArg(al[ac], XmNmaxWidth, 492); ac++;
	XtSetArg(al[ac], XmNmaxHeight, 182); ac++;
	emfpr_dr_shell = XmCreateDialogShell ( parent, "emfpr_dr_shell", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++;
	emfpr_dr_main_form = XmCreateForm ( emfpr_dr_shell, "emfpr_dr_main_form", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNshadowThickness, 2); ac++;
	XtSetArg(al[ac], XmNshadowType, XmSHADOW_IN); ac++;
	emfpr_dr_inner_form = XmCreateForm ( emfpr_dr_main_form, "emfpr_dr_inner_form", al, ac );
	ac = 0;
	emfpr_dr_resume_lbl = XmCreateLabel ( emfpr_dr_inner_form, "emfpr_dr_resume_lbl", al, ac );
	emfpr_dr_product_lbl = XmCreateLabel ( emfpr_dr_inner_form, "emfpr_dr_product_lbl", al, ac );
	XtSetArg(al[ac], XmNmaxLength, 80); ac++;
	XtSetArg(al[ac], XmNcolumns, 40); ac++;
	emfpr_dr_product_txt = XmCreateText ( emfpr_dr_inner_form, "emfpr_dr_product_txt", al, ac );
	ac = 0;
	emfpr_dr_disc_reason_lbl = XmCreateLabel ( emfpr_dr_inner_form, "emfpr_dr_disc_reason_lbl", al, ac );
	XtSetArg(al[ac], XmNmaxLength, 80); ac++;
	XtSetArg(al[ac], XmNcolumns, 40); ac++;
	emfpr_dr_disc_reason_txt = XmCreateText ( emfpr_dr_inner_form, "emfpr_dr_disc_reason_txt", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNseparatorType, XmNO_LINE); ac++;
	emfpr_dr_sep1 = XmCreateSeparator ( emfpr_dr_inner_form, "emfpr_dr_sep1", al, ac );
	ac = 0;
	emfpr_dr_btn_form = XmCreateForm ( emfpr_dr_main_form, "emfpr_dr_btn_form", al, ac );
	XtSetArg(al[ac], XmNorientation, XmHORIZONTAL); ac++;
	XtSetArg(al[ac], XmNpacking, XmPACK_COLUMN); ac++;
	XtSetArg(al[ac], XmNentryAlignment, XmALIGNMENT_CENTER); ac++;
	emfpr_dr_btn_rc = XmCreateRowColumn ( emfpr_dr_btn_form, "emfpr_dr_btn_rc", al, ac );
	ac = 0;
	emfpr_dr_resume_btn = XmCreatePushButton ( emfpr_dr_btn_rc, "emfpr_dr_resume_btn", al, ac );
	emfpr_dr_close_btn = XmCreatePushButton ( emfpr_dr_btn_rc, "emfpr_dr_close_btn", al, ac );
	emfpr_dr_help_btn = XmCreatePushButton ( emfpr_dr_btn_rc, "emfpr_dr_help_btn", al, ac );

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 10); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 10); ac++;
	XtSetArg(al[ac], XmNbottomWidget, emfpr_dr_btn_form); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 10); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 10); ac++;
	XtSetValues ( emfpr_dr_inner_form,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 10); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 100); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
	XtSetValues ( emfpr_dr_btn_form,al, ac );
	ac = 0;
	XtAddCallback (emfpr_dr_main_form,XmNhelpCallback, XDhelp_link, (XtPointer) &_xd_help_pairs[0] );

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 10); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 10); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
	XtSetValues ( emfpr_dr_resume_lbl,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNtopWidget, emfpr_dr_product_txt); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 0); ac++;
	XtSetArg(al[ac], XmNbottomWidget, emfpr_dr_product_txt); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNrightOffset, 5); ac++;
	XtSetArg(al[ac], XmNrightWidget, emfpr_dr_product_txt); ac++;
	XtSetValues ( emfpr_dr_product_lbl,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 10); ac++;
	XtSetArg(al[ac], XmNtopWidget, emfpr_dr_resume_lbl); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 166); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
	XtSetValues ( emfpr_dr_product_txt,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNtopWidget, emfpr_dr_disc_reason_txt); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 0); ac++;
	XtSetArg(al[ac], XmNbottomWidget, emfpr_dr_disc_reason_txt); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNrightOffset, 5); ac++;
	XtSetArg(al[ac], XmNrightWidget, emfpr_dr_disc_reason_txt); ac++;
	XtSetValues ( emfpr_dr_disc_reason_lbl,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNtopWidget, emfpr_dr_product_txt); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
	XtSetArg(al[ac], XmNleftOffset, 0); ac++;
	XtSetArg(al[ac], XmNleftWidget, emfpr_dr_product_txt); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
	XtSetValues ( emfpr_dr_disc_reason_txt,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 10); ac++;
	XtSetArg(al[ac], XmNtopWidget, emfpr_dr_disc_reason_txt); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNleftOffset, 10); ac++;
	XtSetArg(al[ac], XmNleftWidget, emfpr_dr_disc_reason_txt); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
	XtSetValues ( emfpr_dr_sep1,al, ac );
	ac = 0;
	children[ac++] = emfpr_dr_resume_lbl;
	children[ac++] = emfpr_dr_product_lbl;
	children[ac++] = emfpr_dr_product_txt;
	children[ac++] = emfpr_dr_disc_reason_lbl;
	children[ac++] = emfpr_dr_disc_reason_txt;
	children[ac++] = emfpr_dr_sep1;
	XtManageChildren(children, ac);
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( emfpr_dr_btn_rc,al, ac );
	ac = 0;
	XtAddCallback (emfpr_dr_resume_btn, XmNactivateCallback, undo_disc_product_cb,NULL);
	XtAddCallback (emfpr_dr_close_btn, XmNactivateCallback, emfpr_dr_close_cb,NULL);
	XtAddCallback (emfpr_dr_help_btn,XmNactivateCallback, XDhelp_link, (XtPointer) &_xd_help_pairs[1] );
	children[ac++] = emfpr_dr_resume_btn;
	children[ac++] = emfpr_dr_close_btn;
	children[ac++] = emfpr_dr_help_btn;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = emfpr_dr_btn_rc;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = emfpr_dr_inner_form;
	children[ac++] = emfpr_dr_btn_form;
	XtManageChildren(children, ac);
	ac = 0;
}
Example #20
0
Widget
CreateConstraintResourceControls( Widget parent, Widget left_widget,
                             Widget bottom_widget,
 			     unsigned int child_type )
{
	XmString	string;
	Widget		RowColumn;
	Widget          ArrowSensLabel, ArrowSensPulldown, ArrowSensOptions,
	                ArrowSensPB[NUM_ARROW_SENS_BTNS];
	Widget          DecimalPtsLabel, DecimalPtsTF;
	Widget          IncrValueLabel, IncrValueTF;
	Widget          MaxValueLabel, MaxValueTF;
	Widget          MinValueLabel, MinValueTF;
	Widget          NumValuesLabel, NumValuesTF;
	Widget          PositionLabel;
	Widget          ChildTypeLabel, ChildTypePulldown, ChildTypeOptions,
                        ChildTypePB[NUM_CHILD_TYPE_BTNS];
	Widget          ValuesLabel, ValuesList;
	char		buffer[30], buffer2[30];
	Widget          client_widget;
	int		i, j;	
        XmStringTable   stringTable;

        client_widget = ( child_type == XmSTRING ) ? StringTextF :
                        NumericTextF;

        n = 0;
        XtSetArg( args[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
        XtSetArg( args[n], XmNleftWidget, left_widget ); n++;
        XtSetArg( args[n], XmNbottomAttachment, XmATTACH_WIDGET ); n++;
        XtSetArg( args[n], XmNbottomWidget, bottom_widget ); n++;
        XtSetArg(args[n], XmNnumColumns, 9); n++;
        XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
        XtSetArg(args[n], XmNpacking, XmPACK_COLUMN); n++;
        RowColumn = XmCreateRowColumn( parent, "RowColumn", args, n );
	XtManageChild( RowColumn );


      /*
       *  Create label and option menu for XmNarrowSensitivity resource.
       */
        string = XmStringCreateLtoR("Arrow Sensitivity",
                   XmFONTLIST_DEFAULT_TAG );
        n = 0;
        XtSetArg( args[n], XmNlabelString, string ); n++;
        ArrowSensLabel = XmCreateLabel( RowColumn, "ArrowSensLabel",
                             args, n );
        XtManageChild( ArrowSensLabel );
        XmStringFree( string );

        n = 0;
        ArrowSensPulldown = XmCreatePulldownMenu(RowColumn,
                                                 "ArrowSensPulldown",
                                                 args, n);

        for ( i = 0; i < NUM_ARROW_SENS_BTNS; i++ )
        {
           string = XmStringCreateLtoR( arrow_sens_strings[i],
                      XmFONTLIST_DEFAULT_TAG );
           if ( child_type == XmSTRING )
                sprintf( buffer, "StringArrowSensPB%d", i );
           else if ( child_type == XmNUMERIC )
                sprintf( buffer, "NumericArrowSensPB%d", i );

           n = 0;
           XtSetArg( args[n], XmNlabelString, string ); n++;
           ArrowSensPB[i] = 
           XmCreatePushButton( ArrowSensPulldown, buffer, args, n );
           XmStringFree( string );

           if ( child_type == XmSTRING )
           {
              string_arrow_sens_cd[i].textfield = client_widget; 
              string_arrow_sens_cd[i].sensitivity = arrow_sens[i];
              XtAddCallback( ArrowSensPB[i], XmNactivateCallback,
                             ArrowSensCB, &string_arrow_sens_cd[i]); 
           }
           else if ( child_type = XmNUMERIC )
           {
              numeric_arrow_sens_cd[i].textfield = client_widget; 
              numeric_arrow_sens_cd[i].sensitivity = arrow_sens[i];
              XtAddCallback( ArrowSensPB[i], XmNactivateCallback,
                             ArrowSensCB, &numeric_arrow_sens_cd[i]); 
           }
        }
        XtManageChildren( ArrowSensPB, NUM_ARROW_SENS_BTNS );

        if ( child_type == XmSTRING )
             sprintf( buffer, "StringArrowSensOptions", i );
        else if ( child_type == XmNUMERIC )
             sprintf( buffer, "NumericArrowSensOptions", i );

        n = 0;
        XtSetArg( args[n], XmNmenuHistory, 
                           ArrowSensPB[NUM_ARROW_SENS_BTNS - 1] ); n++;
        XtSetArg( args[n], XmNsubMenuId, ArrowSensPulldown ); n++;
        ArrowSensOptions =
        XmCreateOptionMenu( RowColumn, buffer, args, n );
        XtManageChild( ArrowSensOptions );

        string = XmStringCreateLtoR("Decimal Points",
                   XmFONTLIST_DEFAULT_TAG );
        n = 0;
        XtSetArg( args[n], XmNlabelString, string ); n++;
        DecimalPtsLabel =
        XmCreateLabel( RowColumn, "DecimalPtsLabel", args, n );
        XtManageChild( DecimalPtsLabel );
        XmStringFree( string );

        n = 0;
        XtSetArg( args[n], XmNvalue, "0" ); n++;
        if ( child_type == XmSTRING )
           sprintf( buffer, "%s", "StringDecimalPtsTF" );
        else if ( child_type == XmNUMERIC )
           sprintf( buffer, "%s", "NumericDecimalPtsTF" );
        DecimalPtsTF =
        XmCreateTextField( RowColumn, buffer, args, n );
        XtManageChild( DecimalPtsTF );

        XtAddCallback( DecimalPtsTF, XmNactivateCallback,
                       DecimalPtsCB, (XtPointer)client_widget );

        string = XmStringCreateLtoR("Increment Value",
                   XmFONTLIST_DEFAULT_TAG );
        n = 0;
        XtSetArg( args[n], XmNlabelString, string ); n++;
        IncrValueLabel =
        XmCreateLabel( RowColumn, "IncrValueLabel", args, n );
        XtManageChild( IncrValueLabel );
        XmStringFree( string );

        n = 0;
        XtSetArg( args[n], XmNvalue, "1" ); n++;
        if ( child_type == XmSTRING )
           sprintf( buffer, "%s", "StringIncrValueTF" );
        else if ( child_type == XmNUMERIC )
           sprintf( buffer, "%s", "NumericIncrValueTF" );
        IncrValueTF =
        XmCreateTextField( RowColumn, buffer, args, n );
        XtManageChild( IncrValueTF );

        XtAddCallback( IncrValueTF, XmNactivateCallback,
                       IncrValueCB, (XtPointer)client_widget );

        string = XmStringCreateLtoR("Maximum Value",
                   XmFONTLIST_DEFAULT_TAG );
        n = 0;
        XtSetArg( args[n], XmNlabelString, string ); n++;
        MaxValueLabel =
        XmCreateLabel( RowColumn, "MaxValueLabel", args, n );
        XtManageChild( MaxValueLabel );
        XmStringFree( string );

        n = 0;
        XtSetArg( args[n], XmNvalue, "10" ); n++;
        if ( child_type == XmSTRING )
           sprintf( buffer, "%s", "StringMaxValueTF" );
        else if ( child_type == XmNUMERIC )
           sprintf( buffer, "%s", "NumericMaxValueTF" );
        MaxValueTF =
        XmCreateTextField( RowColumn, buffer, args, n );
        XtManageChild( MaxValueTF );

        XtAddCallback( MaxValueTF, XmNactivateCallback,
                       MaxValueCB, (XtPointer)client_widget );

        string = XmStringCreateLtoR("Minimum Value",
                   XmFONTLIST_DEFAULT_TAG );
        n = 0;
        XtSetArg( args[n], XmNlabelString, string ); n++;
        MinValueLabel =
        XmCreateLabel( RowColumn, "MinValueLabel", args, n );
        XtManageChild( MinValueLabel );
        XmStringFree( string );

        n = 0;
        XtSetArg( args[n], XmNvalue, "0" ); n++;
        if ( child_type == XmSTRING )
           sprintf( buffer, "%s", "StringMinValueTF" );
        else if ( child_type == XmNUMERIC )
           sprintf( buffer, "%s", "NumericMinValueTF" );
        MinValueTF =
        XmCreateTextField( RowColumn, buffer, args, n );
        XtManageChild( MinValueTF );

        XtAddCallback( MinValueTF, XmNactivateCallback,
                       MinValueCB, (XtPointer)client_widget );

        string = XmStringCreateLtoR("Num Values",
                   XmFONTLIST_DEFAULT_TAG );
        n = 0;
        XtSetArg( args[n], XmNlabelString, string ); n++;
        NumValuesLabel =
        XmCreateLabel( RowColumn, "NumValuesLabel", args, n );
        XtManageChild( NumValuesLabel );
        XmStringFree( string );

        client_widget = ( child_type == XmSTRING ) ? StringTextF :
                        NumericTextF;

      /*
       *  Get current value of XmNnumValues resource.
       */
        n = 0;
        XtSetArg( args[n], XmNnumValues, &j ); n++;
        XtGetValues( client_widget, args, n );

        sprintf( buffer, "%d", j );

        n = 0;
        XtSetArg( args[n], XmNvalue, buffer ); n++;
        if ( child_type == XmSTRING )
           sprintf( buffer2, "%s", "StringNumValuesTF" );
        else if ( child_type == XmNUMERIC )
           sprintf( buffer2, "%s", "NumericNumValuesTF" );
        NumValuesTF =
        XmCreateTextField( RowColumn, buffer2, args, n );
        XtManageChild( NumValuesTF );

        XtAddCallback( NumValuesTF, XmNactivateCallback,
                       NumValuesCB, (XtPointer)client_widget );

        string = XmStringCreateLtoR("Position",
                   XmFONTLIST_DEFAULT_TAG );
        n = 0;
        XtSetArg( args[n], XmNlabelString, string ); n++;
        PositionLabel =
        XmCreateLabel( RowColumn, "PositionLabel", args, n );
        XtManageChild( PositionLabel );
        XmStringFree( string );

        n = 0;
        XtSetArg( args[n], XmNvalue, "0" ); n++;
        if ( child_type == XmSTRING )
        {
           sprintf( buffer, "%s", "StringPositionTF" );
           StringPositionTF =
           XmCreateTextField( RowColumn, buffer, args, n );
           XtManageChild( StringPositionTF );
           XtAddCallback( StringPositionTF, XmNactivateCallback,
                          PositionCB, (XtPointer)client_widget );
           XtAddCallback( SpinBox1, XmNvalueChangedCallback,
                          UpdatePositionCB, (XtPointer)StringPositionTF );
        }
        else if ( child_type == XmNUMERIC )
        {
           sprintf( buffer, "%s", "NumericPositionTF" );
           NumericPositionTF =
           XmCreateTextField( RowColumn, buffer, args, n );
           XtManageChild( NumericPositionTF );
           XtAddCallback( NumericPositionTF, XmNactivateCallback,
                          PositionCB, (XtPointer)client_widget );
           XtAddCallback( SpinBox2, XmNvalueChangedCallback,
                          UpdatePositionCB, (XtPointer)NumericPositionTF );
        }

        string = XmStringCreateLtoR("SpinBox Child Type",
                   XmFONTLIST_DEFAULT_TAG );
        n = 0;
        XtSetArg( args[n], XmNlabelString, string ); n++;
        ChildTypeLabel =
        XmCreateLabel( RowColumn, "ChildTypeLabel", args, n );
        XtManageChild( ChildTypeLabel );
        XmStringFree( string );

        n = 0;
        ChildTypePulldown = XmCreatePulldownMenu(RowColumn,
                                                 "ChildTypePulldown",
                                                 args, n);

        for ( i = 0; i < NUM_CHILD_TYPE_BTNS; i++ )
        {
           string = XmStringCreateLtoR( child_type_strings[i],
                      XmFONTLIST_DEFAULT_TAG );
           if ( child_type == XmSTRING )
              sprintf( buffer, "StringChildTypePB%d", i );
           else if ( child_type == XmNUMERIC )
              sprintf( buffer, "NumericChildTypePB%d", i );
           n = 0;
           XtSetArg( args[n], XmNlabelString, string ); n++;
           ChildTypePB[i] =
           XmCreatePushButton( ChildTypePulldown, buffer, args, n );
           XmStringFree( string );

           if ( child_type == XmSTRING )
           {
              string_child_type_cd[i].textfield = client_widget;
              string_child_type_cd[i].child_type = child_types[i];
              XtAddCallback( ChildTypePB[i], XmNactivateCallback,
                             ChildTypeCB, &string_child_type_cd[i] );
           }
           else if ( child_type == XmNUMERIC )
           {
              numeric_child_type_cd[i].textfield = client_widget;
              numeric_child_type_cd[i].child_type = child_types[i];
              XtAddCallback( ChildTypePB[i], XmNactivateCallback,
                             ChildTypeCB, &numeric_child_type_cd[i] );
           }
        }
        XtManageChildren( ChildTypePB, NUM_CHILD_TYPE_BTNS );

        n = 0;
        if ( child_type == XmSTRING )
        {
           XtSetArg( args[n], XmNmenuHistory, ChildTypePB[0] ); n++;
        }
        else if ( child_type == XmNUMERIC )
        {
           XtSetArg( args[n], XmNmenuHistory, ChildTypePB[1] ); n++;
        }
        XtSetArg( args[n], XmNsubMenuId, ChildTypePulldown ); n++;
        ChildTypeOptions =
        XmCreateOptionMenu( RowColumn, "ChildTypeOptions", args, n );
        XtManageChild( ChildTypeOptions );

        string = XmStringCreateLtoR( "Values",
                      XmFONTLIST_DEFAULT_TAG );

        n = 0;
        XtSetArg( args[n], XmNlabelString, string ); n++;
        ValuesLabel =
        XmCreateLabel( RowColumn, "ValuesLabel", args, n );
        XtManageChild( ValuesLabel );
        XmStringFree( string );

       /*
        *  Get current values for XmNvalues resource.
        */
        n = 0;
        XtSetArg( args[n], XmNnumValues, &j ); n++;
        XtSetArg( args[n], XmNvalues, &stringTable ); n++;
        XtGetValues( client_widget, args, n );

       /*
        *  Assign current string values to List for display.
        */
        if ( child_type == XmSTRING )
           sprintf( buffer, "%s", "StringValuesList" );
        else if ( child_type == XmNUMERIC )
           sprintf( buffer, "%s", "NumericValuesList" );
        n = 0;
        XtSetArg( args[n], XmNitemCount, j ); n++;
        XtSetArg( args[n], XmNitems, stringTable ); n++;
        XtSetArg( args[n], XmNvisibleItemCount, 1 ); n++;
        ValuesList = XmCreateScrolledList( RowColumn, buffer,
                     args, n );
        XtManageChild( ValuesList );

     return( RowColumn );
}
Example #21
0
Widget
CreateSpinBoxResourceControls( Widget parent, Widget top_widget, 
                               Widget left_widget, Widget right_widget )
                               
                
{
	XmString 	string;
	Widget  	SBResLabel, RowColumn;
	Widget  	ArrowLayoutLabel, ArrowLayoutPulldown, 
                        ArrowLayoutOptions, 
                	ArrowLayoutPB[NUM_ARROW_LAYOUT_BTNS]; 
	Widget  	ArrowSizeLabel, ArrowSizePulldown, ArrowSizeOptions, 
                	ArrowSizePB[NUM_ARROW_SIZE_BTNS]; 
	Widget  	DefArrowSensitiveLabel, DefArrowSensitivePulldown, 
                	DefArrowSensitiveOptions, 
                	DefArrowSensitivePB[NUM_DEF_ARROW_SENS_BTNS];
        Widget  	InitialDelayLabel, InitialDelayTF;
        Widget  	RepeatDelayLabel, RepeatDelayTF;
	int		i;
	char		buffer[30];

        n = 0;
        XtSetArg( args[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
        XtSetArg( args[n], XmNtopWidget, top_widget ); n++;
        XtSetArg( args[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
        XtSetArg( args[n], XmNleftWidget, left_widget ); n++;
        XtSetArg( args[n], XmNrightAttachment, XmATTACH_WIDGET ); n++;
        XtSetArg( args[n], XmNrightWidget, right_widget ); n++;
   	XtSetArg(args[n], XmNnumColumns, 5); n++;
   	XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
   	XtSetArg(args[n], XmNpacking, XmPACK_COLUMN); n++;
        RowColumn = XmCreateRowColumn( parent, "RowColumn", args, n );
        XtManageChild( RowColumn );

      /*
       *  Create label and option menu for XmNarrowLayout resource.
       */
        string = XmStringCreateLtoR("Arrow Layout",
                   XmFONTLIST_DEFAULT_TAG );
        n = 0;
        XtSetArg( args[n], XmNlabelString, string ); n++;
        ArrowLayoutLabel = XmCreateLabel( RowColumn, "ArrowLayoutLabel",
                             args, n );
        XtManageChild( ArrowLayoutLabel );
        XmStringFree( string );

        n = 0;
        ArrowLayoutPulldown = XmCreatePulldownMenu(RowColumn,
                                                   "ArrowLayoutPulldown",
                                                   args, n);

        for ( i = 0; i < NUM_ARROW_LAYOUT_BTNS; i++ )
        {
           string = XmStringCreateLtoR( arrow_layout_strings[i],
                      XmFONTLIST_DEFAULT_TAG );
           sprintf( buffer, "ArrowLayoutPB%d", i );
           n = 0;
           XtSetArg( args[n], XmNlabelString, string ); n++;
           ArrowLayoutPB[i] = 
           XmCreatePushButton( ArrowLayoutPulldown, buffer, args, n );
           XmStringFree( string );

           XtAddCallback( ArrowLayoutPB[i], XmNactivateCallback,
                          ArrowLayoutCB, (XtPointer)&arrow_layout[i] ); 
        }
        XtManageChildren( ArrowLayoutPB, NUM_ARROW_LAYOUT_BTNS );


        n = 0;
        XtSetArg( args[n], XmNmenuHistory, 
                  ArrowLayoutPB[NUM_ARROW_LAYOUT_BTNS - 1] ); n++;
        XtSetArg( args[n], XmNsubMenuId, ArrowLayoutPulldown ); n++;
        ArrowLayoutOptions =
        XmCreateOptionMenu( RowColumn, "ArrowLayoutOptions", args, n );
        XtManageChild( ArrowLayoutOptions );
        
      /*
       *  Create label and option menu for XmNarrowSize resource.
       */
        string = XmStringCreateLtoR("Arrow Size",
                   XmFONTLIST_DEFAULT_TAG );
        n = 0;
        XtSetArg( args[n], XmNlabelString, string ); n++;
        ArrowSizeLabel = XmCreateLabel( RowColumn, "ArrowSizeLabel",
                             args, n );
        XtManageChild( ArrowSizeLabel );
        XmStringFree( string );

        n = 0;
        ArrowSizePulldown = XmCreatePulldownMenu(RowColumn,
                                                 "ArrowSizePulldown",
                                                 args, n);

        for ( i = 0; i < NUM_ARROW_SIZE_BTNS; i++ )
        {
           string = XmStringCreateLtoR( arrow_size_strings[i],
                      XmFONTLIST_DEFAULT_TAG );
           sprintf( buffer, "ArrowSizePB%d", i );
           n = 0;
           XtSetArg( args[n], XmNlabelString, string ); n++;
           ArrowSizePB[i] =
           XmCreatePushButton( ArrowSizePulldown, buffer, args, n );
           XmStringFree( string );

           XtAddCallback( ArrowSizePB[i], XmNactivateCallback,
                          ArrowSizeCB, (XtPointer)arrow_size_strings[i] );
        }
        XtManageChildren( ArrowSizePB, NUM_ARROW_SIZE_BTNS );

        n = 0;
        XtSetArg( args[n], XmNmenuHistory, ArrowSizePB[0] ); n++;
        XtSetArg( args[n], XmNsubMenuId, ArrowSizePulldown ); n++;
        ArrowSizeOptions =
        XmCreateOptionMenu( RowColumn, "ArrowSizeOptions", args, n );
        XtManageChild( ArrowSizeOptions );

      /*
       *  Create label and option menu for XmNdefaultArrowSensitivity resource.
       */
        string = XmStringCreateLtoR("Default Arrow Sensitivity",
                   XmFONTLIST_DEFAULT_TAG );
                   
        n = 0;
        XtSetArg( args[n], XmNlabelString, string ); n++;
        DefArrowSensitiveLabel = 
        XmCreateLabel( RowColumn, "DefArrowSensitiveLabel", args, n );
        XtManageChild( DefArrowSensitiveLabel );
        XmStringFree( string );

        n = 0;
        DefArrowSensitivePulldown = 
        XmCreatePulldownMenu(RowColumn, "DefArrowSensitivePulldown",
                             args, n);

        for ( i = 0; i < NUM_DEF_ARROW_SENS_BTNS; i++ )
        {
           string = XmStringCreateLtoR( def_arrow_sens_strings[i],
                      XmFONTLIST_DEFAULT_TAG );
           sprintf( buffer, "DefArrowSensitivePB%d", i );
           n = 0;
           XtSetArg( args[n], XmNlabelString, string ); n++;
           DefArrowSensitivePB[i] =
           XmCreatePushButton( DefArrowSensitivePulldown, buffer, args, n );
           XmStringFree( string );

           XtAddCallback( DefArrowSensitivePB[i], XmNactivateCallback,
                          DefArrowSensitiveCB, (XtPointer)&def_arrow_sens[i] );
        }
        XtManageChildren( DefArrowSensitivePB, NUM_DEF_ARROW_SENS_BTNS );

        n = 0;
        XtSetArg( args[n], XmNmenuHistory, DefArrowSensitivePB[0] ); n++;
        XtSetArg( args[n], XmNsubMenuId, DefArrowSensitivePulldown ); n++;
        DefArrowSensitiveOptions =
        XmCreateOptionMenu( RowColumn, "DefArrowSensitiveOptions", args, n );
        XtManageChild( DefArrowSensitiveOptions );

      /*
       *  Create label and text field for XmNinitialDelay resource.
       */
        string = XmStringCreateLtoR("Initial Delay",
                   XmFONTLIST_DEFAULT_TAG );
        n = 0;
        XtSetArg( args[n], XmNlabelString, string ); n++;
        InitialDelayLabel =
        XmCreateLabel( RowColumn, "InitialDelayLabel", args, n );
        XtManageChild( InitialDelayLabel );
        XmStringFree( string );

        n = 0;
        XtSetArg( args[n], XmNvalue, "250" ); n++;
        InitialDelayTF = 
        XmCreateTextField( RowColumn, "InitialDelayTF", args, n );  
        XtManageChild( InitialDelayTF );

        XtAddCallback( InitialDelayTF, XmNactivateCallback,
                       InitialDelayCB, (XtPointer)0 );

      /*
       *  Create label and text field for XmNinitialDelay resource.
       */
        string = XmStringCreateLtoR("Repeat Delay",
                   XmFONTLIST_DEFAULT_TAG );
        n = 0;
        XtSetArg( args[n], XmNlabelString, string ); n++;
        RepeatDelayLabel =
        XmCreateLabel( RowColumn, "RepeatDelayLabel", args, n );
        XtManageChild( RepeatDelayLabel );
        XmStringFree( string );

        n = 0;
        XtSetArg( args[n], XmNvalue, "200" ); n++;
        RepeatDelayTF =
        XmCreateTextField( RowColumn, "RepeatDelayTF", args, n );
        XtManageChild( RepeatDelayTF );

        XtAddCallback( RepeatDelayTF, XmNactivateCallback,
                       RepeatDelayCB, (XtPointer)0 );
     
     return( RowColumn );
}
Example #22
0
void
main(int argc, char **argv)
{
    Widget              Container5, *IconGad;   
    int			i, num_obj;
    Cardinal		n;
    Arg			args[MAX_ARGS];
    char		test_char;
    int                 test_num;
    char		ContainerName[NAME_LEN + 1];

    ContainerName[0] = '\0';
    test_char = '\0';
    test_num = 0;

    CommonTestInit(argc, argv);

    num_obj = 10;

    if (UserData != NULL) {
	
	if (strcmp(UserData, "a") == 0) {
	    num_obj = 4;
	    test_num = 1;
	}

	if (strcmp(UserData, "b") == 0) {
	    num_obj = 5;
	    test_num = 2;
	}
	
	if (strcmp(UserData, "c") == 0) {
	    num_obj = 9;
	    test_num = 3;
	}
	
	if (strcmp(UserData, "d") == 0) {
	    num_obj = 20;
	    test_num = 4;
	}
	
	if (strcmp(UserData, "e") == 0) {
	    num_obj = 4;
	    test_num = 5;
	}
	
	test_char = *UserData;
	
	free(UserData);
	
    }
    sprintf(ContainerName, "Container5%c", test_char);

    n = 0;

    Container5 = XmCreateContainer(Shell1, ContainerName, args, n);
    XtManageChild(Container5);

    XtRealizeWidget(Shell1);

    CommonPause();

    /* Add a bunch of Icon Gadgets */

    IconGad = (Widget*) XtMalloc(NUM_OBJ*sizeof(Widget));

    for (i = 0; i < num_obj; i++) {
	char        IconName[20] ;
	XmString   icon_name;

	n = 0 ;
	sprintf(IconName, "IconGad%d", i);
	icon_name = XmStringGenerate(IconName, NULL, XmCHARSET_TEXT, NULL); 
	XtSetArg(args[n], XmNlabelString, icon_name); n++;
	IconGad[i] = XmCreateIconGadget(Container5, IconName, args, n);
        XtManageChild(IconGad[i]);
	XmStringFree(icon_name);
    }


    CommonPause();

    if (test_num == 0 || test_num == 1) {
    
	/* Set the Spatial Style to None */

	n = 0;
	XtSetArg(args[n], XmNspatialStyle, XmNONE); n++;
	XtSetValues(Container5, args, n);

	CommonPause();

	/* Unmanage all the children - Change the ResizeModel - and Remanage */

	XtUnmanageChildren(IconGad, num_obj);
    
	n = 0;
	XtSetArg(args[n], XmNspatialStyle, XmGRID); n++;
	XtSetArg(args[n], XmNspatialResizeModel, XmGROW_BALANCED); n++;
	XtSetValues(Container5, args, n);

	XtManageChildren(IconGad, num_obj);

	CommonPause();
    }

    if (test_num == 2) {
	int new_obj;

	/* Test the different ResizeModel - Start by adding children with
	   grow_balanced, then add with grow_major and then grow_minor. */

	new_obj = 4;
	for (i = num_obj; i < (num_obj+new_obj); i++) {
	    char        IconName[20] ;
	    XmString   icon_name;

	    n = 0 ;
	    sprintf(IconName, "IconGad%d", i);
	    icon_name = XmStringGenerate(IconName, NULL, XmCHARSET_TEXT, NULL);
	    XtSetArg(args[n], XmNlabelString, icon_name); n++;
	    IconGad[i] = XmCreateIconGadget(Container5, IconName, args, n);
	    XmStringFree(icon_name);
	}

	XtManageChildren(&IconGad[num_obj], new_obj);
	num_obj = num_obj + new_obj;
	
	CommonPause();

	new_obj = 5;
	n = 0;
	XtSetArg(args[n], XmNspatialResizeModel, XmGROW_MAJOR); n++;
	XtSetValues(Container5, args, n);

	for (i = num_obj; i < (num_obj+new_obj); i++) {
	    char        IconName[20] ;
	    XmString   icon_name;

	    n = 0 ;
	    sprintf(IconName, "IconGad%d", i);
	    icon_name = XmStringGenerate(IconName, NULL, XmCHARSET_TEXT, NULL);
	    XtSetArg(args[n], XmNlabelString, icon_name); n++;
	    IconGad[i] = XmCreateIconGadget(Container5, IconName, args, n);
	    XmStringFree(icon_name);
	}

	XtManageChildren(&IconGad[num_obj], new_obj);
	num_obj = num_obj + new_obj;
	
	CommonPause();

	n = 0;
	XtSetArg(args[n], XmNspatialResizeModel, XmGROW_MINOR); n++;
	XtSetValues(Container5, args, n);

	for (i = num_obj; i < (num_obj+new_obj); i++) {
	    char        IconName[20] ;
	    XmString   icon_name;

	    n = 0 ;
	    sprintf(IconName, "IconGad%d", i);
	    icon_name = XmStringGenerate(IconName, NULL, XmCHARSET_TEXT, NULL);
	    XtSetArg(args[n], XmNlabelString, icon_name); n++;
	    IconGad[i] = XmCreateIconGadget(Container5, IconName, args, n);
	    XmStringFree(icon_name);
	}

	XtManageChildren(&IconGad[num_obj], new_obj);
	num_obj = num_obj + new_obj;
	
    }

    if (test_num == 3) {
	char        IconName[20];
	XmString   icon_name;

	/* Change the spatialStyle to GRID */

	n = 0;
	XtSetArg(args[n], XmNspatialStyle, XmGRID); n++;
	XtSetValues(Container5, args, n);

	CommonPause();

	/* Test the spatialIncludeModel 
	   Add some children and check where they go */

	i = num_obj;
	n = 0 ;
	sprintf(IconName, "IconGad%d", i);
	icon_name = XmStringGenerate(IconName, NULL, XmCHARSET_TEXT, NULL);
	XtSetArg(args[n], XmNlabelString, icon_name); n++;
	IconGad[i] = XmCreateIconGadget(Container5, IconName, args, n);
	XmStringFree(icon_name);
	XtManageChild(IconGad[i]);

	CommonPause();

	/* set the spatialIncludeModel to FIRST_FIT */

	n = 0;
	XtSetArg(args[n], XmNspatialIncludeModel, XmFIRST_FIT); n++;
	XtSetValues(Container5, args, n);

	i = num_obj + 1;
	n = 0 ;
	sprintf(IconName, "IconGad%d", i);
	icon_name = XmStringGenerate(IconName, NULL, XmCHARSET_TEXT, NULL);
	XtSetArg(args[n], XmNlabelString, icon_name); n++;
	IconGad[i] = XmCreateIconGadget(Container5, IconName, args, n);
	XmStringFree(icon_name);
	XtManageChild(IconGad[i]);
	
    }

    CommonPause();

    XtAppMainLoop(app_context);

}
Example #23
0
File: main.c Project: fjardon/motif
int 
main(int argc, char *argv[])
{
#define MAIN_CHILDREN		3
#define FORM_CHILDREN		3
#define PLANE_CHILDREN		6
#define TRAFFIC_CHILDREN	3
#define SetMenuEntry(k,l,p,d) labels[k]=l;procs[k]=p;private[k]=d;

   Pixmap flying;
   Pixmap parked;
   Pixmap mask;
   Widget theWidgetRoot;
   Widget main_tab[MAIN_CHILDREN];
   Widget from_tab[PLANE_CHILDREN];
   Widget to_tab[TRAFFIC_CHILDREN];
   Widget form_tab[FORM_CHILDREN];
   Widget framed[2];
   Widget entry;
   static char myClass[] = "XmdAirport";
   Arg args[10];
   int n ;
   String labels[4];
   XtCallbackProc procs[4];
   XtPointer private[4];
   XGCValues gcv;
   Airport this;


/*
 * Initialize
 */
   this = (Airport) XtCalloc(sizeof(AirportRec), 1);

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

   theWidgetRoot = XtVaOpenApplication( &this->context, 
                                        myClass, 
				        NULL, 
                                        0, 
                                        &argc, 
                                        argv, 
                                        NULL,
                                        sessionShellWidgetClass, 
				        XmNallowShellResize, True,
                                        NULL);
   
   this->display = XtDisplay(theWidgetRoot);
   FlightAtom = XmInternAtom(this->display, "FLIGHT", False);
   DeleteAtom = XmInternAtom(this->display, "DELETE", False);

   XtGetApplicationResources(theWidgetRoot, &AirportResources,
			     AirportResourcesSpecs, 
			     XtNumber(AirportResourcesSpecs),
			     (ArgList) NULL, 0);

/*
 * Create the Main Window, the menubar and the pulldown menus
 */
   n = 0;
   this->main = XmCreateMainWindow(theWidgetRoot, "main", args, n);

   n = 0;
   main_tab[0] = XmCreateMenuBar(this->main, "menubar", args, n);
   n = 0;
   SetMenuEntry(n, "Exit", 
		(XtCallbackProc) ExitCallback, (XtPointer) this ); n++;
   entry = MenuBarEntry(main_tab[0], "File", labels, procs, private, n);
   n = 0;
   SetMenuEntry(0, "Tutorial",
		(XtCallbackProc) HelpCallback, (XtPointer) this); n++;
   entry = MenuBarEntry(main_tab[0], "Help", labels, procs, private, n);
   n = 0;
   XtSetArg(args[n], XmNmenuHelpWidget, entry); n++;
   XtSetValues(main_tab[0], args, n);

/*
 * Create the Airport widget structure.
 * Two framed radio boxes show state. 
 * A drawing area in the middle show track and planes
 */

   n = 0;
   this->screen_width = WidthOfScreen(XtScreenOfObject(this->main));
   this->screen_height = HeightOfScreen(XtScreenOfObject(this->main));
   XtSetArg(args[n], XmNwidth, this->screen_width*3/7); n++;
   XtSetArg(args[n], XmNresizePolicy, XmRESIZE_NONE); n++;
   main_tab[1] = XmCreateForm(this->main, "airport", args, n);

   n = 0;
   XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; 
   XtSetArg(args[n], XmNbottomAttachment,XmATTACH_FORM); n++; 
   XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM) ; n++;
   form_tab[0] = XmCreateFrame(main_tab[1], "flight", args, n);

   n = 0;
   XtSetArg(args[n], XmNchildType, XmFRAME_TITLE_CHILD); n++;
   framed[0] = XmCreateLabel(form_tab[0], "title", args, n);
   
   n = 0;
   XtSetArg(args[n], XmNchildType, XmFRAME_WORKAREA_CHILD); n++;
   XtSetArg(args[n], XmNresizePolicy, XmRESIZE_GROW); n++;
   XtSetArg(args[n], XmNradioBehavior, True); n++;
   framed[1] = XmCreateRadioBox(form_tab[0], "panel", args, n);
 
   n = 0;
   XtSetArg(args[n], XmNset, True); n++;
   XtSetArg(args[n], XmNvisibleWhenOff, False); n++;
   this->from.departure =
     from_tab[0] = XmCreateToggleButton(framed[1], 
					       "departure", args, n);
   n = 0;
   XtSetArg(args[n], XmNvisibleWhenOff, False); n++;
   this->from.over_ocean =
     from_tab[1] = XmCreateToggleButton(framed[1], 
					       "over_ocean", args, n);
   n = 0;
   XtSetArg(args[n], XmNvisibleWhenOff, False); n++;
   this->from.over_land =
     from_tab[2] = XmCreateToggleButton(framed[1], 
					       "over_land", args, n);
   n = 0;
   XtSetArg(args[n], XmNvisibleWhenOff, False); n++;
   this->from.over_site =     
     from_tab[3] = XmCreateToggleButton(framed[1],
					       "radar", args, n);
   n = 0;
   XtSetArg(args[n], XmNvisibleWhenOff, False); n++;
   this->from.landing =   
     from_tab[4] = XmCreateToggleButton(framed[1], "landing", args, n);

   n = 0;
   XtSetArg(args[n], XmNvisibleWhenOff, False); n++;
   this->from.landed =     
     from_tab[5] = XmCreateToggleButton(framed[1], "landed", args, n);
   XtManageChildren(from_tab, PLANE_CHILDREN);
   XtManageChildren(framed, 2);

/*
 * Create the Airport Traffic control state
 */

   n = 0;
   XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; 
   XtSetArg(args[n], XmNbottomAttachment,XmATTACH_FORM); n++; 
   XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM) ; n++;
   form_tab[1] = XmCreateFrame(main_tab[1], "traffic", args, n);

   n = 0;
   XtSetArg(args[n], XmNchildType, XmFRAME_TITLE_CHILD); n++;
   framed[0] = XmCreateLabel(form_tab[1], "title", args, n);
   
   n = 0;
   XtSetArg(args[n], XmNchildType, XmFRAME_WORKAREA_CHILD); n++;
   XtSetArg(args[n], XmNradioBehavior, True); n++;
   framed[1] = XmCreateRadioBox(form_tab[1], "traffic_box", args, n);
 
   n = 0;
   XtSetArg(args[n], XmNset, True); n++;
   XtSetArg(args[n], XmNvisibleWhenOff, False); n++;
   this->to.leave =     
     to_tab[1] = XmCreateToggleButton(framed[1],
				      "no_traffic", args, n);
   n = 0;
   XtSetArg(args[n], XmNvisibleWhenOff, False); n++;
   this->to.enter =     
     to_tab[0] = XmCreateToggleButton(framed[1],
				      "radar_echo", args, n);
   n = 0;
   XtSetArg(args[n], XmNvisibleWhenOff, False); n++;
   this->to.landing =   
     to_tab[2] = XmCreateToggleButton(framed[1],
				      "landing", args, n);

   XtManageChildren(to_tab, TRAFFIC_CHILDREN);
   XtManageChildren(framed, 2);

/*
 * Create the Airport picture
 */
   n = 0;
   XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; 
   XtSetArg(args[n], XmNbottomAttachment,XmATTACH_FORM); n++; 
   XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET) ; n++;
   XtSetArg(args[n], XmNleftWidget, form_tab[0]) ; n++;
   XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET) ; n++;
   XtSetArg(args[n], XmNrightWidget, form_tab[1]) ; n++;
   this->airport = 
     form_tab[2] = XmCreateDrawingArea(main_tab[1], "da", args, n);
   XtAddCallback(this->airport, XmNexposeCallback,
		 (XtCallbackProc) ShowAirport, (XtPointer) this);
   XtAddCallback(this->airport, XmNresizeCallback,
		 (XtCallbackProc) ResizeAirport, (XtPointer) this);
   XtAddCallback(this->airport, XmNinputCallback,
		 (XtCallbackProc) AirportInput, (XtPointer) this);
/*
 * Create the Airport Message area
 */
	
   n = 0;
   main_tab[2] = XmCreateFrame(this->main, "message", args, n);

   n = 0;
   XtSetArg(args[n], XmNchildType, XmFRAME_TITLE_CHILD); n++;
   framed[0] = XmCreateLabel(main_tab[2], "title", args, n);
   
   n = 0;
   XtSetArg(args[n], XmNchildType, XmFRAME_WORKAREA_CHILD); n++;
   XtSetArg(args[n], XmNvisibleItemCount, 4); n++;
   this->msg_area = XmCreateScrolledList(main_tab[2], "msg_list", args, n);
   XtManageChild(this->msg_area);
   framed[1] = XtParent(this->msg_area);
   XtManageChildren(framed, 2);

   n = 0;
   XtSetArg(args[n], XmNmenuBar, main_tab[0]); n++;
   XtSetArg(args[n], XmNworkWindow, main_tab[1]); n++;
   XtSetArg(args[n], XmNmessageWindow, main_tab[2]); n++;
   XtSetValues(this->main, args, n);
   XtManageChildren(form_tab, FORM_CHILDREN);
   XtManageChildren(main_tab, MAIN_CHILDREN);
   XtManageChild(this->main);

   XtRealizeWidget(theWidgetRoot);
   
/* 
 * Create the drag icon
 */

   parked = XCreateBitmapFromData(this->display,
			   XtWindow(this->main), (char*)plane_bits,
			   plane_width, plane_height);

   flying = XCreateBitmapFromData(this->display,
				  XtWindow(this->main), (char*)flying_bits, 
				  flying_icon_width, flying_icon_height);

   mask = XCreateBitmapFromData(this->display, 
				XtWindow(this->main), (char*)flying_mask_bits, 
				flying_mask_width, flying_mask_height);
   n = 0;
   XtSetArg(args[n], XmNpixmap, flying); n++;
   XtSetArg(args[n], XmNdepth, 1); n++;
   XtSetArg(args[n], XmNmask, mask); n++; 
   XtSetArg(args[n], XmNwidth, flying_icon_width); n++;
   XtSetArg(args[n], XmNheight, flying_icon_height) ; n++;
   this->dragIcon = XmCreateDragIcon(form_tab[2], "drag", args, n);
   if (this->dragIcon  == NULL) {
      printf("cannot create drag icon\n");
      exit(0);
   }
  /* Create GC for drawing planes */
   gcv.function = GXcopy;
   gcv.fill_style = FillOpaqueStippled;
   gcv.stipple = parked;
   gcv.foreground = AirportResources.spot_foreground; 
   gcv.background = AirportResources.spot_background; 
   this->park.gc = XCreateGC(this->display, XtWindow(this->main), 
			     GCFunction|GCStipple|GCFillStyle
			     |GCForeground|GCBackground,
			     &gcv);
   
   gcv.line_style = LineDoubleDash;
   gcv.line_width = AirportResources.track_border_width;
   gcv.fill_style = FillSolid;
   gcv.foreground = AirportResources.track_foreground; 
   gcv.background = AirportResources.track_background; 
   this->track.gc = XCreateGC(this->display, XtWindow(this->main), 
			      GCFunction|GCLineWidth|GCLineStyle
			      |GCFillStyle|GCForeground|GCBackground,
			      &gcv);
   XtAppMainLoop(this->context);

   return 0;    /* make compiler happy */
}
Example #24
0
////////////////////////////////////////////////////////////////////////
//
// Description:
//	This creates the tracking rate preference sheet stuff.
//
// Use: protected
Widget
InvFullViewer::createTrackingPrefSheetGuts(Widget parent)
//
////////////////////////////////////////////////////////////////////////
{
    Widget label, thumb, text, device, devicem, devices[6];
    Arg args[12];
    XmString string;
    int n;

    // create a form to hold everything together
    Widget form = XtCreateWidget("", xmFormWidgetClass,
                                 parent, NULL, 0);

    // create device choice
    devicem = XmCreatePulldownMenu(form, (char *)"trackingmenu", NULL, 0);
    devices[0] = XmCreatePushButtonGadget(devicem, (char *)"Logitec on com1", NULL, 0);
    devices[1] = XmCreatePushButtonGadget(devicem, (char *)"Logitec on com2", NULL, 0);
    devices[2] = XmCreatePushButtonGadget(devicem, (char *)"Fastrak on com1", NULL, 0);
    devices[3] = XmCreatePushButtonGadget(devicem, (char *)"Fastrak on com2", NULL, 0);
    devices[4] = XmCreatePushButtonGadget(devicem, (char *)"Fastrak on com3", NULL, 0);
    devices[5] = XmCreatePushButtonGadget(devicem, (char *)"Fastrak on com4", NULL, 0);
    XtAddCallback(devices[0], XmNactivateCallback,
                  (XtCallbackProc)InvFullViewer::trackingDevice1CB, (XtPointer) this);
    XtAddCallback(devices[1], XmNactivateCallback,
                  (XtCallbackProc)InvFullViewer::trackingDevice2CB, (XtPointer) this);
    XtAddCallback(devices[2], XmNactivateCallback,
                  (XtCallbackProc)InvFullViewer::trackingDevice3CB, (XtPointer) this);
    XtAddCallback(devices[3], XmNactivateCallback,
                  (XtCallbackProc)InvFullViewer::trackingDevice4CB, (XtPointer) this);
    XtAddCallback(devices[4], XmNactivateCallback,
                  (XtCallbackProc)InvFullViewer::trackingDevice5CB, (XtPointer) this);
    XtAddCallback(devices[5], XmNactivateCallback,
                  (XtCallbackProc)InvFullViewer::trackingDevice6CB, (XtPointer) this);
    XtManageChildren(devices, 6);
    string = XmStringCreate((char *)"xxTrackingdevices:", (XmStringCharSet)XmSTRING_DEFAULT_CHARSET);
    n = 0;
    XtSetArg(args[n], XmNlabelString, string);
    n++;
    XtSetArg(args[n], XmNsubMenuId, devicem);
    n++;
    device = XmCreateOptionMenu(form, (char *)"trackingoption", args, n);

    // create the label
    label = XtCreateWidget("Tracking rate:", xmLabelGadgetClass,
                           form, NULL, 0);

    // allocate the thumbwheel
    n = 0;
    XtSetArg(args[n], XmNvalue, 110);
    n++;
    XtSetArg(args[n], SgNangleRange, 720);
    n++;
    XtSetArg(args[n], XmNmaximum, 1010);
    n++;
    XtSetArg(args[n], XmNminimum, 10);
    n++;
    // XtSetArg(args[n], SgNunitsPerRotation, 1000); n++;
    XtSetArg(args[n], SgNshowHomeButton, FALSE);
    n++;
    XtSetArg(args[n], XmNhighlightThickness, 0);
    n++;
    XtSetArg(args[n], XmNorientation, XmHORIZONTAL);
    n++;
    trackingWheel = thumb = SgCreateThumbWheel(form, (char *)"", args, n);

    XtAddCallback(thumb, XmNvalueChangedCallback,
                  (XtCallbackProc)InvFullViewer::trackingWheelCB, (XtPointer) this);
    // XtAddCallback(thumb, XmNdragCallback,
    //     (XtCallbackProc) InvFullViewer::trackingWheelCB, (XtPointer) this);

    // allocate the text field
    n = 0;
    char str[15];
    sprintf(str, "%.6f", trackingWheelVal);
    XtSetArg(args[n], XmNvalue, str);
    n++;
    XtSetArg(args[n], XmNhighlightThickness, 1);
    n++;
    XtSetArg(args[n], XmNcolumns, 8);
    n++;
    trackingField = text = XtCreateWidget("", xmTextWidgetClass,
                                          form, args, n);
    XtAddCallback(text, XmNactivateCallback,
                  (XtCallbackProc)InvFullViewer::trackingFieldCB,
                  (XtPointer) this);

    // layout

    n = 0;
    XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);
    n++;
    XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);
    n++;
    XtSetValues(text, args, n);

    n = 0;
    XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET);
    n++;
    XtSetArg(args[n], XmNbottomWidget, text);
    n++;
    XtSetArg(args[n], XmNbottomOffset, 3);
    n++;
    XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET);
    n++;
    XtSetArg(args[n], XmNrightWidget, text);
    n++;
    XtSetArg(args[n], XmNrightOffset, 3);
    n++;
    XtSetValues(thumb, args, n);

    n = 0;
    XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET);
    n++;
    XtSetArg(args[n], XmNbottomWidget, thumb);
    n++;
    XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET);
    n++;
    XtSetArg(args[n], XmNrightWidget, thumb);
    n++;
    XtSetArg(args[n], XmNrightOffset, 5);
    n++;
    XtSetValues(label, args, n);

    n = 0;
    XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);
    n++;
    XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET);
    n++;
    XtSetArg(args[n], XmNtopWidget, thumb);
    n++;
    XtSetArg(args[n], XmNtopOffset, 3);
    n++;
    XtSetValues(device, args, n);

    // manage children
    XtManageChild(text);
    XtManageChild(thumb);
    XtManageChild(label);
    XtManageChild(device);
    return form;
}
Example #25
0
void create_col_collector_shell (Widget parent)
{
	Widget children[27];      /* Children to manage */
	Arg al[64];                    /* Arg List */
	register int ac = 0;           /* Arg Count */
	Widget widget110 = (Widget)NULL;
	Widget widget111 = (Widget)NULL;
	Widget widget124 = (Widget)NULL;
	Widget widget129 = (Widget)NULL;
	Widget widget158 = (Widget)NULL;

	XtSetArg(al[ac], XmNtitle, "Arbor COL_COLLECTOR"); ac++;
	XtSetArg(al[ac], XmNiconName, "COL_COLLECTOR"); ac++;
	col_collector_shell = XtCreatePopupShell ( "col_collector_shell", topLevelShellWidgetClass, parent, al, ac );
	ac = 0;
/* begin pre-creation code */

XtVaSetValues(col_collector_shell, XmNiconPixmap, abp_icon, NULL) ;

/* end pre-creation code */

	col_collector_form = XmCreateForm ( col_collector_shell, "col_collector_form", al, ac );
	ac = 0;
	col_collector_summ_form = XmCreateForm ( col_collector_form, "col_collector_summ_form", al, ac );
	col_collector_list_label = XmCreateLabel ( col_collector_summ_form, "col_collector_list_label", al, ac );
	XtSetArg(al[ac], XmNvisibleItemCount, 8); ac++;
	col_collector_summlist = XmCreateScrolledList ( col_collector_summ_form, "col_collector_summlist", al, ac );
	ac = 0;
	widget110 = XtParent ( col_collector_summlist );

	XtSetArg(al[ac], XmNhorizontalScrollBar, &widget111 ); ac++;
	XtGetValues(widget110, al, ac );
	ac = 0;
	col_collector_list_labels2 = XmCreateLabel ( col_collector_summ_form, "col_collector_list_label2", al, ac );
	col_collector_button_form = XmCreateForm ( col_collector_form, "col_collector_button_form", al, ac );
	col_collector_save_btn = XmCreatePushButton ( col_collector_button_form, "col_collector_save_btn", al, ac );
	col_collector_clear_btn = XmCreatePushButton ( col_collector_button_form, "col_collector_clear_btn", al, ac );
	col_collector_update_btn = XmCreatePushButton ( col_collector_button_form, "col_collector_update_btn", al, ac );
	col_collector_close_btn = XmCreatePushButton ( col_collector_button_form, "col_collector_close_btn", al, ac );
	col_collector_delete_btn = XmCreatePushButton ( col_collector_button_form, "col_collector_delete_btn", al, ac );
	col_collector_scripts_btn = XmCreatePushButton ( col_collector_button_form, "col_collector_scripts_btn", al, ac );
	XtSetArg(al[ac], XmNshadowThickness, 2); ac++;
	col_collector_tgl_form = XmCreateForm ( col_collector_form, "col_collector_tgl_form", al, ac );
	ac = 0;
	col_collector_edit_mode_label = XmCreateLabel ( col_collector_tgl_form, "col_collector_edit_mode_label", al, ac );
	XtSetArg(al[ac], XmNnumColumns, 3); ac++;
	XtSetArg(al[ac], XmNpacking, XmPACK_TIGHT); ac++;
	widget124 = XmCreateRadioBox ( col_collector_tgl_form, "widget124", al, ac );
	ac = 0;
	col_collector_create_toggle = XmCreateToggleButtonGadget ( widget124, "col_collector_create_toggle", al, ac );
	col_collector_modify_toggle = XmCreateToggleButtonGadget ( widget124, "col_collector_modify_toggle", al, ac );
	col_collector_delete_toggle = XmCreateToggleButtonGadget ( widget124, "col_collector_delete_toggle", al, ac );
	col_collector_view_toggle = XmCreateToggleButtonGadget ( widget124, "col_collector_view_toggle", al, ac );
	widget129 = XmCreateForm ( col_collector_form, "widget129", al, ac );
	XtSetArg(al[ac], XmNshadowThickness, 2); ac++;
	col_collector_detailform = XmCreateForm ( widget129, "col_collector_detailform", al, ac );
	ac = 0;
	col_collector_collector_id_label = XmCreateLabel ( col_collector_detailform, "col_collector_collector_id_label", al, ac );
	XtSetArg(al[ac], XmNmaxLength, 5); ac++;
	XtSetArg(al[ac], XmNcolumns, 7); ac++;
	col_collector_collector_id_text = XmCreateText ( col_collector_detailform, "col_collector_collector_id_text", al, ac );
	ac = 0;
	col_collector_group_id_label = XmCreateLabel ( col_collector_detailform, "col_collector_group_id_label", al, ac );
	XtSetArg(al[ac], XmNmaxLength, 5); ac++;
	XtSetArg(al[ac], XmNcolumns, 7); ac++;
	col_collector_group_id_text = XmCreateText ( col_collector_detailform, "col_collector_group_id_text", al, ac );
	ac = 0;
	col_collector_group_id_btn = XmCreatePushButton ( col_collector_detailform, "col_collector_group_id_btn", al, ac );
	col_collector_first_name_label = XmCreateLabel ( col_collector_detailform, "col_collector_first_name_label", al, ac );
	XtSetArg(al[ac], XmNmaxLength, 28); ac++;
	XtSetArg(al[ac], XmNcolumns, 31); ac++;
	col_collector_first_name_text = XmCreateText ( col_collector_detailform, "col_collector_first_name_text", al, ac );
	ac = 0;
	col_collector_last_name_label = XmCreateLabel ( col_collector_detailform, "col_collector_last_name_label", al, ac );
	XtSetArg(al[ac], XmNmaxLength, 28); ac++;
	col_collector_last_name_text = XmCreateText ( col_collector_detailform, "col_collector_last_name_text", al, ac );
	ac = 0;
	col_collector_company_label = XmCreateLabel ( col_collector_detailform, "col_collector_company_label", al, ac );
	XtSetArg(al[ac], XmNmaxLength, 75); ac++;
	XtSetArg(al[ac], XmNcolumns, 79); ac++;
	col_collector_company_text = XmCreateText ( col_collector_detailform, "col_collector_company_text", al, ac );
	ac = 0;
	col_collector_address1_label = XmCreateLabel ( col_collector_detailform, "col_collector_address1_label", al, ac );
	XtSetArg(al[ac], XmNmaxLength, 75); ac++;
	XtSetArg(al[ac], XmNcolumns, 79); ac++;
	col_collector_address1_text = XmCreateText ( col_collector_detailform, "col_collector_address1_text", al, ac );
	ac = 0;
	col_collector_address2_label = XmCreateLabel ( col_collector_detailform, "col_collector_address2_label", al, ac );
	XtSetArg(al[ac], XmNmaxLength, 75); ac++;
	XtSetArg(al[ac], XmNcolumns, 79); ac++;
	col_collector_address2_text = XmCreateText ( col_collector_detailform, "col_collector_address2_text", al, ac );
	ac = 0;
	col_collector_address3_label = XmCreateLabel ( col_collector_detailform, "col_collector_address3_label", al, ac );
	XtSetArg(al[ac], XmNmaxLength, 75); ac++;
	XtSetArg(al[ac], XmNcolumns, 79); ac++;
	col_collector_address3_text = XmCreateText ( col_collector_detailform, "col_collector_address3_text", al, ac );
	ac = 0;
	col_collector_city_label = XmCreateLabel ( col_collector_detailform, "col_collector_city_label", al, ac );
	XtSetArg(al[ac], XmNmaxLength, 26); ac++;
	XtSetArg(al[ac], XmNcolumns, 26); ac++;
	col_collector_city_text = XmCreateText ( col_collector_detailform, "col_collector_city_text", al, ac );
	ac = 0;
	col_collector_state_label = XmCreateLabel ( col_collector_detailform, "col_collector_state_label", al, ac );
	XtSetArg(al[ac], XmNmaxLength, 28); ac++;
	XtSetArg(al[ac], XmNcolumns, 27); ac++;
	col_collector_state_text = XmCreateText ( col_collector_detailform, "col_collector_state_text", al, ac );
	ac = 0;
	col_collector_zip_label = XmCreateLabel ( col_collector_detailform, "col_collector_zip_label", al, ac );
	XtSetArg(al[ac], XmNmaxLength, 16); ac++;
	XtSetArg(al[ac], XmNcolumns, 26); ac++;
	col_collector_zip_text = XmCreateText ( col_collector_detailform, "col_collector_zip_text", al, ac );
	ac = 0;
	col_collector_phone_label = XmCreateLabel ( col_collector_detailform, "col_collector_phone_label", al, ac );
	XtSetArg(al[ac], XmNmaxLength, 20); ac++;
	XtSetArg(al[ac], XmNcolumns, 26); ac++;
	col_collector_phone_text = XmCreateText ( col_collector_detailform, "col_collector_phone_text", al, ac );
	ac = 0;
	col_collector_active_flag_label = XmCreateLabel ( col_collector_detailform, "col_collector_active_flag_label", al, ac );
	XtSetArg(al[ac], XmNmaxLength, 1); ac++;
	XtSetArg(al[ac], XmNcolumns, 2); ac++;
	col_collector_active_flag_text = XmCreateText ( col_collector_detailform, "col_collector_active_flag_text", al, ac );
	ac = 0;
	widget158 = XmCreateLabel ( widget129, "mps_detail_label", al, ac );

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 50); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -228); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -704); ac++;
	XtSetValues ( col_collector_summ_form,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 4); ac++;
	XtSetArg(al[ac], XmNtopWidget, widget129); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 4); ac++;
	XtSetValues ( col_collector_button_form,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 8); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -48); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -432); ac++;
	XtSetValues ( col_collector_tgl_form,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopOffset, 4); ac++;
	XtSetArg(al[ac], XmNtopWidget, col_collector_summ_form); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -532); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 4); ac++;
	XtSetValues ( widget129,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -16); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 4); ac++;
	XtSetValues ( col_collector_list_label,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 35); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 4); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 4); ac++;
	XtSetValues ( widget110,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 16); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 4); ac++;
	XtSetValues ( col_collector_list_labels2,al, ac );
	ac = 0;
	XtAddCallback (col_collector_summlist, XmNsingleSelectionCallback, col_collector_summlist_cb,NULL);
	XtManageChild(col_collector_summlist);
	children[ac++] = col_collector_list_label;
	children[ac++] = col_collector_list_labels2;
	XtManageChildren(children, ac);
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNleftPosition, 8); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNrightPosition, 23); ac++;
	XtSetValues ( col_collector_save_btn,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNleftPosition, 31); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNrightPosition, 46); ac++;
	XtSetValues ( col_collector_clear_btn,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNleftPosition, 8); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNrightPosition, 23); ac++;
	XtSetValues ( col_collector_update_btn,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNleftPosition, 77); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNrightPosition, 92); ac++;
	XtSetValues ( col_collector_close_btn,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNleftPosition, 8); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNrightPosition, 23); ac++;
	XtSetValues ( col_collector_delete_btn,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNleftPosition, 54); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
	XtSetArg(al[ac], XmNrightPosition, 69); ac++;
	XtSetValues ( col_collector_scripts_btn,al, ac );
	ac = 0;
	XtAddCallback (col_collector_save_btn, XmNactivateCallback, col_collector_save_btn_cb,NULL);
	XtAddCallback (col_collector_clear_btn, XmNactivateCallback, col_collector_clear_btn_cb,NULL);
	XtAddCallback (col_collector_update_btn, XmNactivateCallback, col_collector_update_btn_cb,NULL);
	XtAddCallback (col_collector_close_btn, XmNactivateCallback, col_collector_close_btn_cb,NULL);
	XtAddCallback (col_collector_delete_btn, XmNactivateCallback, col_collector_delete_btn_cb,col_collector_shell);
	XtAddCallback (col_collector_scripts_btn, XmNactivateCallback, col_collector_scripts_btn_cb,col_collector_shell);
	children[ac++] = col_collector_save_btn;
	children[ac++] = col_collector_clear_btn;
	children[ac++] = col_collector_update_btn;
	children[ac++] = col_collector_close_btn;
	children[ac++] = col_collector_delete_btn;
	children[ac++] = col_collector_scripts_btn;
	XtManageChildren(children, ac);
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 4); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -36); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -92); ac++;
	XtSetValues ( col_collector_edit_mode_label,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 4); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -36); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 92); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -424); ac++;
	XtSetValues ( widget124,al, ac );
	ac = 0;
	XtAddCallback (col_collector_create_toggle, XmNarmCallback, col_collector_create_toggle_cb,NULL);
	XtAddCallback (col_collector_modify_toggle, XmNarmCallback, col_collector_modify_toggle_cb,NULL);
	XtAddCallback (col_collector_delete_toggle, XmNarmCallback, col_collector_delete_toggle_cb,NULL);
	XtAddCallback (col_collector_view_toggle, XmNarmCallback, col_collector_view_toggle_cb,NULL);
	children[ac++] = col_collector_create_toggle;
	children[ac++] = col_collector_modify_toggle;
	children[ac++] = col_collector_delete_toggle;
	children[ac++] = col_collector_view_toggle;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = col_collector_edit_mode_label;
	children[ac++] = widget124;
	XtManageChildren(children, ac);
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 24); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 4); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 4); ac++;
	XtSetValues ( col_collector_detailform,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 4); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
	XtSetValues ( widget158,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 4); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -28); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -84); ac++;
	XtSetValues ( col_collector_collector_id_label,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 4); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -28); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 84); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -148); ac++;
	XtSetValues ( col_collector_collector_id_text,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 4); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -28); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 324); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -440); ac++;
	XtSetValues ( col_collector_group_id_label,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 4); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -28); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 440); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -508); ac++;
	XtSetValues ( col_collector_group_id_text,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 4); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -28); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 508); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -532); ac++;
	XtSetValues ( col_collector_group_id_btn,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 32); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -56); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -84); ac++;
	XtSetValues ( col_collector_first_name_label,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 32); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -56); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 84); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -316); ac++;
	XtSetValues ( col_collector_first_name_text,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 32); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -56); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 324); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -440); ac++;
	XtSetValues ( col_collector_last_name_label,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 32); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -56); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 440); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -652); ac++;
	XtSetValues ( col_collector_last_name_text,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 60); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -84); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -84); ac++;
	XtSetValues ( col_collector_company_label,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 60); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -84); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 84); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -652); ac++;
	XtSetValues ( col_collector_company_text,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 88); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -112); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -84); ac++;
	XtSetValues ( col_collector_address1_label,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 88); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -112); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 84); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -652); ac++;
	XtSetValues ( col_collector_address1_text,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 116); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -140); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -84); ac++;
	XtSetValues ( col_collector_address2_label,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 116); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -140); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 84); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -652); ac++;
	XtSetValues ( col_collector_address2_text,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 144); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -168); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -84); ac++;
	XtSetValues ( col_collector_address3_label,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 144); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -168); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 84); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -652); ac++;
	XtSetValues ( col_collector_address3_text,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 172); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -196); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -84); ac++;
	XtSetValues ( col_collector_city_label,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 172); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -196); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 84); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -280); ac++;
	XtSetValues ( col_collector_city_text,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 172); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -196); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 336); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -408); ac++;
	XtSetValues ( col_collector_state_label,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 172); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -196); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 408); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -616); ac++;
	XtSetValues ( col_collector_state_text,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 200); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -224); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -84); ac++;
	XtSetValues ( col_collector_zip_label,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 200); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -224); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 84); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -280); ac++;
	XtSetValues ( col_collector_zip_text,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 228); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -252); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 4); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -84); ac++;
	XtSetValues ( col_collector_phone_label,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 228); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -252); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 84); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -280); ac++;
	XtSetValues ( col_collector_phone_text,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 228); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -252); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 336); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -408); ac++;
	XtSetValues ( col_collector_active_flag_label,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 228); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, -252); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 408); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_OPPOSITE_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, -440); ac++;
	XtSetValues ( col_collector_active_flag_text,al, ac );
	ac = 0;
	children[ac++] = col_collector_collector_id_label;
	children[ac++] = col_collector_collector_id_text;
	children[ac++] = col_collector_group_id_label;
	children[ac++] = col_collector_group_id_text;
	children[ac++] = col_collector_group_id_btn;
	children[ac++] = col_collector_first_name_label;
	children[ac++] = col_collector_first_name_text;
	children[ac++] = col_collector_last_name_label;
	children[ac++] = col_collector_last_name_text;
	children[ac++] = col_collector_company_label;
	children[ac++] = col_collector_company_text;
	children[ac++] = col_collector_address1_label;
	children[ac++] = col_collector_address1_text;
	children[ac++] = col_collector_address2_label;
	children[ac++] = col_collector_address2_text;
	children[ac++] = col_collector_address3_label;
	children[ac++] = col_collector_address3_text;
	children[ac++] = col_collector_city_label;
	children[ac++] = col_collector_city_text;
	children[ac++] = col_collector_state_label;
	children[ac++] = col_collector_state_text;
	children[ac++] = col_collector_zip_label;
	children[ac++] = col_collector_zip_text;
	children[ac++] = col_collector_phone_label;
	children[ac++] = col_collector_phone_text;
	children[ac++] = col_collector_active_flag_label;
	children[ac++] = col_collector_active_flag_text;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = col_collector_detailform;
	children[ac++] = widget158;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = col_collector_summ_form;
	children[ac++] = col_collector_button_form;
	children[ac++] = col_collector_tgl_form;
	children[ac++] = widget129;
	XtManageChildren(children, ac);
	ac = 0;
	XtManageChild ( col_collector_form);
}
Example #26
0
main(int argc, char **argv)
{
	Widget shell, rowcolumn, scale, pushbutton, label1, label2, text;
	Widget paned, text2;
	int n, i;
	Widget widlist[100];
	Widget emacscli[100];
	Arg args[100];
	int no_ews = 1;
	char buf[100];

	if (argc > 1)
		no_ews = atoi(argv[1]);

	shell = XtAppInitialize(&xt_app_con, "Testmotif", NULL, 0,
				&argc, argv, NULL, NULL, 0);

	rowcolumn = XmCreateRowColumn(shell, "rowcolumn", NULL, 0);
	XtManageChild(rowcolumn);

	n = 0;
	XtSetArg(args[n], XmNtraversalOn, TRUE);
	n++;
#if 0
	label1 = XmCreateLabel(rowcolumn, "label1", args, n);
#endif
	label1 = XtVaCreateWidget("label1", xmLabelWidgetClass, rowcolumn,
				  XmNwidth, 50, XmNheight, 30,
				  XmNtraversalOn, TRUE, NULL);
	label2 = XmCreateLabel(rowcolumn, "label2", NULL, 0);
	scale = XmCreateScale(rowcolumn, "scale", NULL, 0);
	XtAddCallback(scale, XmNvalueChangedCallback, ScaleValueChangedCB,
		      label1);
	paned = XmCreatePanedWindow(rowcolumn, "paned", NULL, 0);
	n = 0;
	widlist[n++] = label1;
	widlist[n++] = label2;
	widlist[n++] = scale;
	widlist[n++] = paned;
	XtManageChildren(widlist, n);

	pushbutton = XmCreatePushButton(paned, "pushbutton", NULL, 0);
	text = XmCreateText(paned, "text", NULL, 0);
	for (i = 0; i < no_ews; i++) {
		int sz = snprintf(buf, sizeof(buf), "extcli%d", i);
		assert(sz>=0 && sz < sizeof(buf));
		emacscli[i] =
		    XtVaCreateWidget(buf, externalClientWidgetClass, paned,
				     XmNwidth, 500, XmNheight, 200,
				     XmNtraversalOn, TRUE,
				     NULL);
	}
	text2 = XmCreateText(paned, "text2", NULL, 0);
	n = 0;
	widlist[n++] = pushbutton;
	widlist[n++] = text;
	for (i = 0; i < no_ews; i++)
		widlist[n++] = emacscli[i];
	widlist[n++] = text2;
	XtManageChildren(widlist, n);

	XtRealizeWidget(shell);

	{
		XmString lab;
		char labarr[1000];
		char tmpbuf[50];

		strcpy(labarr, "window:");
		for (i = 0; i < no_ews; i++) {
			int sz = snprintf(tmpbuf, sizeof(tmpbuf),
					  " %d", XtWindow(emacscli[i]));
			assert(sz>=0 && sz<sizeof(tmpbuf));
			strcat(labarr, tmpbuf);
		}
		lab = XmStringCreateLocalized(labarr);
		XtVaSetValues(label2, XmNlabelString, lab, NULL);
		XmStringFree(lab);
	}

	XtAppMainLoop(xt_app_con);
}
Example #27
0
int
run_main (int argc, ACE_TCHAR *argv[])
{
  ACE_START_TEST (ACE_TEXT ("XtMotifReactor_Test"));

  XtAppContext app_context;
  Widget topLevel, goodbye, PressMe, lbl, digits_rc;
  Widget children[5];

#if defined (HummingBird_X)
  HCLXmInit ();
#endif /* HummingBird_X */
  topLevel = XtVaAppInitialize (&app_context,
                                "XTReactor_Test",
                                0,
                                0,
                                &argc,
                                argv,
                                0,
                                static_cast<void *>(0));

  digits_rc = create_box(topLevel, "digits_rc");

  //"Stop Test" button.
  goodbye = XtCreateWidget ( (char *) "goodbye",
                             BUTTON_WIDGET,
                             digits_rc,
                             0,
                             0);
  set_label(goodbye, "Stop Test");

  //"Press Me" button
  PressMe = XtCreateWidget ((char *) "PressMe",
                            BUTTON_WIDGET,
                            digits_rc,
                            0,
                            0);

  //Display for event counter
  lbl = XtCreateWidget ((char *) "label_for_event_one",
                        LABEL_WIDGET,
                        digits_rc,
                        0,
                        0);
  set_label(lbl, "label_for_all_events");
  int ac = 0;
  children[ac++] = goodbye;
  children[ac++] = PressMe;
  children[ac++] = lbl;
  XtManageChildren (children, ac);
  XtManageChild (digits_rc);

  //Register callback for "Stop Test" button
  XtAddCallback (goodbye, PRESS_ME_CALLBACK, Quit, 0);

  //Register callback for "Press Me" button
  XtAddCallback (PressMe,
                 PRESS_ME_CALLBACK,
                 inc_count,
                 (XtPointer) lbl);

  // Register callback for X Timer
  (void) XtAppAddTimeOut (app_context,
                          1000,
                          inc_tmo,
                          (XtPointer) lbl);

  XtRealizeWidget (topLevel);

  // It will perform X Main Loop
  ACE_XtReactor reactor (app_context);

  ACE_Reactor r (&reactor);

  //Event Handler for ACE Timer.
  EV_handler evh;

  ACE_Acceptor <Connection_Handler, ACE_SOCK_ACCEPTOR> acceptor;

  if (acceptor.open (ACE_INET_Addr ((u_short) SERV_TCP_PORT),
                     &r) == -1)
    ACE_ERROR_RETURN ((LM_ERROR,
                       "%p\n",
                       "open"),
                      -1);

  if (reactor.schedule_timer (&evh,
                              (const void *) lbl,
                              ACE_Time_Value (2),
                              ACE_Time_Value (2))==-1)
    ACE_ERROR_RETURN ((LM_ERROR,
                       " (%P|%t) can't register with reactor\n"),
                      -1);

  ACE_Thread_Manager::instance ()->spawn ((ACE_THR_FUNC) client,
                                          0,
                                          THR_NEW_LWP | THR_DETACHED);

  XtAppMainLoop (XtWidgetToApplicationContext (topLevel));

  ACE_END_TEST;
  return 0;
}
Example #28
0
extern void
build_dssw(
	DSSW 		*dssw, 
	Calendar 	*c, 
	Widget 		 parent, 
	Boolean 	 show_notime, 
	Boolean 	 show_allday)
{
	Props		*p;
	DisplayType	 dt;
	Arg		 args[20];
	int		 n;
	Dimension	max_left_label_width;
	Widget		child[2];
	XmString	label_str;
	Dimension	highest, widest;
	Widget		prev, curr;
	Dimension	_toLabel, _toText, _toMenu, _toRC;

	dssw->cal = c;
	dssw->parent = parent;
	p = (Props *)c->properties;

	dt = get_int_prop(p, CP_DEFAULTDISP);

	dssw->show_notime_selection = show_notime;
	dssw->show_allday_selection = show_allday;

	/*
	**  One form manager for the widget
	*/
	dssw->dssw_form_mgr = XtVaCreateWidget("dssw_form_mgr",
		xmFormWidgetClass, 	parent,
		XmNautoUnmanage, 	False,
		NULL);

	label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 828, "Date:"));
        dssw->date_label = XtVaCreateWidget("date_label",
		xmLabelGadgetClass, 	dssw->dssw_form_mgr,
		XmNlabelString,		label_str,
                NULL);
	XmStringFree(label_str);

	label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 829, "Start:"));
        dssw->start_label = XtVaCreateWidget("start_label",
		xmLabelGadgetClass, 	dssw->dssw_form_mgr,
		XmNlabelString,		label_str,
                NULL);
	XmStringFree(label_str);

	label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 832, "End:"));
        dssw->stop_label = XtVaCreateWidget("stop_label",
		xmLabelGadgetClass, 	dssw->dssw_form_mgr,
		XmNlabelString,		label_str,
                NULL);
	XmStringFree(label_str);

	label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 835, "What:"));
        dssw->what_label = XtVaCreateWidget("what_label",
		xmLabelGadgetClass, 	dssw->dssw_form_mgr,
		XmNlabelString,		label_str,
                NULL);
	XmStringFree(label_str);
 
        dssw->date_text = XtVaCreateWidget("date_text",
		xmTextWidgetClass, 	dssw->dssw_form_mgr,
                XmNeditMode, 		XmSINGLE_LINE_EDIT,
		XmNmaxLength, 		DATE_LEN - 1,
                NULL);
 
	/*
	**  Radio button behavior for AM/PM selection for start time
	*/
	dssw->start_text = XtVaCreateWidget("start_text",
		xmTextWidgetClass, 	dssw->dssw_form_mgr,
		XmNeditMode, 		XmSINGLE_LINE_EDIT,
		XmNmaxLength, 		START_STOP_LEN - 1,
		NULL);

        dssw->start_menu = create_start_stop_time_menu(dssw->dssw_form_mgr,
		NULL, dssw_set_start_hour, (XtPointer)dssw, p, show_notime, 
		show_allday, &dssw->start_menu_widget_list, 
		&dssw->start_menu_widget_count);

	XtVaSetValues(dssw->start_menu,
		XmNnavigationType, 	XmTAB_GROUP,
		NULL);

        dssw->start_ampm_rc_mgr = XtVaCreateWidget("start_ampm_rc_mgr",
		xmRowColumnWidgetClass, dssw->dssw_form_mgr,
		XmNpacking, 		XmPACK_COLUMN,
		XmNorientation, 	XmHORIZONTAL,
		XmNradioBehavior, 	True,
		XmNisHomogeneous, 	True,
		XmNentryClass, 		xmToggleButtonGadgetClass,
		NULL);

	label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 830, "AM"));
        child[0] = dssw->start_am = XtVaCreateWidget("start_am",
		xmToggleButtonGadgetClass, dssw->start_ampm_rc_mgr,
		XmNlabelString,		label_str,
		XmNsensitive, 		(dt == HOUR12) ? True : False,
		NULL);      
	XmStringFree(label_str);

	label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 831, "PM"));
        child[1] = dssw->start_pm = XtVaCreateWidget("start_pm",
		xmToggleButtonGadgetClass, dssw->start_ampm_rc_mgr,
		XmNlabelString,		label_str,
		XmNsensitive, 		(dt == HOUR12) ? True : False,
		NULL);      
	XmStringFree(label_str);

	XtManageChildren(child, 2);

	/*
	**  Last and near the end, the stop stuff
	**  Radio button behavior for AM/PM selection for stop time
	*/
	dssw->stop_text = XtVaCreateWidget("stop_text",
		xmTextWidgetClass, 	dssw->dssw_form_mgr,
		XmNeditMode, 		XmSINGLE_LINE_EDIT,
		XmNmaxLength, 		START_STOP_LEN - 1,
		NULL);

        dssw->stop_menu = create_start_stop_time_menu(dssw->dssw_form_mgr,
		NULL, dssw_set_stop_hour, (XtPointer)dssw, p, show_notime, 
		False, &dssw->stop_menu_widget_list, 
		&dssw->stop_menu_widget_count);

	XtVaSetValues(dssw->stop_menu,
		XmNnavigationType, 	XmTAB_GROUP,
		NULL);

        dssw->stop_ampm_rc_mgr = XtVaCreateWidget("stop_ampm_rc_mgr",
		xmRowColumnWidgetClass, dssw->dssw_form_mgr,
		XmNpacking, 		XmPACK_COLUMN,
		XmNorientation, 	XmHORIZONTAL,
		XmNradioBehavior, 	True,
		XmNisHomogeneous, 	True,
		XmNentryClass, 		xmToggleButtonGadgetClass,
		NULL);

	label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 833, "AM"));
        child[0] = dssw->stop_am = XtVaCreateWidget("stop_am",
		xmToggleButtonGadgetClass, dssw->stop_ampm_rc_mgr,
		XmNlabelString,		label_str,
		XmNsensitive, 		(dt == HOUR12) ? True : False,
		NULL);      
	XmStringFree(label_str);

	label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 834, "PM"));
        child[1] = dssw->stop_pm = XtVaCreateWidget("stop_pm",
		xmToggleButtonGadgetClass, dssw->stop_ampm_rc_mgr,
		XmNlabelString,		label_str,
		XmNsensitive, 		(dt == HOUR12) ? True : False,
		NULL);      
	XmStringFree(label_str);

	XtManageChildren(child, 2);


	/*
	**  Finally the what text field
	*/
	n = 0;
        XtSetArg(args[n], XmNeditMode, 		XmMULTI_LINE_EDIT), n++;
/*	XtSetArg(args[n], XmNscrollVertical, 	True), n++;  */
	XtSetArg(args[n], XmNscrollHorizontal,	False), n++; 
	XtSetArg(args[n], XmNscrollingPolicy, 	XmAUTOMATIC), n++; 
	XtSetArg(args[n], XmNscrollBarDisplayPolicy, XmAS_NEEDED), n++;
	XtSetArg(args[n], XmNrows, 		3), n++;
	XtSetArg(args[n], XmNmaxLength, 	WHAT_LEN - 1), n++;

	dssw->what_text = XmCreateScrolledText(dssw->dssw_form_mgr, 
					       "what_text", args, n);

	dssw->what_scrollwindow = XtParent(dssw->what_text);
	XtManageChild(dssw->what_text);

	/*
	 * Do a layout
	 */
	_i18n_WidestWidget( 4, &prev, &max_left_label_width,
		dssw->date_label, dssw->start_label, dssw->stop_label,
		dssw->what_label );
	_toText = max_left_label_width + 2 * GAP;

	/*
	 * dssw->date_label, dssw->date_text
	 */
	_i18n_WidestWidget( 1, &curr, &widest, dssw->date_label );
	_toLabel = _toText - GAP - widest;
	_i18n_HighestWidgetAdjust( 2, &curr, &highest, dssw->date_label,
					dssw->date_text );
	XtVaSetValues( curr,
			XmNtopAttachment, XmATTACH_FORM,
			XmNtopOffset, GAP,
			NULL );
	XtVaSetValues( dssw->date_label,
			XmNleftAttachment, XmATTACH_FORM,
			XmNleftOffset, _toLabel,
			NULL );
	XtVaSetValues( dssw->date_text,
			XmNleftAttachment, XmATTACH_FORM,
			XmNleftOffset, _toText,
			XmNrightAttachment, XmATTACH_FORM,
			NULL );
	prev = curr;

	/*
	 * dssw->start_label, dssw->start_text, dssw->start_menu,
	 * dssw->start_ampm_rc_mgr
	 */
	_i18n_WidestWidget( 1, &curr, &widest, dssw->start_label );
	_toLabel = _toText - GAP - widest;
	_i18n_WidestWidget( 1, &curr, &widest, dssw->start_text );
	_toMenu = _toText + widest + GAP;
	_i18n_WidestWidget( 1, &curr, &widest, dssw->start_menu );
	_toRC = _toMenu + widest + GAP;
	_i18n_HighestWidgetAdjust( 4, &curr, &highest, dssw->start_label,
		dssw->start_text, dssw->start_menu, dssw->start_ampm_rc_mgr );
	XtVaSetValues( curr,
			XmNtopAttachment, XmATTACH_WIDGET,
			XmNtopWidget, prev,
			XmNtopOffset, GAP,
			NULL );
	XtVaSetValues( dssw->start_label,
			XmNleftAttachment, XmATTACH_FORM,
			XmNleftOffset, _toLabel,
			NULL );
	XtVaSetValues( dssw->start_text,
			XmNleftAttachment, XmATTACH_FORM,
			XmNleftOffset, _toText,
			NULL );
	XtVaSetValues( dssw->start_menu,
			XmNleftAttachment, XmATTACH_FORM,
			XmNleftOffset, _toMenu,
			NULL );
	XtVaSetValues( dssw->start_ampm_rc_mgr,
			XmNleftAttachment, XmATTACH_FORM,
			XmNleftOffset, _toRC,
			NULL );
	prev = curr;

	/*
	 * dssw->stop_label, dssw->stop_text, dssw->stop_menu,
	 * dssw->stop_ampm_rc_mgr
	 */
	_i18n_WidestWidget( 1, &curr, &widest, dssw->stop_label );
	_toLabel = _toText - GAP - widest;
	_i18n_WidestWidget( 1, &curr, &widest, dssw->stop_text );
	_toMenu = _toText + widest + GAP;
	_i18n_WidestWidget( 1, &curr, &widest, dssw->stop_menu );
	_toRC = _toMenu + widest + GAP;
	_i18n_HighestWidgetAdjust( 4, &curr, &highest, dssw->stop_label,
		dssw->stop_text, dssw->stop_menu, dssw->stop_ampm_rc_mgr );
	XtVaSetValues( curr,
			XmNtopAttachment, XmATTACH_WIDGET,
			XmNtopWidget, prev,
			XmNtopOffset, GAP,
			NULL );
	XtVaSetValues( dssw->stop_label,
			XmNleftAttachment, XmATTACH_FORM,
			XmNleftOffset, _toLabel,
			NULL );
	XtVaSetValues( dssw->stop_text,
			XmNleftAttachment, XmATTACH_FORM,
			XmNleftOffset, _toText,
			NULL );
	XtVaSetValues( dssw->stop_menu,
			XmNleftAttachment, XmATTACH_FORM,
			XmNleftOffset, _toMenu,
			NULL );
	XtVaSetValues( dssw->stop_ampm_rc_mgr,
			XmNleftAttachment, XmATTACH_FORM,
			XmNleftOffset, _toRC,
			NULL );
	prev = curr;

	/*
	 * dssw->what_label, dssw->what_scrollwindow
	 */
	_i18n_WidestWidget( 1, &curr, &widest, dssw->what_label );
	_toLabel = _toText - GAP - widest;
	XtVaSetValues( dssw->what_label,
			XmNtopAttachment, XmATTACH_WIDGET,
			XmNtopWidget, prev,
			XmNtopOffset, GAP,
			XmNleftAttachment, XmATTACH_FORM,
			XmNleftOffset, _toLabel,
			NULL );
	XtVaSetValues( dssw->what_scrollwindow,
			XmNtopAttachment, XmATTACH_WIDGET,
			XmNtopWidget, prev,
			XmNtopOffset, GAP,
			XmNleftAttachment, XmATTACH_FORM,
			XmNleftOffset, _toText,
			XmNrightAttachment, XmATTACH_FORM,
			XmNbottomAttachment, XmATTACH_FORM,
			NULL );
}
Example #29
0
XFE_PrefsDiskMoreDialog::XFE_PrefsDiskMoreDialog(XFE_PrefsDialog *prefsDialog,
									 Widget     parent,      // dialog parent
									 char      *name,        // dialog name
									 Boolean    modal)       // modal dialog?
	: XFE_Dialog(parent, 
				 name,
				 TRUE,     // ok
				 TRUE,     // cancel
				 FALSE,    // help
				 FALSE,    // apply
				 FALSE,    // separator
				 modal     // modal
				 ),
	  m_prefsDialog(prefsDialog),
	  m_prefsDataDiskMore(0)
{
	PrefsDataDiskMore *fep = NULL;

	fep = new PrefsDataDiskMore;
	memset(fep, 0, sizeof(PrefsDataDiskMore));
	m_prefsDataDiskMore = fep;
	
	Widget     form;
	Widget     desc_label;
	Widget     rm_msg_body_toggle;
	Widget     num_days_text;
	Widget     days_label;
	Widget     kids[100];
	Arg        av[50];
	int        ac;
	int        i;

	form = XtVaCreateWidget("form", xmFormWidgetClass, m_chrome,
							XmNtopAttachment, XmATTACH_FORM,
							XmNleftAttachment, XmATTACH_FORM,
							XmNrightAttachment, XmATTACH_FORM,
							XmNbottomAttachment, XmATTACH_FORM,
							NULL);
	XtManageChild (form);

	ac = 0;
	i = 0;

	kids[i++] = desc_label = 
		XmCreateLabelGadget(form, "descLabel", av, ac);

	kids[i++] = rm_msg_body_toggle = 
		XmCreateToggleButtonGadget (form, "rmMsgBodyToggle", av, ac);

	kids[i++] = num_days_text =
		fe_CreateTextField(form, "numDaysText", av, ac);

	kids[i++] = days_label = 
		XmCreateLabelGadget(form, "daysLabel", av, ac);

	XtVaSetValues(desc_label,
				  XmNtopAttachment, XmATTACH_FORM,
				  XmNleftAttachment, XmATTACH_FORM,
				  XmNrightAttachment, XmATTACH_NONE,
				  XmNbottomAttachment, XmATTACH_NONE,
				  NULL);
	
	int labels_height;
	labels_height = XfeVaGetTallestWidget(rm_msg_body_toggle,
										  num_days_text,
										  days_label,
										  NULL);

	XtVaSetValues(rm_msg_body_toggle,
				  XmNheight, labels_height,
				  XmNtopAttachment, XmATTACH_WIDGET,
				  XmNtopWidget, desc_label,
				  XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
				  XmNleftWidget, desc_label,
				  XmNrightAttachment, XmATTACH_NONE,
				  XmNbottomAttachment, XmATTACH_NONE,
				  NULL);
	
	XtVaSetValues(num_days_text,
				  XmNheight, labels_height,
				  XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
				  XmNtopWidget, rm_msg_body_toggle,
				  XmNleftAttachment, XmATTACH_WIDGET,
				  XmNleftWidget, rm_msg_body_toggle,
				  XmNrightAttachment, XmATTACH_NONE,
				  XmNbottomAttachment, XmATTACH_NONE,
				  NULL);
	
	XtVaSetValues(days_label,
				  XmNheight, labels_height,
				  XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
				  XmNtopWidget, rm_msg_body_toggle,
				  XmNleftAttachment, XmATTACH_WIDGET,
				  XmNleftWidget, num_days_text,
				  XmNrightAttachment, XmATTACH_NONE,
				  XmNbottomAttachment, XmATTACH_NONE,
				  NULL);
	
	fep->rm_msg_body_toggle = rm_msg_body_toggle;
	fep->num_days_text = num_days_text;

	// Add callbacks

	XtAddCallback(m_chrome, XmNokCallback, prefsDiskMoreCb_ok, this);
	XtAddCallback(m_chrome, XmNcancelCallback, prefsDiskMoreCb_cancel, this);

	XtManageChildren(kids, i);
}
Example #30
0
Widget *CreateBlockChoice(Widget parent, char *labelstr, int nsets, int type)
{
    int nmal, i = 0;
    XmString str;
    char *name = (char *)"setchoice";
    char buf[10];
    Widget *retval = NULL;

    switch (type)
    {
    case 0:
        nmal = nsets + 2;
        retval = (Widget *)XtMalloc(nmal * sizeof(Widget));
        retval[1] = XmCreatePulldownMenu(parent, name, NULL, 0);
        XtVaSetValues(retval[1],
                      XmNorientation, XmVERTICAL,
                      XmNpacking, XmPACK_COLUMN,
                      XmNnumColumns, nsets / 10,
                      NULL);
        i = 0;
        for (i = 0; i < nsets; i++)
        {
            sprintf(buf, "%d", i + 1);
            retval[i + 2] = XmCreatePushButton(retval[1], buf, NULL, 0);
        }
        XtManageChildren(retval + 2, nsets);

        str = XmStringCreate(labelstr, charset);

        retval[0] = XmCreateOptionMenu(parent, name, NULL, 0);
        XtVaSetValues(retval[0],
                      XmNlabelString, str,
                      XmNsubMenuId, retval[1],
                      XmNentryBorder, 2,
                      XmNwhichButton, 1,
                      NULL);
        XtManageChild(retval[0]);
        break;
    case 1:
        nmal = nsets + 3;
        retval = (Widget *)XtMalloc(nmal * sizeof(Widget));
        retval[1] = XmCreatePulldownMenu(parent, name, NULL, 0);
        XtVaSetValues(retval[1],
                      XmNorientation, XmVERTICAL,
                      XmNpacking, XmPACK_COLUMN,
                      XmNnumColumns, nsets / 10,
                      NULL);
        i = 0;
        retval[2] = XmCreatePushButton(retval[1], (char *)"Index", NULL, 0);
        for (i = 1; i < nsets + 1; i++)
        {
            sprintf(buf, "%d", i);
            retval[i + 2] = XmCreatePushButton(retval[1], buf, NULL, 0);
        }
        XtManageChildren(retval + 2, nsets + 1);

        str = XmStringCreate(labelstr, charset);

        retval[0] = XmCreateOptionMenu(parent, name, NULL, 0);
        XtVaSetValues(retval[0],
                      XmNlabelString, str,
                      XmNsubMenuId, retval[1],
                      XmNentryBorder, 2,
                      XmNwhichButton, 1,
                      NULL);
        XtManageChild(retval[0]);
        break;
    default:
        fprintf(stderr, "eblockwin.cpp:CreateBlockChoice(): retval not initialized\n");
        break;
    }
    return retval;
}