From 44a11fd33c2619a7e353ddfb705fbc65bfa20170 Mon Sep 17 00:00:00 2001 From: angelo Date: Fri, 22 Dec 1995 16:20:42 +0000 Subject: [PATCH] Aggiunto il ricalcolo della larghezza colonna per sezioni COLUMNWISE nel caso venmga cambiato il font. Piccole risistemazioni funzionali. git-svn-id: svn://10.65.10.50/trunk@2350 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- sc/sc3100.cpp | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/sc/sc3100.cpp b/sc/sc3100.cpp index fec349248..2e71b78ce 100755 --- a/sc/sc3100.cpp +++ b/sc/sc3100.cpp @@ -205,12 +205,16 @@ bool TForm_EC_editor::recalculate_positions(const char* name, int size) for (word i = 0; i < sec->fields() ; i++) { TForm_item& fi = sec->field(i); - if (fi.x() > 0 && (prm.ratio != 1.0)) + short value = sec->columnwise() ? fi.y() : fi.x(); + if (value > 0 && (prm.ratio != 1.0)) { real x_pos; - x_pos = fi.x() * prm.ratio; + x_pos = value * prm.ratio; x_pos.round(); - fi.x() = (short)x_pos.integer(); + if (sec->columnwise()) + fi.y() = (short)x_pos.integer(); + else + fi.x() = (short)x_pos.integer(); fi.set_dirty(); } } @@ -264,7 +268,7 @@ bool TForm_EC_editor::edit(char s, pagetype p) // carica i dati relativi ai flags (memorizzati in HEADER LAST) if (form().exist('H', last_page)) { - TForm_item& flags = form().section('H',last_page).find_field(PEC_FLAGS); + TForm_item& flags = form().find_field('H',last_page,PEC_FLAGS); TToken_string tt(flags.prompt()); if (tt.get(0) != NULL) m.set(F_SVALUTA,tt.get(0)); @@ -274,7 +278,7 @@ bool TForm_EC_editor::edit(char s, pagetype p) // carica i dati relativi allo sfondo (memorizzati in GRAPHICS ODD) if (form().exist('G', odd_page)) { - TForm_item& pict = form().section('G',odd_page).find_field(PEC_PICTURE); + TForm_item& pict = form().find_field('G',odd_page,PEC_PICTURE); m.set(F_BACKGROUND,pict.prompt()); m.set(F_BACKWIDTH,pict.width()); m.set(F_BACKHEIGHT,pict.height()); @@ -296,7 +300,7 @@ bool TForm_EC_editor::edit(char s, pagetype p) else if (k==K_F5) local_dirty = edit_formato_numero(); else if (k!= K_ESC && k!=K_ENTER) { - if (k==K_F6) { s = 'H'; caption = "Testa"; } + if (k==K_F6) { s = 'H'; caption = "Testata"; } else if (k==K_F7) { s = 'B'; caption = "Corpo"; } else if (k==K_F8) { s = 'F'; caption = "Piede"; } local_dirty = TRUE; @@ -321,13 +325,13 @@ bool TForm_EC_editor::edit(char s, pagetype p) if (local_dirty) local_dirty = form().section(s,odd_page).edit(caption); } - if (local_dirty) dirty=TRUE; + if (local_dirty || m.dirty()!=0) dirty=TRUE; if (k==K_ESC || k==K_ENTER) break; } // End of while } // End if - if (m.dirty() != 0) + if (m.dirty() != 0 || dirty) { form().fontname() = m.get(F_SFONT); form().fontsize() = m.get_int(F_SSIZE); @@ -338,7 +342,7 @@ bool TForm_EC_editor::edit(char s, pagetype p) form().ipy() = m.get_int(F_SIPY); if (form().exist('H', last_page)) { - TForm_item& flags = form().section('H',last_page).find_field(PEC_FLAGS); + TForm_item& flags = form().find_field('H',last_page,PEC_FLAGS); TString s(m.get(F_SVALUTA)); s << "|" << m.get(F_FINK); form().section('H',last_page).set_dirty(); @@ -347,7 +351,7 @@ bool TForm_EC_editor::edit(char s, pagetype p) } if (form().exist('G', odd_page)) { - TForm_item& pict = form().section('G',odd_page).find_field(PEC_PICTURE); + TForm_item& pict = form().find_field('G',odd_page,PEC_PICTURE); pict.set_prompt(m.get(F_BACKGROUND)); pict.width() = m.get_int(F_BACKWIDTH); pict.height() = m.get_int(F_BACKHEIGHT); @@ -362,7 +366,7 @@ bool TForm_EC_editor::edit(char s, pagetype p) if ((dirty && k==K_ESC && yesno_box("Salvare le modifiche?")) || (dirty && k==K_ENTER)) { // Se si preme annulla e sono state effettuate modifiche chiede la conferma per salvare // Se invece si preme conferma e sono state effettuate modifiche non chiede la conferma - if (form().code() == "") + if (form().code().empty()) { TFilename n(form().name()); n.ext("frm"); TFilename bak(n); bak.ext("bak"); @@ -399,7 +403,8 @@ bool TForm_EC_editor::ask_profile() if (k == K_ENTER) { check_form(); - set_form(new TForm(fform, (fcode!=0) ? format("%04ld%c",fcode,flng) : "", extra() ? 2 :1, fdesc)); + set_form(new TForm(fform, (fcode!=0) ? cod : "", extra() ? 2 :1, fdesc)); + form().section_mask() = "sc3100s"; break; } else if (k == K_DEL)