mask.cpp Tolto check errato in first_focus
msksheet.cpp Corretta gestione tasti ALT relapp.cpp Corretto settaggio del modo query di una maschera xvtility.cpp Correzione minore sulla gestione del tasto ALT git-svn-id: svn://10.65.10.50/trunk@3214 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
c084a94350
commit
e0aba35d3e
@ -279,7 +279,7 @@ int TMask::first_focus(short id)
|
||||
f = tempfirstfocus = id2pos(-id);
|
||||
}
|
||||
|
||||
CHECKD(f >= 0 && f < fields() && fld(f).active(), "Invalid focus field ", f);
|
||||
CHECKD(f >= 0 && f < fields(), "Invalid focus field ", f);
|
||||
return f;
|
||||
}
|
||||
|
||||
|
@ -809,13 +809,16 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
}
|
||||
|
||||
if (cell_disabled(rec, col))
|
||||
{
|
||||
xiev->v.cell_request.back_color = DISABLED_BACK_COLOR;
|
||||
else
|
||||
if (e->has_query_button())
|
||||
{
|
||||
xiev->v.cell_request.button = TRUE;
|
||||
xiev->v.cell_request.button_on_focus = TRUE;
|
||||
}
|
||||
xiev->v.cell_request.attrib &= ~XI_ATR_ENABLED;
|
||||
}
|
||||
|
||||
if (e->has_query_button())
|
||||
{
|
||||
xiev->v.cell_request.button = TRUE;
|
||||
xiev->v.cell_request.button_on_focus = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -844,10 +847,19 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
break;
|
||||
case XIE_BUTTON:
|
||||
if (xiev->v.xi_obj->type == XIT_CELL)
|
||||
{
|
||||
const bool ok = (bool)xi_move_focus(xiev->v.xi_obj);
|
||||
if (ok)
|
||||
dispatch_e_char(parent(), K_F9);
|
||||
{
|
||||
XI_CELL_DATA& cell = xiev->v.xi_obj->v.cell;
|
||||
int num;
|
||||
XI_OBJ** column = xi_get_member_list(_obj, &num);
|
||||
CHECK(cell.column < num, "Bad column");
|
||||
int rec = cell.row;
|
||||
rec = row2rec(rec);
|
||||
const int col = column[cell.column]->cid - FIRST_FIELD;
|
||||
if (!cell_disabled(rec, col))
|
||||
{
|
||||
if (xi_move_focus(xiev->v.xi_obj))
|
||||
dispatch_e_char(parent(), K_F9);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (xiev->v.xi_obj->type == XIT_LIST)
|
||||
@ -1054,7 +1066,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
while (ddl.is_open())
|
||||
do_events();
|
||||
// sdroppa su
|
||||
copy_cell2field(); /* ci vuole ma non basta */
|
||||
copy_cell2field();
|
||||
}
|
||||
else // edit_field
|
||||
{
|
||||
@ -1080,20 +1092,6 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
_check_enabled = TRUE; // Re-enable checks
|
||||
}
|
||||
break;
|
||||
/*
|
||||
case K_PREV:
|
||||
case K_NEXT:
|
||||
case K_ESC:
|
||||
if (xi_move_focus(get_interface()))
|
||||
dispatch_e_char(parent(), k);
|
||||
break;
|
||||
case K_ENTER:
|
||||
case K_SHIFT+K_ENTER:
|
||||
case K_CTRL+K_ENTER:
|
||||
if (xi_move_focus(get_interface()))
|
||||
dispatch_e_char(parent(), (k == K_ENTER || k == K_CTRL+K_ENTER) ? K_TAB : K_BTAB);
|
||||
break;
|
||||
*/
|
||||
case K_CTRL + '-':
|
||||
{
|
||||
if (owner().mask().id2pos(DLG_DELREC) && notify(_cur_rec, K_DEL))
|
||||
@ -1129,6 +1127,10 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
xi_scroll(_obj, XI_SCROLL_LAST);
|
||||
break;
|
||||
default:
|
||||
if (k > K_CTRL)
|
||||
{
|
||||
refused = TRUE;
|
||||
} else
|
||||
if (is_edit_key(k) && !_edit_field->on_key(k))
|
||||
{
|
||||
refused = TRUE;
|
||||
@ -1183,13 +1185,24 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
break;
|
||||
case K_ENTER:
|
||||
case K_SHIFT+K_ENTER:
|
||||
if (xi_move_focus(get_interface()))
|
||||
dispatch_e_char(parent(), k == K_ENTER ? K_TAB : K_BTAB);
|
||||
// if (xi_move_focus(get_interface()))
|
||||
dispatch_e_char(parent(), k == K_ENTER ? K_F3 : K_F4);
|
||||
refused = TRUE;
|
||||
break;
|
||||
case K_ESC:
|
||||
if (xi_move_focus(get_interface()))
|
||||
dispatch_e_char(parent(), k);
|
||||
{
|
||||
owner().mask().on_key(k);
|
||||
refused = TRUE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (k > K_CTRL)
|
||||
{
|
||||
if (xi_move_focus(get_interface()))
|
||||
owner().mask().on_key(k);
|
||||
refused = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -293,21 +293,18 @@ void TRelation_application::query_mode(
|
||||
_mask->open_modal();
|
||||
set_limits();
|
||||
}
|
||||
|
||||
_mask->set_mode(pre_ins ? MODE_QUERYINS : MODE_QUERY);
|
||||
_mask->reset();
|
||||
|
||||
//_mask->reset();
|
||||
// Spostato dopo la set_mode() e prima delle init_query_insert_mode()
|
||||
// cosicche', quando chiamera' eventuali handlers di campi che vadano a controllare
|
||||
// il modo della maschera, il membro _mode di TMask sara' settato correttmanente
|
||||
if (pre_ins)
|
||||
{
|
||||
set_mode(NO_MODE);
|
||||
_mask->reset();
|
||||
init_query_insert_mode(*_mask);
|
||||
}
|
||||
else
|
||||
{
|
||||
set_mode(MODE_QUERY);
|
||||
_mask->reset();
|
||||
init_query_mode(*_mask);
|
||||
}
|
||||
}
|
||||
@ -455,12 +452,12 @@ bool TRelation_application::test_key(
|
||||
if (e->required())
|
||||
{
|
||||
onereq = TRUE;
|
||||
if (e->empty())
|
||||
if (e->empty())
|
||||
{
|
||||
if (err)
|
||||
{
|
||||
_mask->first_focus(-e->dlg());
|
||||
error_box("Manca un valore indispensabile per la ricerca");
|
||||
_mask->first_focus(-e->dlg());
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -240,6 +240,7 @@ static BOOLEAN event_hook(HWND hwnd,
|
||||
const KEY key = toupper(wparam)+K_CTRL;
|
||||
// w->on_key(key);
|
||||
dispatch_e_char(win, key);
|
||||
*ret = 2 << 8;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user