Corretta formattazione

git-svn-id: svn://10.65.10.50/trunk@2948 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1996-05-31 15:27:42 +00:00
parent 1d80e8a48c
commit 4a4ff4a48f
6 changed files with 4043 additions and 4026 deletions

View File

@ -236,7 +236,7 @@ TSpreadsheet::TSpreadsheet(
:
_mask(maskname, maskno), _notify(NULL),
_cur_row(0), _cur_col(1), _cur_rec(0), _edit_field(NULL), _active(TRUE),
_row_dirty(FALSE), _check_enabled(TRUE),
_row_dirty(FALSE), _cell_dirty(FALSE), _check_enabled(TRUE),
_needs_update(-1)
{
const int NUMBER_WIDTH = 3;
@ -828,7 +828,11 @@ 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);
}
else
if (xiev->v.xi_obj->type == XIT_LIST)
{
@ -1020,7 +1024,6 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
case K_F9:
if (_edit_field != NULL)
{
/* Guy! */
notify_change();
copy_cell2field();
}
@ -1033,7 +1036,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
notify_change();
bool ok = TRUE;
if (_edit_field->is_kind_of(CLASS_LIST_FIELD) && k == K_F9) // list
if (k == K_F9 && _edit_field->is_kind_of(CLASS_LIST_FIELD)) // list
{
XI_OBJ cell; XI_MAKE_CELL(&cell, _obj, _cur_row, _cur_col);
// droppa giu'
@ -1098,23 +1101,29 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
{
refused = TRUE;
beep();
}
else if (_edit_field->is_kind_of(CLASS_LIST_FIELD))
} else
if (_edit_field->is_kind_of(CLASS_LIST_FIELD))
{
TList_field& lst = ((TList_field&)*_edit_field);
bool changed = FALSE;
switch (k)
{
case K_RIGHT:
lst.select_next();
changed = lst.select_next();
break;
case K_LEFT:
lst.select_prev();
changed = lst.select_prev();
break;
default:
if (k >= ' ' && k <= 'z')
lst.select_by_initial(k);
changed = lst.select_by_initial(k);
break;
}
if (changed)
{
XI_OBJ cell; XI_MAKE_CELL(&cell, _obj, _cur_row, _cur_col);
xi_set_text(&cell, (char*)(const char*)lst.get());
}
refused = TRUE;
}
break;
@ -1805,8 +1814,16 @@ void TSheet_field::select(int r, bool scrollto)
bool TSheet_field::on_key(KEY k)
{
if (k == K_TAB && !focusdirty() && items() > 0)
if (k == K_TAB)
{
if (focusdirty())
{
TSpreadsheet* s = (TSpreadsheet*)_ctl;
if (!s->off_cell_handler())
return FALSE;
}
else
if (items() > 0)
select(0);
}