Index: trunk/src_plugins/order/order.h =================================================================== --- trunk/src_plugins/order/order.h (revision 36889) +++ trunk/src_plugins/order/order.h (revision 36890) @@ -76,6 +76,7 @@ char *help; pcb_order_autoload_t autoload; int wid; /* widget id, if any */ + int wwarn; /* widget id for the warning widget */ char name[1]; /* dynamic length */ }; @@ -82,7 +83,11 @@ /* Build a hbox from a field */ void pcb_order_dad_field(order_ctx_t *octx, pcb_order_field_t *f); +/* When the dialog is already active, indicate an error for field or remove + indication if details is NULL. */ +void pcb_order_field_error(order_ctx_t *octx, pcb_order_field_t *f, const char *details); + /* Free data stored in a field, but not the field itself. Note: ->name and ->type remains valid after the call */ void pcb_order_free_field_data(order_ctx_t *octx, pcb_order_field_t *f); Index: trunk/src_plugins/order/order_dlg.c =================================================================== --- trunk/src_plugins/order/order_dlg.c (revision 36889) +++ trunk/src_plugins/order/order_dlg.c (revision 36890) @@ -137,6 +137,11 @@ RND_DAD_BEGIN_VBOX(octx->dlg); RND_DAD_COMPFLAG(octx->dlg, RND_HATF_EXPFILL); RND_DAD_END(octx->dlg); + RND_DAD_LABEL(octx->dlg, ""); + f->wwarn = RND_DAD_CURRENT(octx->dlg); + RND_DAD_BEGIN_VBOX(octx->dlg); + RND_DAD_COMPFLAG(octx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(octx->dlg); switch(f->type) { case RND_HATT_ENUM: RND_DAD_ENUM(octx->dlg, f->enum_vals); @@ -166,3 +171,16 @@ f->wid = RND_DAD_CURRENT(octx->dlg); RND_DAD_END(octx->dlg); } + +void pcb_order_field_error(order_ctx_t *octx, pcb_order_field_t *f, const char *details) +{ + rnd_hid_attr_val_t hv; + + if (details != NULL) + hv.str = "ERROR"; + else + hv.str = ""; + + rnd_gui->attr_dlg_set_value(octx->dlg_hid_ctx, f->wwarn, &hv); + rnd_gui->attr_dlg_set_help(octx->dlg_hid_ctx, f->wwarn, details); +}