From 5dc7e80139fed26d5780805b1132af07784ce96b Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 4 May 2009 23:34:22 +0000 Subject: [PATCH] Patch level : 10.0 290 Files correlati : pe0.exe Ricompilazione Demo : [ ] Commento : Espansione righe a un livello per volta git-svn-id: svn://10.65.10.50/trunk@18814 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- pe/pe0400.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pe/pe0400.cpp b/pe/pe0400.cpp index 4879e2727..59654b401 100755 --- a/pe/pe0400.cpp +++ b/pe/pe0400.cpp @@ -32,6 +32,7 @@ class TGestione_preventivo_msk : public TDocumento_mask { int _rule; int _clipboard_row; + protected: //hanlder di documento: static bool pe_data_handler(TMask_field& f, KEY k); @@ -297,11 +298,14 @@ bool TGestione_preventivo_msk::pe_espandi_handler(TMask_field& f, KEY k) TGestione_preventivo_msk& mask = (TGestione_preventivo_msk&)f.mask(); TSheet_field& sh = mask.sfield(F_SHEET); const int r = sh.selected(); - const int size = f.dlg() == F_SHRINK_ALL ? 1 : -1; + const bool shrink = f.dlg() == F_SHRINK_ALL; + const int size = shrink ? 1 : -1; int row_to_select = 0; + FOR_EACH_SHEET_ROW(sh, i, row) { const int row_level = mask.doc()[i + 1].get_int(RDOC_LEVEL); + if (row_level > 0) sh.set_row_height(i, size); else @@ -326,13 +330,19 @@ bool TGestione_preventivo_msk::pe_espandi_riga_handler(TMask_field& f, KEY k) if (r >= 0 && r < sh.items()) { - const int size = f.dlg() == F_SHRINK_ROW ? 1 : -1; + const bool shrink = f.dlg() == F_SHRINK_ROW; + const int size = shrink ? 1 : -1; + for (int i = r + 1; i < sh.items(); i++) { const int child_level = mask.doc()[i + 1].get_int(RDOC_LEVEL); - if (child_level > level) + + if (child_level == level + 1) sh.set_row_height(i, size); else + if (child_level > level + 1) + sh.set_row_height(i, 1); + else break; } } @@ -720,4 +730,4 @@ int pe0400( int argc, char* argv[]) a.run( argc, argv, TR("Gestione Preventivi")); return 0; -} \ No newline at end of file +}