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:
parent
c6f64c536f
commit
8d71b3cd13
@ -2127,6 +2127,8 @@ TToken_string& TBrowse::create_siblings(TToken_string& siblings)
|
|||||||
|
|
||||||
TBit_array key(4); // Elenco delle chiavi gia' utilizzate
|
TBit_array key(4); // Elenco delle chiavi gia' utilizzate
|
||||||
key.set(_cursor->key());
|
key.set(_cursor->key());
|
||||||
|
|
||||||
|
TString fn; // Nome campo
|
||||||
|
|
||||||
// Scorre la lista dei campi di output
|
// Scorre la lista dei campi di output
|
||||||
int n = 0;
|
int n = 0;
|
||||||
@ -2134,7 +2136,7 @@ TToken_string& TBrowse::create_siblings(TToken_string& siblings)
|
|||||||
{
|
{
|
||||||
const short id = field().atodlg(i);
|
const short id = field().atodlg(i);
|
||||||
const TEditable_field& f = field(id);
|
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;
|
continue;
|
||||||
const TEdit_field& e = (const TEdit_field&)f;
|
const TEdit_field& e = (const TEdit_field&)f;
|
||||||
const TBrowse* b = e.browse();
|
const TBrowse* b = e.browse();
|
||||||
@ -2142,13 +2144,12 @@ TToken_string& TBrowse::create_siblings(TToken_string& siblings)
|
|||||||
continue; // Scarta i campi senza ricerca
|
continue; // Scarta i campi senza ricerca
|
||||||
|
|
||||||
const TCursor* c = b->cursor();
|
const TCursor* c = b->cursor();
|
||||||
TString fn;
|
|
||||||
|
|
||||||
// Considera ricerche sullo stesso file ma con chiave diversa
|
// Considera ricerche sullo stesso file ma con chiave diversa
|
||||||
if (c->file().num() == _cursor->file().num() &&
|
if (c->file().num() == _cursor->file().num() &&
|
||||||
(key[c->key()] == FALSE || id == field().dlg()))
|
(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
|
int pos = _items.get_pos(fn); // Determina header corrispondente
|
||||||
if (pos < 0) // Se non lo trova identico ...
|
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)
|
void TReal_field::create(WINDOW w)
|
||||||
{
|
{
|
||||||
_ctl_data._flags.strip("AFM");
|
_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);
|
TEdit_field::create(w);
|
||||||
|
|
||||||
if (_flags.firm)
|
if (_flags.firm)
|
||||||
|
@ -312,7 +312,7 @@ void TRelation_application::query_mode(
|
|||||||
void TRelation_application::insert_mode()
|
void TRelation_application::insert_mode()
|
||||||
{
|
{
|
||||||
if (_mask->query_mode())
|
if (_mask->query_mode())
|
||||||
{
|
{
|
||||||
if (test_key(1, FALSE) == FALSE)
|
if (test_key(1, FALSE) == FALSE)
|
||||||
{
|
{
|
||||||
if (!autonum(_mask, FALSE))
|
if (!autonum(_mask, FALSE))
|
||||||
@ -767,7 +767,16 @@ bool TRelation_application::main_loop()
|
|||||||
break;
|
break;
|
||||||
case K_INS:
|
case K_INS:
|
||||||
if (_mask->query_mode() || save(TRUE))
|
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;
|
break;
|
||||||
case K_DEL:
|
case K_DEL:
|
||||||
if (relation_remove())
|
if (relation_remove())
|
||||||
@ -779,7 +788,7 @@ bool TRelation_application::main_loop()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case K_F9:
|
case K_F9:
|
||||||
if (_mask->mode() == MODE_QUERY || save(TRUE))
|
if (_mask->query_mode() || save(TRUE))
|
||||||
search_mode();
|
search_mode();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1148,16 +1148,22 @@ TBrowse_sheet::TBrowse_sheet(TCursor* cursor, const char* fields,
|
|||||||
p.ltrim(a);
|
p.ltrim(a);
|
||||||
}
|
}
|
||||||
p.left_just(16);
|
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())
|
switch (c.class_id())
|
||||||
{
|
{
|
||||||
case CLASS_EDIT_FIELD:
|
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;
|
break;
|
||||||
case CLASS_REAL_FIELD:
|
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;
|
break;
|
||||||
case CLASS_DATE_FIELD:
|
case CLASS_DATE_FIELD:
|
||||||
e = &add_date (c.dlg(), 0, p, 1, y++, "");
|
e = &add_date (c.dlg(), 0, p, 1, y++, flags);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
e = NULL;
|
e = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user