Patch level : 12.00 1326

Files correlati     : ci2.exe ci2200a.msk
Commento :

Evidenziato il periodo corrente
This commit is contained in:
Alessandro Bonazzi 2024-08-09 20:10:50 +02:00
parent d9029aba30
commit d5b3500eae
3 changed files with 23 additions and 6 deletions

View File

@ -28,6 +28,7 @@ class TRil_tree : public TBidirectional_tree
typedef enum { _normal, _holiday, _full } _type; typedef enum { _normal, _holiday, _full } _type;
TString_array _content; TString_array _content;
_type _t[64]; _type _t[64];
int _curr_period;
int _curr_node; int _curr_node;
TString4 _dett; TString4 _dett;
int _month; int _month;
@ -50,6 +51,8 @@ public:
const TString &id() const { return *(TString *)curr_node(); } const TString &id() const { return *(TString *)curr_node(); }
const TString &id(int pos) const { return _content.row(pos); } const TString &id(int pos) const { return _content.row(pos); }
virtual void node2id(const TObject* obj, TString& id) const; virtual void node2id(const TObject* obj, TString& id) const;
void set_curr_period() { _curr_period = _curr_node; }
void reset_curr_period() { _curr_period = -1; }
virtual bool has_root() const; virtual bool has_root() const;
virtual bool has_father() const { return false; } virtual bool has_father() const { return false; }
@ -60,7 +63,7 @@ public:
virtual TImage* image(bool selected) const; virtual TImage* image(bool selected) const;
public: public:
TRil_tree() : _curr_node(0), _dett("") {} TRil_tree() : _curr_node(0), _curr_period(-1), _dett("") {}
}; };
@ -249,6 +252,8 @@ void TRil_tree::node2id(const TObject* obj, TString& id) const
TImage* TRil_tree::image(bool selected) const TImage* TRil_tree::image(bool selected) const
{ {
if (_curr_period == _curr_node)
return get_res_icon(ICO_CHECK_ON);
switch (_t[_curr_node]) switch (_t[_curr_node])
{ {
case _normal: case _normal:
@ -1441,8 +1446,9 @@ bool TRilevamento_cons_msk::on_field_event(TOperable_field& f, TField_event e, l
_mese = ((TRil_tree *) tfield(F_CALENDARIO).tree())->pos() + 1; _mese = ((TRil_tree *) tfield(F_CALENDARIO).tree())->pos() + 1;
else else
_giorno = atoi(*((TString *) ((TRil_tree *) tfield(F_CALENDARIO).tree())->curr_node())); _giorno = atoi(*((TString *) ((TRil_tree *) tfield(F_CALENDARIO).tree())->curr_node()));
set(F_GIORNO, _giorno);
((TRil_tree *)tfield(F_CALENDARIO).tree())->set_curr_period();
tfield(F_CALENDARIO).force_update();
riempi_sheet(); riempi_sheet();
} }
break; break;
@ -1465,18 +1471,22 @@ bool TRilevamento_cons_msk::on_field_event(TOperable_field& f, TField_event e, l
{ {
hide(F_ANNO); hide(F_ANNO);
hide(F_MESE); hide(F_MESE);
hide(F_GIORNO);
} }
else else
if (dett == "M") if (dett == "M")
{ {
show(F_ANNO); show(F_ANNO);
hide(F_MESE); hide(F_MESE);
hide(F_GIORNO);
} }
else else
{ {
show(F_ANNO); show(F_ANNO);
show(F_MESE); show(F_MESE);
show(F_GIORNO);
} }
((TRil_tree *)tfield(F_CALENDARIO).tree())->reset_curr_period();
update_tree(); update_tree();
riempi_sheet(); riempi_sheet();
} }
@ -1695,4 +1705,4 @@ int ci2200(int argc, char *argv[])
TRilevamento_cons_app a; TRilevamento_cons_app a;
a.run (argc, argv, TR("Rilevamento Ore Consuntivo")); a.run (argc, argv, TR("Rilevamento Ore Consuntivo"));
return TRUE; return TRUE;
} }

View File

@ -29,6 +29,7 @@
#define F_INTERVALLO 331 #define F_INTERVALLO 331
#define F_OREDIS 332 #define F_OREDIS 332
#define F_ORECONS 333 #define F_ORECONS 333
#define F_GIORNO 334
#define DLG_RESET 900 #define DLG_RESET 900
#define DLG_CERCA 901 #define DLG_CERCA 901

View File

@ -40,7 +40,7 @@ END
LISTBOX F_INTERVALLO 1 6 LISTBOX F_INTERVALLO 1 6
BEGIN BEGIN
PROMPT 2 1 "@bIntervallo " PROMPT 2 1 "@bIntervallo "
ITEM "A|Anno" ITEM "A|Anno"
ITEM "M|Mese" ITEM "M|Mese"
ITEM "G|Giorno" ITEM "G|Giorno"
FLAGS "Z" FLAGS "Z"
@ -58,9 +58,15 @@ BEGIN
FLAGS "M" FLAGS "M"
END END
NUMBER F_GIORNO 2
BEGIN
PROMPT 45 2 "Giorno "
FLAGS "D"
END
STRING F_TPORA 2 STRING F_TPORA 2
BEGIN BEGIN
PROMPT 44 2 "Tipo ora " PROMPT 56 2 "Tipo ora "
USE &ORE USE &ORE
INPUT CODTAB F_TPORA INPUT CODTAB F_TPORA
DISPLAY "Codice@16" CODTAB DISPLAY "Codice@16" CODTAB