From 2ba945e2de95f4c792f881069597cc2f1d7e9082 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 15 Sep 2008 10:44:01 +0000 Subject: [PATCH] Patch level : 10.0 Files correlati : tutti Ricompilazione Demo : [ ] Commento : 0000892: HELP ON LINE: non si aggancia allla videata. Se da un videata, esempio dall'anagrafica articoli, premo help mi esce help generale. git-svn-id: svn://10.65.10.50/trunk@17245 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/applicat.cpp | 13 +++++++++---- include/mask.cpp | 22 +++++++++++++--------- include/recarray.cpp | 39 ++++++++++++++++----------------------- include/tabmod.cpp | 5 ++--- include/tabmod.h | 5 +---- include/toolfld.cpp | 2 +- 6 files changed, 42 insertions(+), 44 deletions(-) diff --git a/include/applicat.cpp b/include/applicat.cpp index 7d09dd5b5..dfbc954c9 100755 --- a/include/applicat.cpp +++ b/include/applicat.cpp @@ -331,19 +331,24 @@ long TApplication::handler(WINDOW win, EVENT* ep) about(); break; case M_HELP_CONTENTS: - case M_HELP_SEARCH: - case M_HELP_HELPONHELP: { TFilename n = "campo"; TString16 module = name(); module.cut(2); if (module != "ba") n.insert(module); - FILE_SPEC fs; memset(&fs, 0, sizeof(FILE_SPEC)); - strcpy(fs.name, n); + + FILE_SPEC fs; xvt_fsys_convert_str_to_fspec(n, &fs); XVT_HELP_INFO hi = xvt_help_open_helpfile(&fs, 0); xvt_help_process_event(hi, win, ep); } break; + case M_HELP_ONCONTEXT: // Ridirige l'help contestuale alla finestra corrente + { + WINDOW w = cur_win(); + if (w != NULL_WIN && w != win) + dispatch_e_char(w, K_F1); + } + break; default: if (ep->v.cmd.tag > MAX_MENU_TAG) { diff --git a/include/mask.cpp b/include/mask.cpp index b445137a1..f15b996bf 100755 --- a/include/mask.cpp +++ b/include/mask.cpp @@ -810,12 +810,12 @@ void TMask::handler(WINDOW w, EVENT* ep) const int tag = ep->v.cmd.tag; if (_last_sheet != NULL) { - switch (tag) + switch (tag - BROWSE_BAR) { - case BROWSE_BAR+1: _last_sheet->save_columns_order(); break; - case BROWSE_BAR+2: _last_sheet->reset_columns_order(); break; - case BROWSE_BAR+3: _last_sheet->on_key(K_F11); break; - case BROWSE_BAR+4: _last_sheet->esporta(); break; + case 1: _last_sheet->save_columns_order(); break; + case 2: _last_sheet->reset_columns_order(); break; + case 3: _last_sheet->on_key(K_F11); break; + case 4: _last_sheet->esporta(); break; default: break; } return; @@ -831,6 +831,11 @@ void TMask::handler(WINDOW w, EVENT* ep) } return; } + if (tag == M_HELP_ONCONTEXT) + { + on_key(K_F1); + return; + } } if (ep->type == E_VSCROLL) @@ -941,11 +946,10 @@ bool TMask::on_key( e.v.help.tid = (long)key; TFilename n = "campo"; - TString16 module = key; module.cut(2); - if (module != "ba") + TString4 module; module.strncpy(key, 2); + if (module.compare("ba", -1, true) != 0) n.insert(module); - FILE_SPEC fs; memset(&fs, 0, sizeof(FILE_SPEC)); - strcpy(fs.name, n); + FILE_SPEC fs; xvt_fsys_convert_str_to_fspec(n, &fs); XVT_HELP_INFO hi = xvt_help_open_helpfile(&fs, 0); xvt_help_process_event(hi, win(), &e); } diff --git a/include/recarray.cpp b/include/recarray.cpp index 42355f19c..2ec2e0266 100755 --- a/include/recarray.cpp +++ b/include/recarray.cpp @@ -794,25 +794,26 @@ TRecord_cache& TDB_cache::rec_cache(int file) int TDB_cache::build_table_key(const char* table, const char* key, TToken_string& k) const { + CHECK(table && *table, "Invalid Table code"); int file = LF_TAB; k.cut(0); if (!isalnum(*table)) // gestisco i casi come %IVA e &AUT { switch (*table) { - case '%': file = LF_TABCOM; break; - case '^': file = LF_TABGEN; break; + case '%': file = LF_TABCOM; table++; break; + case '^': file = LF_TABGEN; table++; break; case '&': file = LF_TABMOD; { const TModule_table mt(table); k = mt.module(); k.add(mt.customer()); + table = mt.name(); } break; case '$': - default : file = LF_TAB; break; + default : file = LF_TAB; table++; break; } - table++; // Skippa il primo carattere speciale } k.add(table); k.add(key); @@ -821,8 +822,6 @@ int TDB_cache::build_table_key(const char* table, const char* key, TToken_string const TRectype& TDB_cache::get(const char* table, const char* key) { - CHECKS(table && *table, "Invalid Table code ", table); - TToken_string tabkey; const int file = build_table_key(table, key, tabkey); return get(file, tabkey); @@ -830,14 +829,11 @@ const TRectype& TDB_cache::get(const char* table, const char* key) const TRectype& TDB_cache::get(const TRectype& curr) { - const int num = curr.num(); - if (num == LF_TAB || num == LF_TABCOM || num == LF_TABGEN || num == LF_TABMOD) - return get(curr.get("COD"), curr.get("CODTAB")); - - const RecDes& recd = *curr.rec_des(); // Descrizione del record della testata - const KeyDes& kd = recd.Ky[0]; // Elenco dei campi della chiave + const int num = curr.num(); // Numero logico del file (o tabella) + const RecDes& recd = *curr.rec_des(); // Descrizione del record della testata + const KeyDes& kd = recd.Ky[0]; // Elenco dei campi della chiave 1 TToken_string key; - for (int i = 0; i < kd.NkFields; i++) // Riempie la chiave selezionata + for (int i = 0; i < kd.NkFields; i++) // Riempie la chiave { const int nf = kd.FieldSeq[i] % MaxFields; const RecFieldDes& rf = recd.Fd[nf]; @@ -853,8 +849,6 @@ bool TDB_cache::discard(int file, const char* key) bool TDB_cache::discard(const char *table, const char* key) { - CHECK(table && *table, "Invalid Table code"); - TToken_string tabkey; const int file = build_table_key(table, key, tabkey); return rec_cache(file).discard(tabkey); @@ -862,12 +856,12 @@ bool TDB_cache::discard(const char *table, const char* key) bool TDB_cache::discard(const TRectype& curr) { - const int file = curr.num(); + const int file = curr.num(); // Numero logico del file (o tabella) const RecDes* recd = curr.rec_des(); // Descrizione del record della testata const KeyDes& kd = recd->Ky[0]; // Elenco dei campi della chiave 1 TToken_string code; - for (int i = 0; i < kd.NkFields; i++) // Riempie la chiave selezionata + for (int i = 0; i < kd.NkFields; i++) // Riempie la chiave { const int nf = kd.FieldSeq[i] % MaxFields; const RecFieldDes& rf = recd->Fd[nf]; @@ -918,9 +912,8 @@ const TString_array& user_and_groups() return _uag; } - void TDB_cache::discard(int file) - { - rec_cache(file).flush(); - rec_cache(file).destroy(); - } - +void TDB_cache::discard(int file) +{ + rec_cache(file).flush(); + rec_cache(file).destroy(); +} diff --git a/include/tabmod.cpp b/include/tabmod.cpp index 6a96b041a..044b69ce8 100755 --- a/include/tabmod.cpp +++ b/include/tabmod.cpp @@ -2,9 +2,8 @@ #include #include -TModule_table::TModule_table(const char* tabname, const char* module, long customer) - : TLocalisamfile(LF_TABMOD), _tabname(tabname), - _module(module), _customer(customer) +TModule_table::TModule_table(const char* tabname) + : TLocalisamfile(LF_TABMOD), _tabname(tabname), _customer(0) { if (!isalnum(_tabname[0])) // Toglie eventuali prefissi inutili d'ora in poi _tabname.ltrim(1); diff --git a/include/tabmod.h b/include/tabmod.h index e4561d2e2..04157333b 100755 --- a/include/tabmod.h +++ b/include/tabmod.h @@ -65,11 +65,8 @@ public: // @cmember Vuota tutto il record usando il carattere

virtual void zero(char c = '\0'); - // @cmember Ritorna il numero logico della tabella

- static int name2log(const char* tabname) { return LF_TABGEN;} - // @cmember Costruttore - TModule_table(const char* tabname, const char * module = NULL, long customer = 0L); + TModule_table(const char* tabname); // @cmember Distruttore virtual ~TModule_table() {} }; diff --git a/include/toolfld.cpp b/include/toolfld.cpp index e0e9f484f..7f4fd68c1 100755 --- a/include/toolfld.cpp +++ b/include/toolfld.cpp @@ -69,7 +69,7 @@ void TButton_tool::set_exit_key(KEY k) { switch (k) { - case K_F1: _exit_key = M_HELP_CONTENTS; break; + case K_F1: _exit_key = M_HELP_ONCONTEXT; break; case K_F2: _exit_key = M_FILE_ABOUT; break; default: _exit_key = k; break; }