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
This commit is contained in:
guy 1996-07-12 14:51:17 +00:00
parent c6f64c536f
commit 8d71b3cd13
3 changed files with 28 additions and 10 deletions

View File

@ -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)

View File

@ -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:

View File

@ -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;