Corretta selezione iniziale degli array sheet
git-svn-id: svn://10.65.10.50/trunk@993 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
c3ae6d78ab
commit
3c9e5b7de5
@ -200,6 +200,7 @@ void TMask::read_mask(const char* name, int num, int max)
|
||||
|
||||
_source_file = name;
|
||||
_source_file.ext(MASK_EXT);
|
||||
_source_file.lower();
|
||||
TScanner scanner(_source_file);
|
||||
|
||||
_sheetmask = num > 0;
|
||||
@ -1182,11 +1183,10 @@ void TMask::on_firm_change()
|
||||
for (int i = 0; i < fields(); i++)
|
||||
{
|
||||
TMask_field& f = fld(i);
|
||||
if (f._flags.firm)
|
||||
if (f._flags.firm && f.get() != firm)
|
||||
{
|
||||
f.set(firm);
|
||||
f.check(STARTING_CHECK);
|
||||
f.on_hit();
|
||||
f.on_key(K_TAB); // f.check(STARTING_CHECK); f.on_hit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// $Id: maskfld.cpp,v 1.78 1995-02-10 17:42:23 guy Exp $
|
||||
// $Id: maskfld.cpp,v 1.79 1995-02-13 17:21:17 guy Exp $
|
||||
#include <xvt.h>
|
||||
|
||||
#include <applicat.h>
|
||||
@ -2592,8 +2592,16 @@ bool TReal_field::on_key(KEY key)
|
||||
const char* n = get();
|
||||
if (*n && !real::is_real(n))
|
||||
return error_box("Valore numerico non valido");
|
||||
if (_flags.uppercase && real(n).sign() < 0)
|
||||
if (_flags.uppercase && *n == '-')
|
||||
return error_box("Il numero deve essere positivo");
|
||||
if (_flags.firm)
|
||||
{
|
||||
const long f = atol(n);
|
||||
if (!prefhndl->exist(f))
|
||||
return error_box("Ditta non utilizzabile in contabilita'");
|
||||
else
|
||||
main_app().set_firm(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ void TSheet::open()
|
||||
if (buttons_on())
|
||||
{
|
||||
// Abilita selezione se c'e' almeno un elemento
|
||||
xvt_enable_control(_button[0], items() > 0);
|
||||
xvt_enable_control(_button[0], items() > 0 && _disabled.ones() < items());
|
||||
repos_buttons();
|
||||
}
|
||||
TScroll_window::open();
|
||||
@ -273,8 +273,8 @@ bool TSheet::on_key(KEY key)
|
||||
switch(key)
|
||||
{
|
||||
case K_ENTER:
|
||||
if (items() < 1) key = K_ESC;
|
||||
if (_disabled[selected()])
|
||||
if (items() == 0) key = K_ESC;
|
||||
if (selected() < 0 || _disabled[selected()])
|
||||
break;
|
||||
case K_ESC:
|
||||
stop_run(key);
|
||||
@ -613,7 +613,9 @@ void TSheet::print()
|
||||
TArray_sheet::TArray_sheet(short x, short y, short dx, short dy,
|
||||
const char* caption, const char* head, byte buttons, WINDOW parent)
|
||||
: TSheet(x, y, dx, dy, caption, head, buttons, 0L, parent)
|
||||
{}
|
||||
{
|
||||
select(0);
|
||||
}
|
||||
|
||||
bool TArray_sheet::destroy(int i)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user