diff --git a/include/golem.cpp b/include/golem.cpp index 7e47e7348..cea633e15 100755 --- a/include/golem.cpp +++ b/include/golem.cpp @@ -791,19 +791,19 @@ bool TMAPI_session::load_mapi() return TRUE; // Check if MAPI is installed on the system - BOOL MAPI_installed = GetProfileInt("Mail", "MAPI", 0); + BOOL MAPI_installed = ::GetProfileInt("Mail", "MAPI", 0); if(!MAPI_installed) - return FALSE; + return error_box("MAPI non attivato nel file win.ini"); UINT fuError = SetErrorMode(SEM_NOOPENFILEERRORBOX); _hlibMAPI = LoadLibrary(szMAPIDLL); SetErrorMode(fuError); - DWORD* err = (DWORD*)_hlibMAPI; - if ((DWORD)err < 32) + if (_hlibMAPI < (HINSTANCE)HINSTANCE_ERROR) { + DWORD err = *((DWORD*)_hlibMAPI) & 0xFFFF; _hlibMAPI = NULL; - return FALSE; + return error_box("Errore di caricamento di %s: %lu", szMAPIDLL, err); } if (!(lpfnMAPILogon = (LPMAPILOGON)GetProcAddress (_hlibMAPI, "MAPILogon"))) return FALSE; diff --git a/include/relapp.cpp b/include/relapp.cpp index dbf5fa533..6195ba7c0 100755 --- a/include/relapp.cpp +++ b/include/relapp.cpp @@ -526,12 +526,12 @@ TEdit_field& TRelation_application::get_search_field() const { short id = _search_id; - if (id <= 0 || !_mask->field(id).active()) + if (id <= 0 || !_mask->field(id).shown()) { for (int i = _mask->fields()-1; i >= 0; i--) { const TMask_field& f = _mask->fld(i); - if (f.is_edit() && f.in_key(1) && f.active()) + if (f.is_edit() && f.in_key(1) && f.shown()) { id = f.dlg(); break; diff --git a/include/viswin.cpp b/include/viswin.cpp index 4728a1163..7d7eea5bc 100755 --- a/include/viswin.cpp +++ b/include/viswin.cpp @@ -1931,24 +1931,36 @@ bool TViswin::on_key(KEY key) exec_link(); break; case K_TAB: - if (!is_running()) - { - update(); - } - else + if (!_toplevel) { - if (_curbut == (_button.items() - 1)) - _curbut = 0; - else - _curbut++; + TMask& m = owner().mask(); + const int pos = m.id2pos(owner().dlg()); + for (int i = pos+1; i < m.fields(); i++) + { + const TMask_field& f = m.fld(i); + if (f.active()) + { + m.set_focus_field(f.dlg()); + break; + } + } } break; - - case K_BTAB: - if (_curbut == 0) - _curbut = _button.items() - 1; - else - _curbut--; + case K_BTAB: + if (!_toplevel) + { + TMask& m = owner().mask(); + const int pos = m.id2pos(owner().dlg()); + for (int i = pos-1; i >= 0; i--) + { + const TMask_field& f = m.fld(i); + if (f.active()) + { + m.set_focus_field(f.dlg()); + break; + } + } + } break; case K_SPACE: case K_CTRL_ENTER: @@ -2624,8 +2636,6 @@ TViswin::TViswin(const char *fname, } } - _curbut = 0; - if (_isopen && _showbuts) _wtimer = xvt_timer_create(win(), 750L); diff --git a/include/viswin.h b/include/viswin.h index 52a2504d8..83ca78f00 100755 --- a/include/viswin.h +++ b/include/viswin.h @@ -83,8 +83,6 @@ class TViswin : public TField_window bool _wasneeded; // @cmember:(INTERNAL) Array di bottoni attivi nella finestra TArray _button; - // @cmember:(INTERNAL) Bottone che ha il focus - int _curbut; // @cmember:(INTERNAL) Bottone Collega TPushbutton_control* _link_button;