From 1f26d8477a050324e7307deb8d1d93e757a29772 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 2 Jun 1995 13:09:46 +0000 Subject: [PATCH] Corretta gestione config USER quando l'utente ancora non e' noto git-svn-id: svn://10.65.10.50/trunk@1437 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/config.cpp | 10 ++++++++-- include/form.cpp | 17 +++++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/include/config.cpp b/include/config.cpp index 98bce36e5..365879edd 100755 --- a/include/config.cpp +++ b/include/config.cpp @@ -445,9 +445,15 @@ TConfig::TConfig(int which_config, const char* paragraph) switch (which_config) { case CONFIG_STAMPE: - _file.add("print.ini"); break; + _file.add("print.ini"); + break; default: - _file << '/' << user() << ".ini"; break; + if (user().not_empty()) + _file.add(user()); + else + _file.add("prassi"); + _file.ext("ini"); + break; } break; case CONFIG_FCONV: diff --git a/include/form.cpp b/include/form.cpp index 6e3c68c35..8cfc1a841 100755 --- a/include/form.cpp +++ b/include/form.cpp @@ -613,16 +613,25 @@ bool TForm_item::do_message(int num) bool TForm_item::update() -{ - string_at(_x, _y, _prompt); +{ + if (_prompt.right(1) == "#") + { + TString prompt(_prompt); + for (int i = prompt.len()-2; i >= 0; i--) + if (prompt[i] != '#') break; + prompt.cut(i+1); + string_at(_x, _y, prompt); + } + else string_at(_x, _y, _prompt); + do_message(); return TRUE; } void TForm_item::print_on(TToken_string& row) const { - row = class_name(); row.add(id()); + row = class_name(); row.add(_y); row.add(_x); @@ -1487,7 +1496,7 @@ bool TPrint_section::edit(const char* title) } const word flags = 0x08 | (form().edit_level() > 1 ? 0x06 : 0x00); - TArray_sheet a(-1, -1, 0, 0, title, "Tipo@8|ID@4|Riga@R|Col.@R|Gr.@R|Descrizione@40", flags); + TArray_sheet a(-1, -1, 0, 0, title, "ID@4|Tipo@8|Riga@R|Col.@R|Gr.@R|Descrizione@40", flags); for (word i = 0; i < fields(); i++) {