Patch level : 10.0

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :
Gestisce evento pagechanged


git-svn-id: svn://10.65.10.50/branches/R_10_00@22131 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2011-05-17 15:46:12 +00:00
parent bf8d28636b
commit bfd2d7ed5d

View File

@ -872,17 +872,24 @@ long TMask::handler(WINDOW w, EVENT* ep)
case WC_NOTEBK: case WC_NOTEBK:
if (ep->v.ctl.ci.win == _notebook) if (ep->v.ctl.ci.win == _notebook)
{ {
const bool changing = ep->v.ctl.ci.v.notebk.page == NULL_WIN;
const int new_page = ep->v.ctl.ci.v.notebk.page_new; const int new_page = ep->v.ctl.ci.v.notebk.page_new;
if (new_page != _page && new_page < _pages) // Cambio pagina effettivo if (changing) // Tentativo di cambio pagina
{ {
bool can_proceed = true; if (new_page != _page && new_page < _pages)
if (_focus >= 0 && find_parent_page(fld(_focus)) != new_page) {
can_proceed = check_current_field(); if (_focus >= 0 && find_parent_page(fld(_focus)) != new_page)
if (can_proceed) {
show_page(new_page); if (!check_current_field())
else return 1;
return 1; }
} }
}
else
{
// Cambio pagina avvenuto
show_page(new_page); // Forza il focus al primo campo
}
} }
break; break;
case WC_ICON: // In realta' trattasi di bottone di toolbar case WC_ICON: // In realta' trattasi di bottone di toolbar