campo-sirio/include/automask.h
alex d185523a1b Patch level : 10.0 patch 808
Files correlati     :
Ricompilazione Demo : [ ]
Commento            :

Rilevazione ore


git-svn-id: svn://10.65.10.50/branches/R_10_00@20890 c028cbd2-c16b-5b4b-a496-9718f37d4682
2010-09-22 07:15:44 +00:00

40 lines
1.3 KiB
C++
Executable File

#ifndef __AUTOMASK_H
#define __AUTOMASK_H
#ifndef __MSKSHEET_H
#include <msksheet.h>
#endif
enum TField_event { fe_null = 0,
fe_init, fe_modify, fe_button, fe_close,
fe_magic, fe_info, fe_edit,
se_enter = 10, se_leave,
se_query_modify, se_notify_modify,
se_query_add, se_notify_add,
se_query_del, se_notify_del };
class TAutomask : public TMask
{
private:
static bool universal_handler(TMask_field& f, KEY k);
static bool insheet_universal_handler(TMask_field& f, KEY k);
static bool universal_notifier(TSheet_field& f, int row, KEY k);
protected:
void set_handlers();
TField_event key2event(TMask_field& f, KEY key) const;
public:
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly) pure;
bool error_box(const char* fmt, ...); // No more f.error_box
void set_universal_handler(const short id) { set_handler(id, universal_handler);}
void set_insheet_universal_handler(const short sid, const short id) { sfield(sid).sheet_mask().set_handler(id, insheet_universal_handler);}
TAutomask() { }
TAutomask(const char* name, int num = 0);
TAutomask(const char* title, int pages, int cols, int rows, int xpos = -1, int ypos = -1);
virtual ~TAutomask() { }
};
#endif