Corretto e migliorato aspetto e colorazione spreadsheet

git-svn-id: svn://10.65.10.50/branches/R_10_00@22658 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2012-05-23 14:36:59 +00:00
parent 8d8d430ce0
commit aab604b35f
11 changed files with 68 additions and 61 deletions

View File

@ -3,6 +3,7 @@
#define ANA_TIPOA "TIPOA"
#define ANA_CODANAGR "CODANAGR"
#define ANA_STATOPAIV "STATOPAIV"
#define ANA_PAIV "PAIV"
#define ANA_COFI "COFI"
#define ANA_RAGSOC "RAGSOC"

View File

@ -196,7 +196,8 @@ bool delete_box(const char* fmt, ...)
ASK_RESPONSE r = RESP_DEFAULT;
buildmsg();
const bool no_def = ini_get_bool(CONFIG_GUI, "Colors", "NoOnDelete", dongle().active(LVAUT));
const bool no_def = ini_get_bool(CONFIG_GUI, "Colors", "NoOnDelete",
dongle().number() > 0 && dongle().active(LVAUT));
if (no_def)
r = xvt_dm_post_ask("No", "Si", NULL, msg);
else

View File

@ -457,6 +457,8 @@ void customize_colors()
BTN_DARK_COLOR = colors.get_color("ButtonDark", NULL, -1, BTN_DARK_COLOR);
aga_set_pref(AGA_PREF_BTN_COLOR_DARK, BTN_DARK_COLOR);
aga_set_pref(AGA_PREF_BTN_COLOR_TEXT, PROMPT_COLOR);
if (_picture)
_picture->reload();
@ -1858,12 +1860,11 @@ void TPushbutton_control::update()
XI_RCT rct; xi_get_rect(_obj, &rct); // = _obj->v.btn->rct;
xi_inflate_rect(&rct, -3);
xi_set_clip(win, &rct);
// Cancello il testo sottostante
CBRUSH brush = { PAT_SOLID, BTN_BACK_COLOR };
xvt_dwin_set_cbrush((WINDOW)win, &brush);
xvt_dwin_set_std_cpen((WINDOW)win, TL_PEN_HOLLOW);
xi_draw_rect(win, &rct);
/*if (CAMPI_SCAVATI)
xi_draw_shaded_rect(win, &rct, _obj->v.btn->down, 2, BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR);
else*/
xi_draw_3d_rect(win, &rct, _obj->v.btn->down, 2, BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR);
const int bmp = (_bmp_dn > 0 && _obj->v.btn->down) ? _bmp_dn : _bmp_up;
if (bmp > 0)

View File

@ -1468,5 +1468,5 @@ bool Tdninst::encode(const TString& f) const
Tdninst::Tdninst() : _year_assist(0)
{
TEnigma_machine s;
_year_assist = s.year_assist(); // 2091 or 2101?
_year_assist = s.year_assist(); // 2101 or 2121?
}

View File

@ -88,12 +88,7 @@ int findfld(const RecDes *recd, const char *s)
return(FIELDERR);
}
bool __file_is_crypted(int logicnum)
{
return logicnum == LF_TURNI;
}
void __getfieldbuff(byte l, byte t, const char * recin, TString& s, bool is_crypted)
void __getfieldbuff(byte l, byte t, const char * recin, TString& s)
{
CHECK(recin, "Can't read from a Null record");
@ -153,7 +148,7 @@ void __getfieldbuff(byte l, byte t, const char * recin, TString& s, bool is_cryp
}
}
void __putfieldbuff(byte l, byte d, byte t, const char* s, char* recout, bool is_crypted)
void __putfieldbuff(byte l, byte d, byte t, const char* s, char* recout)
{
CHECK(recout, "Can't write null record" );
@ -3540,7 +3535,7 @@ const TString& TRectype::get_str(const char* fieldname) const
{
const RecFieldDes& fd = recd.Fd[nf];
TString& tmp = get_tmp_string(fd.Len + (fd.TypeF == _datefld ? 2 : 0));
__getfieldbuff(fd.Len, fd.TypeF, _rec + fd.RecOff, tmp, __file_is_crypted(num()));
__getfieldbuff(fd.Len, fd.TypeF, _rec + fd.RecOff, tmp);
return tmp;
}
else
@ -3608,7 +3603,7 @@ char TRectype::get_char(const char* fieldname) const
bool TRectype::get_bool(const char* fieldname) const
{
const char c = get_char(fieldname);
return strchr("XY1", c) != NULL;
return (c == 'X') || (c == '1');
}
TDate TRectype::get_date(const char* fieldname) const
@ -3696,7 +3691,7 @@ void TRectype::put_str(const char* fieldname, const char* val)
}
else
{
__putfieldbuff(fd.Len, fd.Dec, ft, val, _rec + fd.RecOff, __file_is_crypted(num()));
__putfieldbuff(fd.Len, fd.Dec, ft, val, _rec + fd.RecOff);
}
setempty(FALSE);
@ -3732,10 +3727,10 @@ void TRectype::zero(const char* fieldname)
switch (type)
{
case _datefld:
__putfieldbuff(len, dec, _datefld, "", p, __file_is_crypted(num()));
__putfieldbuff(len, dec, _datefld, "", p);
break;
case _memofld:
__putfieldbuff(len, dec, _memofld, "", p, __file_is_crypted(num()));
__putfieldbuff(len, dec, _memofld, "", p);
_memo_data->add("", nf);
_memo_data->set_dirty(nf);
break;
@ -4147,7 +4142,7 @@ int TRecfield::operator =(int i)
{
TString16 buff; buff << i;
if (_sub_field.empty())
__putfieldbuff( _len, _dec, _type, buff, _p, __file_is_crypted(_rec->num()));
__putfieldbuff( _len, _dec, _type, buff, _p);
else
put_subfield(buff);
_rec->setempty(FALSE);
@ -4159,7 +4154,7 @@ long TRecfield::operator =(long l)
{
TString16 buff; buff << l;
if (_sub_field.empty())
__putfieldbuff( _len, _dec, _type, buff, _p, __file_is_crypted(_rec->num()));
__putfieldbuff( _len, _dec, _type, buff, _p);
else
put_subfield(buff);
_rec->setempty(false);
@ -4170,7 +4165,7 @@ const real& TRecfield::operator =(const real& r)
{
const char* buff = r.string();
if (_sub_field.empty())
__putfieldbuff( _len, _dec, _type, buff, _p, __file_is_crypted(_rec->num()));
__putfieldbuff( _len, _dec, _type, buff, _p);
else
put_subfield(buff);
_rec->setempty(FALSE);
@ -4181,7 +4176,7 @@ const TDate& TRecfield::operator =(const TDate& d)
{
const TString16 buff = d.stringa();
if (_sub_field.empty())
__putfieldbuff( _len, _dec, _type, buff, _p, __file_is_crypted(_rec->num()));
__putfieldbuff( _len, _dec, _type, buff, _p);
else
put_subfield(buff);
_rec->setempty(FALSE);
@ -4195,7 +4190,7 @@ const char* TRecfield::operator =(const char* s)
if (_type == _memofld)
_rec->put(_name, s);
else
__putfieldbuff( _len, _dec, _type, s, _p, __file_is_crypted(_rec->num()));
__putfieldbuff( _len, _dec, _type, s, _p);
}
else
put_subfield(s);
@ -4257,7 +4252,7 @@ TRecfield::operator int() const
if (_type == _intfld || _type == _intzerofld || _type == _longfld || _type == _longzerofld)
tmp.strncpy(_p, _len);
else
__getfieldbuff( _len, _type, _p, tmp, __file_is_crypted(_rec->num()));
__getfieldbuff( _len, _type, _p, tmp);
}
else
get_subfield(tmp);
@ -4274,7 +4269,7 @@ TRecfield::operator long() const
if (_type == _longfld || _type == _longzerofld || _type == _intfld || _type == _intzerofld)
tmp.strncpy(_p, _len);
else
__getfieldbuff( _len, _type, _p, tmp, __file_is_crypted(_rec->num()));
__getfieldbuff( _len, _type, _p, tmp);
}
else
get_subfield(tmp);
@ -4292,7 +4287,7 @@ TRecfield::operator const real() const
if (_type == _realfld)
tmp.strncpy(_p, _len);
else
__getfieldbuff( _len, _type, _p, tmp, __file_is_crypted(_rec->num()));
__getfieldbuff( _len, _type, _p, tmp);
}
else
get_subfield(tmp);
@ -4312,7 +4307,7 @@ TRecfield::operator TDate() const
tmp.strncpy(_p, 8);
return TDate(atol(tmp));
}
__getfieldbuff(_len, _type, _p, tmp, __file_is_crypted(_rec->num()));
__getfieldbuff(_len, _type, _p, tmp);
}
else
get_subfield(tmp);
@ -4329,7 +4324,7 @@ TRecfield::operator const char*() const
{
if (_type == _memofld)
return _rec->get(_name);
__getfieldbuff(_len, _type, _p, tmp, __file_is_crypted(_rec->num()));
__getfieldbuff(_len, _type, _p, tmp);
}
else
get_subfield(tmp);

View File

@ -1320,7 +1320,7 @@ WINDOW TMask::create_book(bool single)
CHECK(_single == NULL_WIN, "Notebook and Single?");
XVT_COLOR_COMPONENT xcc[4]; memset(xcc, 0, sizeof(xcc));
xcc[0].type = XVT_COLOR_BACKGROUND; xcc[0].color = MASK_BACK_COLOR;
xcc[1].type = XVT_COLOR_FOREGROUND; xcc[1].color = NORMAL_COLOR;
xcc[1].type = XVT_COLOR_FOREGROUND; xcc[1].color = PROMPT_COLOR;
WIN_DEF wd; memset(&wd, 0, sizeof(wd));
wd.wtype = WC_NOTEBK;

View File

@ -406,8 +406,10 @@ void TMask_field::construct(TScanner& scanner, WINDOW parent)
{
long mod = _modules->last_one();
for (; mod > BAAUT; mod--)
if (main_app().has_module(mod))
{
if (in_module(mod) && main_app().has_module(mod))
break;
}
if (mod <= 0)
_ctl_data._flags << 'H';
}
@ -3270,7 +3272,7 @@ const char* TReal_field::win2raw(const char* data) const
}
else
{
real n(real::ita2eng(data));
const real n = real::ita2eng(data);
if (n.is_zero())
str.cut(0);
else

View File

@ -607,9 +607,8 @@ TSpreadsheet::TSpreadsheet(
else
_column_disabled.set(i);
coldef = xi_add_column_def(listdef, cid, flags, cid,
v_width[i] * XI_FU_MULTIPLE, m_width[i],
(char*)(const char*)testo);
coldef = xi_add_column_def(listdef, cid, flags, cid, v_width[i] * XI_FU_MULTIPLE,
m_width[i], (char*)(const char*)testo);
coldef->app_data = (long)this;
coldef->v.column->heading_platform = true;
@ -1598,6 +1597,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
const int sel = xvtil_drop_down_list(&cell, lst.get_codes(), lst.get_values());
if (sel >= 0)
copy_cell2field(&cell);
_ignore_button = clock() + 250;
}
else // edit_field
{

View File

@ -1275,27 +1275,31 @@ const char *real::eng2ita (char *s)
// Elimina gli spazi ed i punti, converte le virgole in punti
const char *real::ita2eng (const char *s)
{
TString& tmp = get_tmp_string();
char* __string = tmp.get_buffer(strlen(s));
char* __string = "";
if (s && *s)
{
TString& tmp = get_tmp_string();
__string = tmp.get_buffer(strlen(s));
int j = 0;
if (s)
for (int i = 0; s[i]; i++)
{
switch (s[i])
int j = 0;
if (s)
for (int i = 0; s[i]; i++)
{
case ' ':
case '.':
break;
case ',':
__string[j++] = '.';
break;
default:
__string[j++] = s[i];
break;
switch (s[i])
{
case ' ':
case '.':
break;
case ',':
__string[j++] = '.';
break;
default:
__string[j++] = s[i];
break;
}
}
}
__string[j] = '\0';
__string[j] = '\0';
}
return __string;
}

View File

@ -1254,7 +1254,7 @@ bool TRelation_application::relation_remove()
TRelation& r = *get_relation();
r.restore_status();
if (protected_record(r))
return message_box(TR("Elemento non eliminabile"));
return warning_box(TR("Elemento non eliminabile"));
if (_curr_transaction == TRANSACTION_DELETE ||
delete_box(FR("Confermare l'eliminazione del record %s"), r.file().description()))

View File

@ -2955,13 +2955,16 @@ void TReport::msg_isam_read(TVariant_stack& stack)
{ // scansione sugli elementi dell'input
curr = tok;
const int poseq= curr.find('='); // divide la stringa corrente in lvalue e rvalue
int posrv = poseq+1;
if (curr[posrv] == '=')
posrv++;
if (poseq > 0)
{
int posrv = poseq+1;
if (curr[posrv] == '=')
posrv++;
evaluate(curr.mid(posrv), var, _alfafld);
const TString& fld = curr.left(poseq); // preleva il nome del campo del file alla sinistra dell'uguale
keyrec.put(fld, var.as_string()); // scrive il risultato dell'espressione nel campo del file
evaluate(curr.mid(posrv), var, _alfafld);
const TString& fld = curr.left(poseq); // preleva il nome del campo del file alla sinistra dell'uguale
keyrec.put(fld, var.as_string()); // scrive il risultato dell'espressione nel campo del file
}
}