Patch level : 2.0 474

Files correlati     : relapp
Ricompilazione Demo : [ ]
Commento            :

Corretta ricerca del campo da associare al bottone di ricerca


git-svn-id: svn://10.65.10.50/trunk@11162 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2003-05-21 14:26:29 +00:00
parent ba6565323a
commit d8637fb717
4 changed files with 34 additions and 26 deletions

View File

@ -791,19 +791,19 @@ bool TMAPI_session::load_mapi()
return TRUE; return TRUE;
// Check if MAPI is installed on the system // 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) if(!MAPI_installed)
return FALSE; return error_box("MAPI non attivato nel file win.ini");
UINT fuError = SetErrorMode(SEM_NOOPENFILEERRORBOX); UINT fuError = SetErrorMode(SEM_NOOPENFILEERRORBOX);
_hlibMAPI = LoadLibrary(szMAPIDLL); _hlibMAPI = LoadLibrary(szMAPIDLL);
SetErrorMode(fuError); SetErrorMode(fuError);
DWORD* err = (DWORD*)_hlibMAPI; if (_hlibMAPI < (HINSTANCE)HINSTANCE_ERROR)
if ((DWORD)err < 32)
{ {
DWORD err = *((DWORD*)_hlibMAPI) & 0xFFFF;
_hlibMAPI = NULL; _hlibMAPI = NULL;
return FALSE; return error_box("Errore di caricamento di %s: %lu", szMAPIDLL, err);
} }
if (!(lpfnMAPILogon = (LPMAPILOGON)GetProcAddress (_hlibMAPI, "MAPILogon"))) return FALSE; if (!(lpfnMAPILogon = (LPMAPILOGON)GetProcAddress (_hlibMAPI, "MAPILogon"))) return FALSE;

View File

@ -526,12 +526,12 @@ TEdit_field& TRelation_application::get_search_field() const
{ {
short id = _search_id; 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--) for (int i = _mask->fields()-1; i >= 0; i--)
{ {
const TMask_field& f = _mask->fld(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(); id = f.dlg();
break; break;

View File

@ -1931,24 +1931,36 @@ bool TViswin::on_key(KEY key)
exec_link(); exec_link();
break; break;
case K_TAB: case K_TAB:
if (!is_running()) if (!_toplevel)
{ {
update(); TMask& m = owner().mask();
} const int pos = m.id2pos(owner().dlg());
else for (int i = pos+1; i < m.fields(); i++)
{ {
if (_curbut == (_button.items() - 1)) const TMask_field& f = m.fld(i);
_curbut = 0; if (f.active())
else {
_curbut++; m.set_focus_field(f.dlg());
break;
}
}
} }
break; break;
case K_BTAB: case K_BTAB:
if (_curbut == 0) if (!_toplevel)
_curbut = _button.items() - 1; {
else TMask& m = owner().mask();
_curbut--; 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; break;
case K_SPACE: case K_SPACE:
case K_CTRL_ENTER: case K_CTRL_ENTER:
@ -2624,8 +2636,6 @@ TViswin::TViswin(const char *fname,
} }
} }
_curbut = 0;
if (_isopen && _showbuts) if (_isopen && _showbuts)
_wtimer = xvt_timer_create(win(), 750L); _wtimer = xvt_timer_create(win(), 750L);

View File

@ -83,8 +83,6 @@ class TViswin : public TField_window
bool _wasneeded; bool _wasneeded;
// @cmember:(INTERNAL) Array di bottoni attivi nella finestra // @cmember:(INTERNAL) Array di bottoni attivi nella finestra
TArray _button; TArray _button;
// @cmember:(INTERNAL) Bottone che ha il focus
int _curbut;
// @cmember:(INTERNAL) Bottone Collega // @cmember:(INTERNAL) Bottone Collega
TPushbutton_control* _link_button; TPushbutton_control* _link_button;