defmask.h Tolta sdefinizione di min e max
expr.cpp Cambiato in yesnofatal un fatal form.cpp Io non cio' colpa maskfld.cpp Cambiata gestione K_TAB per validate degli edit field relapp.cpp Io non cio' colpa sheet.cpp Aggiunte righe multiple uml.h Sdefiniti min e max git-svn-id: svn://10.65.10.50/trunk@4678 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
37455c490a
commit
2487f8653a
@ -31,7 +31,7 @@
|
||||
#define DLG_F8 27 /* TAG del bottone <Ricerca zoom> */
|
||||
#define DLG_FAX 28 /* TAG del bottone <Fax> */
|
||||
#define DLG_USER 100 /* TAG del primo controllo definito dall'utente */
|
||||
|
||||
|
||||
/* @M
|
||||
Funzioni di libreria per i validate delle maschere
|
||||
Nome descrizione Parametri
|
||||
|
@ -190,8 +190,8 @@ TExpression::TExpression(const char* expression, TTypeexp type, bool ignore_err)
|
||||
: _original(expression)
|
||||
|
||||
{
|
||||
_ignore_error=ignore_err;
|
||||
_error=0;
|
||||
_ignore_error=ignore_err;
|
||||
_error=0;
|
||||
_val = real(0.0);
|
||||
_dirty = TRUE;
|
||||
_type = type;
|
||||
@ -203,8 +203,8 @@ TExpression::TExpression(const char* expression, TTypeexp type, bool ignore_err)
|
||||
TExpression::TExpression(TTypeexp type, bool ignore_err)
|
||||
: _original("")
|
||||
{
|
||||
_ignore_error=ignore_err;
|
||||
_error=0;
|
||||
_ignore_error=ignore_err;
|
||||
_error=0;
|
||||
_val = real(0.0);
|
||||
_dirty = FALSE;
|
||||
_type = type;
|
||||
@ -305,7 +305,7 @@ void TExpression::setvar(int varnum, const char* val)
|
||||
|
||||
bool TExpression::print_error(const char* msg) const
|
||||
{
|
||||
return fatal_box("%s", msg);
|
||||
return yesnofatal_box("%s", msg);
|
||||
}
|
||||
|
||||
void TExpression::eval()
|
||||
@ -384,12 +384,12 @@ void TExpression::eval()
|
||||
if (r.is_zero())
|
||||
{
|
||||
if (!evalstack.peek_real().is_zero())
|
||||
if (_ignore_error)
|
||||
_error=1;
|
||||
else
|
||||
print_error("Divisione per zero!");
|
||||
if (_ignore_error)
|
||||
_error=1;
|
||||
else
|
||||
print_error("Divisione per zero!");
|
||||
} else
|
||||
evalstack.peek_real() /= r;
|
||||
evalstack.peek_real() /= r;
|
||||
}
|
||||
break;
|
||||
case _chgs:
|
||||
|
6352
include/form.cpp
6352
include/form.cpp
File diff suppressed because it is too large
Load Diff
@ -2889,16 +2889,18 @@ bool TEdit_field::default_error_box() const
|
||||
bool TEdit_field::on_key(KEY key)
|
||||
{
|
||||
const int vf = validate_func();
|
||||
static bool search_in_progress = FALSE;
|
||||
|
||||
switch(key)
|
||||
{
|
||||
case K_CTRL+K_TAB:
|
||||
set_focusdirty(FALSE);
|
||||
break;
|
||||
case K_TAB:
|
||||
case K_TAB:
|
||||
/*
|
||||
if (vf >= 0 && (vf == AUTOEXIT_FUNC || vf == NUMCALC_FUNC || vf == STRCALC_FUNC))
|
||||
set_focusdirty(); // Forza validate
|
||||
*/
|
||||
|
||||
if (to_check(K_TAB, TRUE))
|
||||
{
|
||||
if (class_id() == CLASS_EDIT_FIELD) // Altrimenti l'ha gia' fatto
|
||||
@ -3086,9 +3088,10 @@ bool TEdit_field::check(CheckTime t)
|
||||
return ok;
|
||||
}
|
||||
|
||||
void TEdit_field::set_query_button( TBrowse_button * brw)
|
||||
void TEdit_field::set_query_button(TBrowse_button * brw)
|
||||
{
|
||||
if (_browse) delete _browse;
|
||||
if (_browse)
|
||||
delete _browse;
|
||||
_browse=brw;
|
||||
}
|
||||
|
||||
@ -3217,6 +3220,10 @@ const char* TDate_field::win2raw(
|
||||
{
|
||||
g += 2;
|
||||
} else
|
||||
if (s == "ALTROIERI")
|
||||
{
|
||||
g -= 2;
|
||||
} else
|
||||
if (s == "PRIMO")
|
||||
{
|
||||
g.set_month(1);
|
||||
@ -3907,7 +3914,7 @@ bool TList_field::on_key(KEY key)
|
||||
current(0);
|
||||
break;
|
||||
default:
|
||||
if (to_check(key, TRUE))
|
||||
if (to_check(key, TRUE) || key == K_ENTER)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
if (validate_func() >= 0)
|
||||
|
@ -707,13 +707,13 @@ int TRelation_application::read(TMask& m)
|
||||
const int max = m.fields();
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
if (m.fld(i).is_sheet()) {
|
||||
TSheet_field& f = (TSheet_field& )m.fld(i);
|
||||
if (f.record() && !f.external_record()) {
|
||||
f.record()->read(*f.putkey(r));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (m.fld(i).is_sheet())
|
||||
{
|
||||
TSheet_field& f = (TSheet_field&)m.fld(i);
|
||||
if (f.record() && !f.external_record())
|
||||
f.record()->read(*f.putkey(r));
|
||||
}
|
||||
}
|
||||
m.autoload(r);
|
||||
return NOERR;
|
||||
}
|
||||
@ -721,11 +721,11 @@ int TRelation_application::read(TMask& m)
|
||||
|
||||
int TRelation_application::write(const TMask& m)
|
||||
{
|
||||
int err;
|
||||
int err;
|
||||
|
||||
TRelation &r = *get_relation();
|
||||
m.autosave(r);
|
||||
// write relation and all independent sheets
|
||||
// write relation and all independent sheets
|
||||
r.write();
|
||||
err=r.status();
|
||||
const int max = m.fields();
|
||||
@ -734,7 +734,7 @@ int TRelation_application::write(const TMask& m)
|
||||
if (m.fld(i).is_sheet()) {
|
||||
TSheet_field& f = (TSheet_field& )m.fld(i);
|
||||
if (f.record() && !f.external_record())
|
||||
err|=f.record()->write(FALSE);
|
||||
err|=f.record()->write(FALSE);
|
||||
}
|
||||
}
|
||||
return err;
|
||||
@ -743,11 +743,11 @@ int TRelation_application::write(const TMask& m)
|
||||
|
||||
int TRelation_application::rewrite(const TMask& m)
|
||||
{
|
||||
int err;
|
||||
int err;
|
||||
|
||||
TRelation& r = *get_relation();
|
||||
m.autosave(r);
|
||||
// rewrite relation and all independent sheets
|
||||
// rewrite relation and all independent sheets
|
||||
r.rewrite();
|
||||
err=r.status();
|
||||
const int max = m.fields();
|
||||
@ -756,7 +756,7 @@ int TRelation_application::rewrite(const TMask& m)
|
||||
if (m.fld(i).is_sheet()) {
|
||||
TSheet_field& f = (TSheet_field& )m.fld(i);
|
||||
if (f.record()&& !f.external_record())
|
||||
err|=f.record()->write(TRUE);
|
||||
err|=f.record()->write(TRUE);
|
||||
}
|
||||
}
|
||||
return err;
|
||||
@ -803,7 +803,7 @@ bool TRelation_application::remove()
|
||||
if (m.fld(i).is_sheet()) {
|
||||
TSheet_field& f = (TSheet_field& )m.fld(i);
|
||||
if (f.record()&& !f.external_record())
|
||||
err|=f.record()->remove();
|
||||
err|=f.record()->remove();
|
||||
}
|
||||
}
|
||||
return err == NOERR;
|
||||
|
@ -107,6 +107,7 @@ TSheet_control::TSheet_control(
|
||||
short v_width[MAX_COL];
|
||||
short m_width[MAX_COL];
|
||||
int fixed_columns = 1; // Number of fixed columns
|
||||
int lines_in_cell = 1;
|
||||
|
||||
_sheet = (TSheet*)xvt_vobj_get_data(parent);
|
||||
|
||||
@ -153,11 +154,15 @@ TSheet_control::TSheet_control(
|
||||
v = max(at, v);
|
||||
}
|
||||
|
||||
v++;
|
||||
m_width[i] = v; // v = memory width of column
|
||||
if (v > 64) v = 64;
|
||||
v_width[i] = v;
|
||||
if (v_width[i] > max_width) max_width = v_width[i];
|
||||
if (v > 64)
|
||||
{
|
||||
lines_in_cell = (v-1) / 64 + 1;
|
||||
v = 64;
|
||||
}
|
||||
m_width[i] = v*lines_in_cell + 1;
|
||||
v_width[i] = v+1;
|
||||
if (v > max_width)
|
||||
max_width = v;
|
||||
|
||||
new_header.add(testa);
|
||||
}
|
||||
@ -184,6 +189,7 @@ TSheet_control::TSheet_control(
|
||||
|
||||
XI_LIST_DEF* l = listdef->v.list;
|
||||
l->min_heading_height = xi_button_calc_height_font_id(xvt_default_font());
|
||||
l->max_lines_in_cell = lines_in_cell;
|
||||
l->sizable_columns = TRUE;
|
||||
l->movable_columns = TRUE;
|
||||
l->fixed_columns = fixed_columns;
|
||||
@ -214,6 +220,8 @@ TSheet_control::TSheet_control(
|
||||
coldef->app_data = (long)this;
|
||||
coldef->v.column->heading_platform = TRUE;
|
||||
coldef->v.column->center_heading = TRUE;
|
||||
if (m_width[i] > 64)
|
||||
coldef->v.column->wrap_text = TRUE;
|
||||
|
||||
if (i == 0 && _type[i] == 'C')
|
||||
{
|
||||
@ -913,7 +921,7 @@ TSheet::TSheet(short x, short y, short dx, short dy,
|
||||
_parked(-1), _sheet(NULL), _select_row(-1)
|
||||
{
|
||||
TQuery_field* qf = new TQuery_field(this);
|
||||
qf->construct(30883, head, 1, sht_y, -3, win(), "", -1);
|
||||
qf->construct(30883, head, 1, sht_y, sht_y == 0 ? -3 : -2, win(), "", -1);
|
||||
fields_array().add(qf);
|
||||
_sheet = qf->sheet();
|
||||
|
||||
@ -1474,13 +1482,15 @@ TBrowse_sheet::TBrowse_sheet(TCursor* cursor, const char* fields,
|
||||
if (c.uppercase()) flags << 'U';
|
||||
if (c.zerofilled()) flags << 'Z';
|
||||
|
||||
const int csize = c.size();
|
||||
|
||||
switch (c.class_id())
|
||||
{
|
||||
case CLASS_EDIT_FIELD:
|
||||
e = &add_string(c.dlg(), 0, p, 1, y++, c.size(), flags, c.size() > 50 ? 50 : c.size() );
|
||||
e = &add_string(c.dlg(), 0, p, 1, y++, csize, flags, csize > 50 ? 50 : csize);
|
||||
break;
|
||||
case CLASS_REAL_FIELD:
|
||||
e = &add_number(c.dlg(), 0, p, 1, y++, c.size(), flags);
|
||||
e = &add_number(c.dlg(), 0, p, 1, y++, csize, flags);
|
||||
break;
|
||||
case CLASS_DATE_FIELD:
|
||||
e = &add_date (c.dlg(), 0, p, 1, y++, flags);
|
||||
|
@ -6,6 +6,8 @@
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user