From 8d71b3cd1320d716185327241c0783bd0feab62d Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 12 Jul 1996 14:51:17 +0000 Subject: [PATCH] maskfld.cpp Elimininati campi disabilitati dalle ricerche alternative relapp.cpp Modificato leggermente il comportamento del tasto nuovo quando viene premuto in query e non c'e' numerazione automatica sheet.cpp Ricopiati i flags dei campi di ricerca: M R e U git-svn-id: svn://10.65.10.50/trunk@3181 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/maskfld.cpp | 11 +++++++---- include/relapp.cpp | 15 ++++++++++++--- include/sheet.cpp | 12 +++++++++--- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/include/maskfld.cpp b/include/maskfld.cpp index 3a9562ccc..db55b0b8e 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -2127,6 +2127,8 @@ TToken_string& TBrowse::create_siblings(TToken_string& siblings) TBit_array key(4); // Elenco delle chiavi gia' utilizzate key.set(_cursor->key()); + + TString fn; // Nome campo // Scorre la lista dei campi di output int n = 0; @@ -2134,7 +2136,7 @@ TToken_string& TBrowse::create_siblings(TToken_string& siblings) { const short id = field().atodlg(i); const TEditable_field& f = field(id); - if (!f.shown() || !f.is_edit()) // Scarta i campi non editabili + if (!f.active() || !f.is_edit()) // Scarta i campi non editabili continue; const TEdit_field& e = (const TEdit_field&)f; const TBrowse* b = e.browse(); @@ -2142,13 +2144,12 @@ TToken_string& TBrowse::create_siblings(TToken_string& siblings) continue; // Scarta i campi senza ricerca const TCursor* c = b->cursor(); - TString fn; // Considera ricerche sullo stesso file ma con chiave diversa if (c->file().num() == _cursor->file().num() && (key[c->key()] == FALSE || id == field().dlg())) { - fn = _out_fn.get(n); // Legge nome del campo su file + fn = _out_fn.get(n); // Legge nome del campo su file int pos = _items.get_pos(fn); // Determina header corrispondente if (pos < 0) // Se non lo trova identico ... { @@ -3149,7 +3150,9 @@ bool TReal_field::is_kind_of(word cid) const void TReal_field::create(WINDOW w) { _ctl_data._flags.strip("AFM"); - _ctl_data._flags << 'R'; + if (!roman()) + _ctl_data._flags << 'R'; // Forza l'allineamento a destra per i numeri + TEdit_field::create(w); if (_flags.firm) diff --git a/include/relapp.cpp b/include/relapp.cpp index b217a5c42..bbf8b3af8 100755 --- a/include/relapp.cpp +++ b/include/relapp.cpp @@ -312,7 +312,7 @@ void TRelation_application::query_mode( void TRelation_application::insert_mode() { if (_mask->query_mode()) - { + { if (test_key(1, FALSE) == FALSE) { if (!autonum(_mask, FALSE)) @@ -767,7 +767,16 @@ bool TRelation_application::main_loop() break; case K_INS: if (_mask->query_mode() || save(TRUE)) - insert_mode(); + { + const bool trovato = _mask->query_mode() && test_key(1, FALSE) && find(1); + if (trovato) + { + modify_mode(); + warning_box("Documento gia' presente"); + } + else + insert_mode(); + } break; case K_DEL: if (relation_remove()) @@ -779,7 +788,7 @@ bool TRelation_application::main_loop() } break; case K_F9: - if (_mask->mode() == MODE_QUERY || save(TRUE)) + if (_mask->query_mode() || save(TRUE)) search_mode(); break; default: diff --git a/include/sheet.cpp b/include/sheet.cpp index 78151684d..bdfc3e170 100755 --- a/include/sheet.cpp +++ b/include/sheet.cpp @@ -1148,16 +1148,22 @@ TBrowse_sheet::TBrowse_sheet(TCursor* cursor, const char* fields, p.ltrim(a); } p.left_just(16); + + TString16 flags; + if (c.roman()) flags << 'M'; + if (c.right_justified()) flags << 'R'; + if (c.uppercase()) flags << 'U'; + switch (c.class_id()) { case CLASS_EDIT_FIELD: - e = &add_string(c.dlg(), 0, p, 1, y++, c.size(), ""); + e = &add_string(c.dlg(), 0, p, 1, y++, c.size(), flags); break; case CLASS_REAL_FIELD: - e = &add_number(c.dlg(), 0, p, 1, y++, c.size(), ""); + e = &add_number(c.dlg(), 0, p, 1, y++, c.size(), flags); break; case CLASS_DATE_FIELD: - e = &add_date (c.dlg(), 0, p, 1, y++, ""); + e = &add_date (c.dlg(), 0, p, 1, y++, flags); break; default: e = NULL;