diff --git a/ba/baformed.cpp b/ba/baformed.cpp index 7dbff7a72..fdb98f1d3 100755 --- a/ba/baformed.cpp +++ b/ba/baformed.cpp @@ -1,5 +1,6 @@ #include "baformed.h" #include +#include // ----------------------------------------------------------------- // maschera per le finkature // ----------------------------------------------------------------- @@ -65,7 +66,10 @@ void TFink_mask::handler(WINDOW win, EVENT* ep) if (ep->type == E_UPDATE) { // pittura le righette - rect(xl, yt, xr+1, yb+1); + line(xl,yt,xr,yt); + line(xl,yb,xr,yb); + line(xl,yt,xl,yb); + line(xr,yt,xr,yb); line(xl, ym, xr, ym); line(xm, yt, xm, yb); paint_example(); @@ -78,7 +82,7 @@ void TFink_mask::paint_example() // on the right of the mask TString line(xr); set_font(XVT_FFN_COURIER); - set_color(MASK_DARK_COLOR,MASK_BACK_COLOR); + set_color(MASK_LIGHT_COLOR,MASK_BACK_COLOR); set_opaque_text(TRUE); for (int i = yt; i <= yb; i++) @@ -182,6 +186,7 @@ bool TForm_editor::create() } enable_menu_item(M_FILE_PRINT); + _m = new TMask(selection_mask()); if ((form && code) || (form && code == 0 && _extra)) { _form = new TForm(form, (code!=0) ? format("%05ld",code) : "", _extra ? 2 : 1); @@ -190,7 +195,6 @@ bool TForm_editor::create() else dispatch_e_menu(MENU_ITEM(14)); - _m = new TMask(selection_mask()); if (form) { _m->set(F_BASE, form); @@ -365,6 +369,7 @@ bool TForm_editor::edit_formato_numero() bool TForm_editor::edit_formato_data() { bool dirty = FALSE; + TString16 fmt("1"),sep("-"); char format[6] = { "1444-" }; TMask m("ba21dt"); @@ -377,12 +382,27 @@ bool TForm_editor::edit_formato_data() TDate dd(TODAY); TFormatted_date d(dd); d.set_format(format); + if (_form->code()[4] != '\0') + {//Loads date format from %LNG + TTable l("%LNG"); + l.put("CODTAB",_form->code()[4]); + if (l.read() == NOERR) + { + fmt = l.get("S7");//formato + fmt.cut(3); + sep.format("%c", l.get("S7")[3]);//separatore + if (sep!="-" && sep!="/" && sep!="." && sep!="," && sep!=" ") sep = "-"; + if (fmt=="MAG") fmt = "2"; + else if (fmt=="AMG") fmt = "3"; + else fmt = "1"; + } + } - m.set(F_DFORMAT, "1"); + m.set(F_DFORMAT, fmt); m.set(F_DDAY, "4"); m.set(F_DMONTH, "4"); m.set(F_DYEAR, "4"); - m.set(F_DSEP, "-"); + m.set(F_DSEP, sep); m.set(F_DEXAMPLE, d.string()); if (dirty = (m.run() == K_ENTER)) diff --git a/ba/baformed.h b/ba/baformed.h index 9a0ada076..fa213321e 100755 --- a/ba/baformed.h +++ b/ba/baformed.h @@ -36,9 +36,11 @@ protected: bool edit_fincatura(); bool edit_formato_numero(); bool edit_formato_data(); - bool edit(char s, pagetype p); + virtual bool edit(char s, pagetype p); bool form_config() const; + void check_form() { if (_form != NULL) delete _form; } TForm& form() { return *_form; } + TMask& mask() { return *_m; } public: