From a07348f10ee3cb5305aaab1534e8c96774fc1949 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 22 May 1997 14:12:49 +0000 Subject: [PATCH] cg2100k.uml Aggiunto bottone di azzeramento cg2102.h Aggiunto metodo per azzerare i colori correnti cg2106.cpp Aggiunta gestione azzeramento colori git-svn-id: svn://10.65.10.50/trunk@4374 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg2100k.uml | 13 +++++++++---- cg/cg2102.h | 2 +- cg/cg2106.cpp | 24 +++++++++++++++++++++++- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/cg/cg2100k.uml b/cg/cg2100k.uml index b613a20f5..c4ca72670 100755 --- a/cg/cg2100k.uml +++ b/cg/cg2100k.uml @@ -1,4 +1,4 @@ -PAGE "Colori delle righe di prima nota" -1 -1 40 10 +PAGE "Colori delle righe di prima nota" -1 -1 42 10 SPREADSHEET 101 -1 -3 BEGIN @@ -7,14 +7,19 @@ BEGIN FLAGS "D" END -BUTTON DLG_OK 10 2 +BUTTON 102 10 2 BEGIN - PROMPT -12 -1 "" + PROMPT -13 -1 "Azzera" END BUTTON DLG_CANCEL 10 2 BEGIN - PROMPT -22 -1 "" + PROMPT -23 -1 "" +END + +BUTTON DLG_OK 10 2 +BEGIN + PROMPT -33 -1 "" END ENDPAGE diff --git a/cg/cg2102.h b/cg/cg2102.h index b88550c72..9bfa31e3b 100755 --- a/cg/cg2102.h +++ b/cg/cg2102.h @@ -271,7 +271,7 @@ public: void type2colors(char tipor, COLOR& back, COLOR& fore); void set_type_colors(char tipor, COLOR back, COLOR fore); - + void reset_colors(); TCausale& causale() const { return *_causale; } TPartite_array& partite() { return _partite; } // Partite editate diff --git a/cg/cg2106.cpp b/cg/cg2106.cpp index eee849b3d..4d5c1f95e 100755 --- a/cg/cg2106.cpp +++ b/cg/cg2106.cpp @@ -23,6 +23,7 @@ class TColor_mask : public TVariable_mask protected: static bool color_handler(TMask_field& f, KEY k); + static bool reset_handler(TMask_field& f, KEY k); public: void get_cur_colors(COLOR& back, COLOR& fore) const; @@ -113,9 +114,23 @@ bool TColor_mask::color_handler(TMask_field& f, KEY k) return TRUE; } +bool TColor_mask::reset_handler(TMask_field& f, KEY k) +{ + if (k == K_SPACE && yesno_box("Si desidera azzerare tutti i colori?")) + { + app().reset_colors(); + TSheet_field& s = (TSheet_field&)f.mask().field(101); + s.set_back_and_fore_color(NORMAL_BACK_COLOR, NORMAL_COLOR, -1); + s.force_update(); + } + return TRUE; +} + TColor_mask::TColor_mask() : TVariable_mask("cg2100k") { + set_handler(102, reset_handler); + CHECK(_sheet_mask == NULL, "One color at time, please"); _sheet_mask = new TRow_mask; _sheet_mask->set_handler(99, color_handler); @@ -255,13 +270,20 @@ void TPrimanota_application::set_type_colors(char tipor, COLOR back, COLOR fore) set_type_color(tipor, 'F', fore); } -void TPrimanota_application::set_colors() +void TPrimanota_application::reset_colors() { + _colori.destroy(); +} + +void TPrimanota_application::set_colors() +{ + disable_menu_item(M_FONT); TColor_mask colors; if (colors.run() == K_ENTER) app().save_colors(); else app().load_colors(); + enable_menu_item(M_FONT); } ///////////////////////////////////////////////////////////