diff --git a/include/golem.cpp b/include/golem.cpp index 869c32888..c7ef1b20f 100755 --- a/include/golem.cpp +++ b/include/golem.cpp @@ -340,6 +340,13 @@ bool TDDE::execute(const char* cmd) const return PostMessage((HWND)_server, WM_DDE_EXECUTE, (WPARAM)_hwnd, MAKELPARAM(0, hg)); } +bool TDDE::start_server() +{ + CHECK(_old_hook == NULL, "Non puoi iniziare due connessioni DDE"); + _old_hook = xvt_vobj_get_attr(NULL_WIN, ATTR_EVENT_HOOK); + xvt_vobj_set_attr(NULL_WIN, ATTR_EVENT_HOOK, (long)hook); + return TRUE; +} void TDDE::terminate() { diff --git a/include/golem.h b/include/golem.h index bd07f6ce4..a5c75fe9c 100755 --- a/include/golem.h +++ b/include/golem.h @@ -118,6 +118,9 @@ public: // @cmember Chiude la connessione void terminate(); + // @cmember Inizia a fornire i servizi di DDE server + bool start_server(); + word hwnd() const { return _hwnd; } // @cmember Costruttore diff --git a/include/maskfld.cpp b/include/maskfld.cpp index 1f71202f4..588ad5393 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -2188,7 +2188,7 @@ KEY TBrowse::run() _cursor->read(_isgteq); const TLocalisamfile& f = _cursor->file(); - TString80 caption(prefix().description(f.name())); + TString caption(prefix().description(f.name())); if (!isalnum(caption[0])) caption = "Selezione"; diff --git a/include/msksheet.cpp b/include/msksheet.cpp index 116bc7670..0ec02f0f5 100755 --- a/include/msksheet.cpp +++ b/include/msksheet.cpp @@ -1811,8 +1811,8 @@ void TSheet_field::select(int r, bool scrollto) } bool TSheet_field::on_key(KEY k) -{ - if (k == K_TAB) +{ + if (k == K_TAB && items() > 0) { if (focusdirty()) { @@ -1821,10 +1821,9 @@ bool TSheet_field::on_key(KEY k) return FALSE; } else - if (items() > 0) select(0); } - + if (k == K_ROWEDIT && items() > 0) { select(items()-1); diff --git a/include/prefix.cpp b/include/prefix.cpp index a035bc92d..26542a70c 100755 --- a/include/prefix.cpp +++ b/include/prefix.cpp @@ -368,10 +368,22 @@ const char* TPrefix::description( if (fexist(name.lower())) { TScanner m(name); - while (m.line().left(2) != "PA"); // Find PAGE - const int apicia = m.token().find('"')+1; - const int apicic = m.token().find('"', apicia); - n = m.token().sub(apicia, apicic); + bool ok = TRUE; + while (ok) + { + const TString& l2 = m.line().left(2); + if (l2.empty()) + ok = FALSE; + else + if (l2 == "PA") + break; + } + if (ok) + { + const int apicia = m.token().find('"')+1; + const int apicic = m.token().find('"', apicia); + n = m.token().sub(apicia, apicic); + } } else n.cut(0); } diff --git a/include/scanner.cpp b/include/scanner.cpp index 03c4b6a6f..173ebde11 100755 --- a/include/scanner.cpp +++ b/include/scanner.cpp @@ -61,7 +61,7 @@ TString& TScanner::line( _line++; _token << __tmp_string; _token.trim(); - } while (_token.empty() && good()); + } while (_token.empty() && !eof()); _pushed = FALSE; diff --git a/include/sheet.cpp b/include/sheet.cpp index b46d3a378..afb413fc9 100755 --- a/include/sheet.cpp +++ b/include/sheet.cpp @@ -990,7 +990,7 @@ KEY TCursor_sheet::run() { _records = _cursor->items(); _cursor->freeze(TRUE); - select(_cursor->pos()); + post_select(_cursor->pos()); const KEY k = TSheet::run(); _cursor->freeze(FALSE); return k;