diff --git a/include/clifo.h b/include/clifo.h index 4f077cae7..50b41c854 100755 --- a/include/clifo.h +++ b/include/clifo.h @@ -54,6 +54,9 @@ #define CLI_CODPAG "CODPAG" #define CLI_SOSPESO "SOSPESO" #define CLI_OCCAS "OCCAS" -#define CLI_CODLIN "CODLIN" +#define CLI_CODLIN "CODLIN" +#define CLI_CODAG "CODAG" +#define CLI_CODZONA "CODZONA" + #endif diff --git a/include/controls.cpp b/include/controls.cpp index 6a593d237..8530cf667 100755 --- a/include/controls.cpp +++ b/include/controls.cpp @@ -1902,9 +1902,16 @@ bool TDropDownList::select_by_ofs(int i) TDropDownList::TDropDownList(XI_OBJ* o, const char* codes, const char* values) : _obj(o), _codes(codes), _values(values), - _open(FALSE), _xi_lst(NULL), - _displayed(FALSE), _selected(0) -{} + _open(FALSE), _xi_lst(NULL), _displayed(FALSE), _selected(0) +{ + if (o->type == XIT_CELL) + { + const char* val = xi_get_text(o, NULL, -1); + _selected = _codes.get_pos(val); + if (_selected < 0) + _selected = 0; + } +} void TDropDownList::set_values(const char* c, const char* v) { diff --git a/include/form.cpp b/include/form.cpp index 55d79044a..247b12953 100755 --- a/include/form.cpp +++ b/include/form.cpp @@ -684,11 +684,14 @@ void TForm_item::send_message( TForm_item& des) const // @parm Campo a cui destinare il messaggio { if (cmd == "ADD" || cmd == "INC") - { - const real n((cmd[0] == 'I') ? "1.0" : get()); - real r(des.get()); - r += n; - des.set(r.string()); + { + if (form().message_add_enabled()) + { + const real n((cmd[0] == 'I') ? "1.0" : get()); + real r(des.get()); + r += n; + des.set(r.string()); + } } else if (cmd == "COPY") { @@ -3864,11 +3867,8 @@ bool TForm::print( TPrinter& pr = printer(); if (_char_to_pos != '\0' || (_ipx +_ipy+_fpx) != 0) // Effettua il posizionamento del form... { - if (pr.printtype() == screenvis) - error_box("Stampa a video selezionata. Non e' possibile effettuare il posizionamento."); - else - if (_arrange) - arrange_form(); + if (_arrange && pr.printtype() == winprinter) + arrange_form(); } pr.setheaderhandler(header_handler); // Setta handlers @@ -4010,15 +4010,16 @@ void TForm::print_on(ostream& out) const word TForm::height(word page) { + const pagetype t = (page == 1) ? first_page : ((page & 0x1) ? odd_page : even_page); + word h = 0; - if (_back.items() == 0) { - if (_head.items() && exist('H', pagetype(page)) != NULL) + if (_head.items() && exist('H', t) != NULL) h += section('H', page).height(); - if (_body.items() && exist('B', pagetype(page)) != NULL) + if (_body.items() && exist('B', t) != NULL) h += section('B', page).height(); - if (_foot.items() && exist('F', pagetype(page)) != NULL) + if (_foot.items() && exist('F', t) != NULL) h += section('F', page).height(); } else @@ -4184,6 +4185,7 @@ void TForm::init() set_fincatura("+++++++++-|"); _dirty= FALSE; _background_mode = printer().isgraphics() ? graphics : testo; + _msg_add_enabled = TRUE; } // @doc EXTERNAL diff --git a/include/form.h b/include/form.h index 7aa005aef..4c7bded92 100755 --- a/include/form.h +++ b/include/form.h @@ -99,9 +99,12 @@ class TForm : public TObject int _ipy; // @cmember:(INTERNAL) Coordinata X del posizionamento finale (la riga e' la stessa) int _fpx; - // @cmember:(INTERNAL) Flag per ragistrare i parametri (font ed offset) + // @cmember:(INTERNAL) Flag per registrare i parametri (font ed offset) bool _dirty; + // @cmember:(INTERNAL) Flag di abilitazione del messagio ADD + bool _msg_add_enabled; + // @cmember:(INTERNAL) Relazione corrente (puo' essere NULL), vedi TRelation* _relation; // @cmember:(INTERNAL) Cursore corrente (puo' essere NULL), vedi @@ -165,9 +168,6 @@ protected: // (3 e' una pagina dispari qualsiasi) TPrint_section& section(char s, word page = 3); - // @cmember Ritorna l'altezza della pagina

la prima di default - word height(word page = 1); - // @cmember Stampa la sezione

void print_section(ostream& out, char s) const; // @cmember Stampa il sorgente del form su file di testo @@ -239,6 +239,9 @@ public: // @cmember Stampa gli items da

a

bool print(long from = 0L, long to = -1L); + // @cmember Ritorna l'altezza della pagina

la prima di default + word height(word page = 3); + // @cmember Ritorna l'array di item del body TArray& body() { return _body; } @@ -271,6 +274,10 @@ public: void set_description(const char* s) { _desc = s; } + void enable_message_add(bool on) { _msg_add_enabled = on; } + void disable_message_add() { enable_message_add(FALSE); } + bool message_add_enabled() const { return _msg_add_enabled; } + // @cmember Ritorna la relazione corrente virtual TRelation* relation() const { return _relation; }