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
This commit is contained in:
guy 2008-09-15 10:44:01 +00:00
parent bb003a65de
commit 2ba945e2de
6 changed files with 42 additions and 44 deletions

View File

@ -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)
{

View File

@ -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);
}

View File

@ -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();
}

View File

@ -2,9 +2,8 @@
#include <scanner.h>
#include <tabmod.h>
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);

View File

@ -65,11 +65,8 @@ public:
// @cmember Vuota tutto il record usando il carattere <p c>
virtual void zero(char c = '\0');
// @cmember Ritorna il numero logico della tabella <p tabname>
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() {}
};

View File

@ -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;
}