campo-sirio/sc/sc2201.cpp
guy 7a41843999 Stampa Estratto Conto
git-svn-id: svn://10.65.10.50/trunk@2208 c028cbd2-c16b-5b4b-a496-9718f37d4682
1995-11-27 08:39:47 +00:00

53 lines
1.1 KiB
C++
Executable File

#include "sc2201.h"
///////////////////////////////////////////////////////////////////////////////
// TCursor_sheet_RecNo //
///////////////////////////////////////////////////////////////////////////////
TCursor_sheet_RecNo::TCursor_sheet_RecNo(TCursor * cursor, const char* fields,
const char * title, const char * head, byte buttons)
: TCursor_sheet(cursor, fields, title, head, buttons)
{
_recnos.reset();
}
bool TCursor_sheet_RecNo::on_key(KEY k)
{
switch(k)
{
case K_SPACE:
{
*cursor() = selected(); // Posiziona il cursore
rec_check(cursor()->file().recno(), !checked(selected()));
break;
}
case K_F2:
rec_uncheck(-1);
break;
case K_F3:
rec_check(-1);
break;
default:
break;
}
return TCursor_sheet::on_key(k);
}
void TCursor_sheet_RecNo::rec_check(long n, bool on)
{
if (n < 0)
{
if (on)
{
_recnos.set(items()-1); // Force the size of Bit_array
_recnos.set();
}
else
_recnos.reset();
}
else
_recnos.set(n, on);
}