Modifica 95/23

Implementato meccanismo per aprire la maschera degli sheet con un tasto


git-svn-id: svn://10.65.10.50/trunk@1769 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
matteo 1995-08-31 17:30:48 +00:00
parent bf76c36172
commit f8b0972f7d
2 changed files with 25 additions and 2 deletions

View File

@ -8,6 +8,7 @@ const short FIRST_FIELD = 101;
#include <xil.h>
#include <colors.h>
#include <keys.h>
///////////////////////////////////////////////////////////
// TSpreadsheet
@ -633,7 +634,10 @@ void TSpreadsheet::list_handler(XI_EVENT *xiev)
_check_enabled = FALSE;
const int oldrec = _cur_rec;
set_pos(xiev->v.xi_obj->v.cell.row, xiev->v.xi_obj->v.cell.column);
if ( xiev->v.xi_obj != NULL )
{
set_pos(xiev->v.xi_obj->v.cell.row, xiev->v.xi_obj->v.cell.column);
};
if (oldrec != _cur_rec || !_row_dirty)
{
@ -774,6 +778,11 @@ void TSpreadsheet::list_handler(XI_EVENT *xiev)
const KEY k = e_char_to_key(ep);
switch(k)
{
case K_ROWEDIT:
xiev->type = XIE_DBL_CELL;
xiev->v.xi_obj = NULL;
list_handler( xiev );
break;
case K_TAB:
case K_BTAB:
_lastab = k;
@ -1618,7 +1627,19 @@ bool TSheet_field::on_key(KEY k)
{
if (!test_focus_change())
return FALSE;
}
};
if (k == K_ROWEDIT )
{
if ( items( ) )
{
_sheet->select( _sheet->items( ) - 1 );
XI_EVENT xie;
xie.type = XIE_DBL_CELL;
xie.v.xi_obj = NULL;
_sheet->list_handler( &xie );
return TRUE;
}
};
return TMask_field::on_key(k);
}

View File

@ -5,6 +5,8 @@
#include <mask.h>
#endif
#define K_ROWEDIT ( K_CTRL + 'I' )
class TSheet_field;
class TSpreadsheet;