diff --git a/ha/ha0400.cpp b/ha/ha0400.cpp index a5858e4e7..2af18fccf 100755 --- a/ha/ha0400.cpp +++ b/ha/ha0400.cpp @@ -22,6 +22,9 @@ class THardy_tied_mask : public TAutomask protected: virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly); + bool one_checked() const; + void check_all(const bool checked); + long fill_recordset(const long codcf, TISAM_recordset& recset); void fill_sheet(); @@ -134,12 +137,28 @@ void THardy_tied_mask::fill_sheet() sf_righe.force_update(); } -THardy_tied_mask::THardy_tied_mask() : TAutomask ("ha0400a") + +//controlla sulla colonna delle spunte se almeno una è checkata +bool THardy_tied_mask::one_checked() const { + TSheet_field& sf_righe = sfield(F_RIGHE); + FOR_EACH_SHEET_ROW(sf_righe, i, riga) + { + if (riga->get_char(0) > ' ') + return true; + } + return false; } -THardy_tied_mask::~THardy_tied_mask() +//checka-dechecka la colonna di spunte dello sheet +void THardy_tied_mask::check_all(const bool checked) { + TSheet_field& sf_righe = sfield(F_RIGHE); + + FOR_EACH_SHEET_ROW(sf_righe, i, riga) + riga->add(checked ? "X" : "", 0); + + sf_righe.force_update(); } bool THardy_tied_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) @@ -154,6 +173,15 @@ bool THardy_tied_mask::on_field_event(TOperable_field& o, TField_event e, long j if (tipo.full()) fill_sheet(); } + + //toolbar + case DLG_CHECKALL: + if (e == fe_button) + { + check_all(!one_checked()); + } + break; + default: break; break; @@ -161,6 +189,14 @@ bool THardy_tied_mask::on_field_event(TOperable_field& o, TField_event e, long j return true; } +THardy_tied_mask::THardy_tied_mask() : TAutomask ("ha0400a") +{ +} + +THardy_tied_mask::~THardy_tied_mask() +{ +} + /////////////////////////////////////// // TSkeleton_application /////////////////////////////////////// diff --git a/ha/ha0400a.h b/ha/ha0400a.h index 1ef1602db..130691ab9 100755 --- a/ha/ha0400a.h +++ b/ha/ha0400a.h @@ -1,9 +1,12 @@ +//campi maschera principale #define F_TIPOCF 201 #define F_CODCF 202 #define F_RAGSOC 203 #define F_TIPO 204 #define F_RIGHE 205 +//bottoni toolbar +#define DLG_CHECKALL 301 //maschera riga sheet #define S_CHECK 101 diff --git a/ha/ha0400a.uml b/ha/ha0400a.uml index 3ae10a5bd..3620ae556 100755 --- a/ha/ha0400a.uml +++ b/ha/ha0400a.uml @@ -2,6 +2,12 @@ TOOLBAR "" 0 0 0 2 +BUTTON DLG_CHECKALL 2 2 +BEGIN + PROMPT 1 1 "~Tutti" + PICTURE TOOL_MULTISEL +END + #include ENDPAGE