Adding objects to an FDesign-generated struct

Fri, 10 Jan 97 09:36:24 EST

To subscribers of the xforms list from Eric_Kischell@IUS5.IUS.CS.CMU.EDU :

Sorry if this is a duplicate post.


I am trying to better utilize FDesign in an existing
XForms(0.81 IRIX 5.3) C project.

My problem is that I have some custom functions for status boxes(+other types)
which create their own objects with associated layout. For example,
I want to add FL_OBJECT *ok and FL_OBJECT *status to an FDesign-generated struct.
Upon redesigning the form(in the future), I do not wish FDesign to "blow-away" my added objects.
I could probably use C++ to inherit from the FDesign-generated struct and "add"
additional objects. Does anyone know of an easier way to "merge" additional code
with FDesign?

Thanks in advance.

#ifndef FD_frmLogin_h_
#define FD_frmLogin_h_
/* Header file generated with fdesign. */

/**** Callback routines ****/

/**** Forms and Objects ****/

typedef struct {
FL_FORM *frmLogin;
void *vdata;
long ldata;
} FD_frmLogin;

extern FD_frmLogin * create_form_frmLogin(void);

#endif /* FD_frmLogin_h_ */

/* This would exist in another file to add attributes to an Fdesign-gen form */
/* Status Dialog Box Setting */
ios_popup_status_1button( &obj, S_XVAL, S_YVAL, S_WVAL, S_HVAL, &obj1, "Login waiting...", &obj2, "OK", FL_COL1);
fl_set_object_lcol(obj1, IOS_STAT_COL);
fl_set_object_lsize(obj1, FL_HUGE_SIZE);

/* How to add these objects to an FDesign-gen struct? */
fdui->status = obj1;
fdui->ok = obj2;

void ios_popup_status_1button(FL_OBJECT **obj, int x, int y, int w, int h,
FL_OBJECT **text_obj, const char *text, FL_OBJECT **button_obj,
const char *text_button, FL_COLOR box_color)
int bw= IOS_STATUS_BUT_WID, bh = IOS_STATUS_BUT_HT; /* button width, height */
FL_OBJECT *tmp_obj = NULL;

tmp_obj = fl_add_box( FL_UP_BOX, x, y, w, h, "");
fl_set_object_color(tmp_obj, box_color, FL_COL1);
ios_create_text( text_obj, x+2, y+2, w-4, h/2-2, text );
/* -------------------------- */
ios_replace_text(text_obj, (*text_obj)->label);

*obj = *text_obj;
ios_create_button( button_obj, x+(w-bw)/2, y+h-10-bh, bw, bh, text_button );
fl_set_object_lsize( (*button_obj), FL_MEDIUM_SIZE);
*obj = *button_obj;