From: Carlos <csa...@ig...> - 2005-08-31 18:47:32
|
Hi folks, We've added a generic form controller (FControlForm) and a generic form builder (FControlFormBuiler). It can be used for common i/o detail windows, such as insert or update items. How is a form window implemented using this controller? Simple, we have to configure concrete parameters for our controller instance with a 'FClientForm structure. Next are the required parameters: typedef struct _FClientForm { gchar *f_client_form_name; gchar *f_client_form_window_name; FCommonFacade *(*f_client_form_facade_new)(void); GtkWidget *(*f_client_form_widget_new)(void); FModel *(*f_client_form_model_new)(void); gboolean (*f_client_form_set_initial_data)(FCommonFacade *facade, FModel *model); gboolean (*f_client_form_set_detail_data)(FCommonFacade *facade, guint64 code, FModel *model); gboolean (*f_client_form_save_model)(FCommonFacade *facade, FModel *model); } FClientForm; We can specify any facade, widget and model function for our controller. When we add the controller into controllers definition xml file, we'll reference the "f_client_form_name" from a new "form_name" entry. It's thus because main controller saves an object to mapping the form controller definition with this string as key. <controller name=3D"f_control_form_item" builder=3D"FControlFormBuilder" menu_option=3D"Item Detail" action_name=3D"ItemDetail" form_name=3D"item_detail_form" embedded=3D"false"/> Now, we have to create glade, widget, model and facade functions :). An example of use is item_detail_form (with f_widget_item_detail and f_model_item_detail) of fisterra-repair. For further information, view the section 'Form window implementation' of the 'fisterra-base' doc. Greetings. --=20 Carlos Sanmart=EDn Dom=EDnguez <csa...@ig...> Telf: +34 981 91 39 91 Igalia, S.L. http://www.igalia.com |