Patch level : 10.0 260
Files correlati : vearea.men ve0.exe Ricompilazione Demo : [ ] Commento : Aggiunto a menu programma per definizione conti per categoria Aggiunto supporto per le Property Grid git-svn-id: svn://10.65.10.50/trunk@18534 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
51ed2733f0
commit
086abf8986
@ -205,10 +205,11 @@ Item_02 = "Agenti e dati generali", "ve0 -2 -2", "F"
|
||||
Item_03 = "Contabilizzazione sconti", "ve0 -2 -3", "F"
|
||||
Item_04 = "Contabilizzazione spese e bolli", "ve0 -2 -4", "F"
|
||||
Item_05 = "Contabilizzazione", "ve0 -2 -5", "F"
|
||||
Item_06 = "Gestione spese e bolli", "ve0 -2 -6", "F"
|
||||
Item_07 = "Articoli e Distinte", "ve0 -2 -7", "F"
|
||||
Item_08 = "Configurazione contabilita'", "cg5 -1", "F"
|
||||
Item_09 = "Fido cliente", "ve0 -2 -8", "F"
|
||||
Item_06 = "Conti per categoria e gruppo", "ve0 -6 &CVM", "F"
|
||||
Item_07 = "Gestione spese e bolli", "ve0 -2 -6", "F"
|
||||
Item_08 = "Articoli e Distinte", "ve0 -2 -7", "F"
|
||||
Item_09 = "Configurazione contabilita'", "cg5 -1", "F"
|
||||
Item_10 = "Fido cliente", "ve0 -2 -8", "F"
|
||||
|
||||
[ACQVEN_021]
|
||||
Caption = "Servizi"
|
||||
|
43
ve/velib.h
43
ve/velib.h
@ -841,33 +841,13 @@ class TStati : public TObject
|
||||
{
|
||||
char _iniziale;
|
||||
char _finale;
|
||||
public:
|
||||
|
||||
public:
|
||||
char iniziale() const { return _iniziale;}
|
||||
char finale() const { return _finale;}
|
||||
|
||||
TStati(char iniziale, char finale) { _iniziale = iniziale; _finale = finale;}
|
||||
virtual ~TStati() { }
|
||||
};
|
||||
|
||||
class TRow_colors : public TObject
|
||||
{
|
||||
COLOR _back;
|
||||
COLOR _fore;
|
||||
|
||||
protected:
|
||||
|
||||
virtual TObject* dup() const { return new TRow_colors(*this); }
|
||||
virtual TRow_colors & copy(const TRow_colors & c) { set(c.back(), c.fore()); return *this; }
|
||||
|
||||
public:
|
||||
void set(COLOR back, COLOR fore) { _back = back; _fore = fore;}
|
||||
COLOR back() const { return _back; }
|
||||
COLOR fore() const { return _fore; }
|
||||
|
||||
TRow_colors(COLOR back, COLOR fore) { set(back, fore);}
|
||||
~TRow_colors() {}
|
||||
};
|
||||
|
||||
class TDocumento_mask : public TVariable_mask // velib06
|
||||
{
|
||||
@ -882,7 +862,7 @@ class TDocumento_mask : public TVariable_mask // velib06
|
||||
TBit_array _calculated_pages;
|
||||
|
||||
bool _ges_mag, _ges_dep, _ges_ca;
|
||||
TString _std_mag, _std_dep;
|
||||
TString8 _std_mag, _std_dep;
|
||||
TSmart_card * _smartcard;
|
||||
static TAssoc_array _father_rows;
|
||||
static TAssoc_array _auto_reopen_nums;
|
||||
@ -895,12 +875,8 @@ class TDocumento_mask : public TVariable_mask // velib06
|
||||
short _cdc_end_sh;
|
||||
short _cms_start_sh;
|
||||
short _cms_end_sh;
|
||||
TString _codcms;
|
||||
TString _codcms_sh;
|
||||
TArray _colors;
|
||||
TArray _def_colors;
|
||||
TString _codcms, _codcms_sh;
|
||||
TArray _color_rules;
|
||||
TString_array _color_rule_names;
|
||||
|
||||
protected:
|
||||
virtual void next_page(int p);
|
||||
@ -988,14 +964,13 @@ public:
|
||||
short cdc_end_sh() const { return _cdc_end_sh;}
|
||||
short cms_start_sh() const { return _cms_start_sh;}
|
||||
short cms_end_sh() const { return _cms_end_sh;}
|
||||
TString & codcms() { return _codcms;}
|
||||
const TString & codcms() const { return _codcms;}
|
||||
TString & codcms_sh() { return _codcms_sh;}
|
||||
TString& codcms() { return _codcms;}
|
||||
const TString& codcms() const { return _codcms;}
|
||||
TString& codcms_sh() { return _codcms_sh;}
|
||||
const TString & codcms_sh() const { return _codcms_sh;}
|
||||
|
||||
TArray & colors() { return _colors; }
|
||||
TArray & color_rules() { return _color_rules; }
|
||||
TString_array & color_rule_names() { return _color_rule_names; }
|
||||
|
||||
TArray& color_rules() { return _color_rules; }
|
||||
|
||||
void sel_color();
|
||||
|
||||
|
||||
|
222
ve/velib06.cpp
222
ve/velib06.cpp
@ -30,6 +30,10 @@
|
||||
#include "rcondv.h"
|
||||
#include <occas.h>
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TOriginal_row_mask
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TOriginal_row_mask : public TAutomask
|
||||
{
|
||||
protected:
|
||||
@ -52,6 +56,36 @@ bool TOriginal_row_mask::on_key(KEY key)
|
||||
return TAutomask::on_key(key);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TColor_rule
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TColor_rule : public TExpr_documento
|
||||
{
|
||||
COLOR _back, _fore, _def_back, _def_fore;
|
||||
TString _desc, _key;
|
||||
|
||||
public:
|
||||
const TString& description() const { return _desc; }
|
||||
const TString& key() const { return _key; }
|
||||
void default_colors(COLOR& back, COLOR& fore) const { back = _def_back; fore = _def_fore; }
|
||||
void colors(COLOR& back, COLOR& fore) const { back = _back; fore = _fore; }
|
||||
void set_colors(COLOR back, COLOR fore) { _back = back; _fore = fore; }
|
||||
|
||||
TColor_rule(const char* desc, const char* expr, TTypeexp type, COLOR back, COLOR fore);
|
||||
};
|
||||
|
||||
TColor_rule::TColor_rule(const char* desc, const char* expr, TTypeexp type, COLOR back, COLOR fore)
|
||||
: TExpr_documento(expr, type), _back(back), _fore(fore), _def_back(back), _def_fore(fore)
|
||||
{
|
||||
_desc = dictionary_translate(desc);
|
||||
_key = desc; _key.trim(); _key.strip_double_spaces();
|
||||
_key.replace(' ', '_');
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TDocumento_mask
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
TDocumento_mask::TDocumento_mask(const char* td)
|
||||
: TVariable_mask(), _progs_page(-1), _condv(NULL), _smartcard(NULL),
|
||||
@ -261,55 +295,42 @@ TDocumento_mask::TDocumento_mask(const char* td)
|
||||
_calculated_pages.set(f->page());
|
||||
}
|
||||
|
||||
TFilename pn;
|
||||
d.tipo().profile_name(pn);
|
||||
TFilename pn; d.tipo().profile_name(pn);
|
||||
TConfig prof(pn, "Colors");
|
||||
|
||||
prof.write_protect(true);
|
||||
color_rule_names().add("Righe collegate a documento", 0);
|
||||
color_rules().add(new TExpression(""), 0);
|
||||
colors().add(new TRow_colors(prof.get_color("BgCol", NULL, 0, COLOR_YELLOW), prof.get_color("fore", NULL, 0, COLOR_BLACK)));
|
||||
|
||||
for(int i = 1; ; i++)
|
||||
COLOR back = prof.get_color("BgCol", NULL, 0, COLOR_YELLOW); // FOCUS_BACK_COLOR
|
||||
COLOR fore = prof.get_color("FgCol", NULL, 0, COLOR_BLACK); // FOCUS_COLOR
|
||||
color_rules().add(new TColor_rule("Righe collegate a documento", "", _numexpr, back, fore));
|
||||
|
||||
for (int i = 1; ; i++)
|
||||
{
|
||||
const TString & name = prof.get("RuleName", NULL, i);
|
||||
|
||||
const TString& name = prof.get("RuleName", NULL, i);
|
||||
if (name.full())
|
||||
{
|
||||
color_rule_names().add(name, i);
|
||||
TToken_string se(prof.get("Rule", NULL, i));
|
||||
const bool numeric = se.get_char(1) == 'N';
|
||||
const TString expr(se.get(0));
|
||||
|
||||
color_rules().add(new TExpression(expr, numeric ? _numexpr : _strexpr), i);
|
||||
TToken_string sb(prof.get("BgCol", NULL, i), ',');
|
||||
COLOR back = RGB2COLOR(sb.get_int(0), sb.get_int(1), sb.get_int(2));
|
||||
TToken_string sf(prof.get_color("FgCol", NULL, i), ',');
|
||||
COLOR fore = RGB2COLOR(sf.get_int(0), sf.get_int(1), sf.get_int(2));
|
||||
colors().add(new TRow_colors(back, fore));
|
||||
const TString& expr = prof.get("Rule", NULL, i);
|
||||
const TTypeexp type = prof.get_char("RuleType", NULL, i, 'N') == 'S' ? _strexpr : _numexpr ;
|
||||
back = prof.get_color("BgCol", NULL, i, NORMAL_BACK_COLOR);
|
||||
fore = prof.get_color("FgCol", NULL, i, NORMAL_COLOR);
|
||||
color_rules().add(new TColor_rule(name, expr, type, back, fore));
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
_def_colors = colors();
|
||||
TString tmp(doc().tipo().mask_name()); tmp << "_0"; tmp.lower();
|
||||
|
||||
// Legge i colori personalizzati dal .ini gestito dalla TSelect_color_mask
|
||||
TString tmp; tmp << doc().tipo().mask_name() << "_0"; tmp.lower();
|
||||
TConfig conf(CONFIG_GUI, tmp);
|
||||
const int items = colors().items();
|
||||
|
||||
conf.write_protect(true);
|
||||
for (int i = 0; i < items; i++)
|
||||
conf.write_protect();
|
||||
FOR_EACH_ARRAY_ITEM(color_rules(), j, o)
|
||||
{
|
||||
tmp = color_rule_names().row(i);
|
||||
TRow_colors * c = (TRow_colors *) colors().objptr(i);
|
||||
if (c != NULL)
|
||||
{
|
||||
COLOR fore = conf.get_color(tmp);
|
||||
tmp << "_Bg";
|
||||
COLOR back = conf.get_color(tmp);
|
||||
|
||||
if (back != 0L || fore != 0L)
|
||||
c->set(back, fore);
|
||||
}
|
||||
TColor_rule& c = *(TColor_rule*)o;
|
||||
tmp = c.key();
|
||||
COLOR fore = conf.get_color(tmp);
|
||||
tmp << "_Bg";
|
||||
COLOR back = conf.get_color(tmp);
|
||||
if (back != fore)
|
||||
c.set_colors(back, fore);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1658,67 +1679,59 @@ bool TDocumento_mask::clifo_handler( TMask_field& f, KEY key )
|
||||
|
||||
void TDocumento_mask::highlight_row(int row, bool dirty, bool update)
|
||||
{
|
||||
const TRiga_documento & rigadoc = doc()[row + 1];
|
||||
TRiga_documento& rigadoc = doc()[row + 1];
|
||||
TSheet_field& sf = sfield(F_SHEET);
|
||||
|
||||
COLOR back = COLOR_INVALID, fore = COLOR_INVALID;
|
||||
|
||||
for (int rule = colors().last(); rule >= 0; rule--)
|
||||
FOR_EACH_ARRAY_ITEM_BACK(color_rules(), rule, o)
|
||||
{
|
||||
TRow_colors* c = (TRow_colors*)colors().objptr(rule);
|
||||
if (c != NULL)
|
||||
TColor_rule& expr = *(TColor_rule*)o;
|
||||
bool on = false;
|
||||
if (rule == 0)
|
||||
on = rigadoc.linked(); // Regola standard
|
||||
else
|
||||
{
|
||||
bool on = false;
|
||||
if (rule == 0)
|
||||
on = rigadoc.linked(); // Regola standard
|
||||
else
|
||||
expr.set_row(&rigadoc);
|
||||
// SET VARS
|
||||
const int vars = expr.numvar();
|
||||
TString name;
|
||||
for (int i = 0; i < vars; i++)
|
||||
{
|
||||
TExpression* expr = (TExpression*)color_rules().objptr(rule);
|
||||
if (expr != NULL)
|
||||
{
|
||||
// SET VARS
|
||||
const int vars = expr->numvar();
|
||||
|
||||
for (int i = 0; i < vars; i++)
|
||||
name = expr.varname(i);
|
||||
if (name.starts_with("DIRTY"))
|
||||
expr.setvar(i, dirty ? UNO : ZERO);
|
||||
else
|
||||
if (name.starts_with("#"))
|
||||
{
|
||||
const TString name(expr->varname(i));
|
||||
|
||||
if (name.starts_with("DIRTY"))
|
||||
expr->setvar(i, dirty ? UNO : ZERO);
|
||||
const short id = atoi(name.mid(1));
|
||||
if (id > 0)
|
||||
{
|
||||
TToken_string& sheet_row = sf.row(row);
|
||||
expr.setvar(i, sheet_row.get(sf.cid2index(id)));
|
||||
}
|
||||
else
|
||||
if (name.starts_with("#"))
|
||||
{
|
||||
const short id = atoi(name.mid(1));
|
||||
if (id > 0)
|
||||
{
|
||||
TToken_string& sheet_row = sf.row(row);
|
||||
expr->setvar(i, sheet_row.get(sf.cid2index(id)));
|
||||
}
|
||||
else
|
||||
expr->setvar(i, get(-id));
|
||||
}
|
||||
else
|
||||
if (name.starts_with("33.") || name.starts_with("DOC."))
|
||||
{
|
||||
const TString& fldname = name.after('.');
|
||||
expr->setvar(i, doc().get(fldname));
|
||||
}
|
||||
else
|
||||
{
|
||||
const TString& fldname = name.find('.') > 0 ? name.after('.') : name;
|
||||
expr->setvar(i, rigadoc.get(fldname));
|
||||
}
|
||||
expr.setvar(i, get(-id));
|
||||
}
|
||||
on = expr->as_bool();
|
||||
}
|
||||
else
|
||||
if (name.starts_with("33.") || name.starts_with("DOC."))
|
||||
{
|
||||
const TString& fldname = name.after('.');
|
||||
expr.setvar(i, doc().get(fldname));
|
||||
}
|
||||
else
|
||||
{
|
||||
const TString& fldname = name.find('.') > 0 ? name.after('.') : name;
|
||||
expr.setvar(i, rigadoc.get(fldname));
|
||||
}
|
||||
}
|
||||
if (on)
|
||||
{
|
||||
back = c->back();
|
||||
fore = c->fore();
|
||||
break;
|
||||
}
|
||||
on = expr.as_bool();
|
||||
}
|
||||
if (on)
|
||||
{
|
||||
expr.colors(back, fore);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sf.set_back_and_fore_color(back, fore, row);
|
||||
@ -3678,33 +3691,24 @@ bool TDocumento_mask::confirm_handler( TMask_field& f, KEY key )
|
||||
|
||||
void TDocumento_mask::sel_color()
|
||||
{
|
||||
TString tmp(doc().tipo().mask_name()); tmp.lower();
|
||||
TSelect_color_mask sel(tmp, "0");
|
||||
|
||||
const int items = color_rule_names().items();
|
||||
|
||||
for(int i = 0; i < items; i++)
|
||||
const TString& mn = doc().tipo().mask_name();
|
||||
TSelect_color_mask sel(mn, "0");
|
||||
FOR_EACH_ARRAY_ITEM(color_rules(), i, o)
|
||||
{
|
||||
const TString & name = color_rule_names().row(i);
|
||||
TRow_colors * cd = (TRow_colors *) _def_colors.objptr(i);
|
||||
|
||||
if (cd != NULL)
|
||||
sel.add_color_def(name, name, cd->back(), cd->fore());
|
||||
const TColor_rule& col = *(const TColor_rule*)o;
|
||||
COLOR a, b; col.colors(a, b);
|
||||
COLOR c, d; col.default_colors(c, d);
|
||||
sel.add_color(col.key(), col.description(), a, b, c, d);
|
||||
}
|
||||
|
||||
if (sel.run() != K_ESC)
|
||||
{
|
||||
for (int i = 0; i < items; i++)
|
||||
{
|
||||
COLOR back;
|
||||
COLOR fore;
|
||||
TRow_colors * c = (TRow_colors *) colors().objptr(i);
|
||||
const TString & name = color_rule_names().row(i);
|
||||
|
||||
sel.get_color_def(name, back, fore);
|
||||
if (c != NULL)
|
||||
c->set(back, fore);
|
||||
}
|
||||
FOR_EACH_ARRAY_ITEM(color_rules(), i, o)
|
||||
{
|
||||
TColor_rule& col = *(TColor_rule*)o;
|
||||
COLOR back, fore; sel.get_color(col.key(), back, fore);
|
||||
col.set_colors(back, fore);
|
||||
}
|
||||
highlight();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user