#include #include #include class TSheet_field; class Visliq_app : public TApplication { TString _freqviva; int _year; long _firm; TRelation* _nditte; TArray_sheet* _ditte; TArray _nomiditte; TTable* _lim; TTable* _lia; TTable* _del; TRectype* _lim_r; TRectype* _del_r; TRecfield* _del_ditta; TRecfield* _del_anno; TRecfield* _del_mese; TRecfield* _del_tipo; TRecfield* _lim_anno; TRecfield* _lim_mese; TSheet_field* _vers_sheet, *_liq_sheet; TArray _vers_rows, _liq_rows; TMask* _mask; const char* itoname(int m); bool is_trim(int x); bool is_month_ok(int x, int month = -1); void set_risultato(TViswin*, long, real&); protected: virtual bool menu(MENU_TAG); virtual bool create(); virtual bool destroy(); // handlers static bool set_ditta(TMask_field&, KEY); static bool set_ragsoc(TMask_field&, KEY); static bool sel_mese_sh1 (TMask_field&, KEY); static bool sel_mese_sh2 (TMask_field&, KEY); static bool ch_year_handler(TMask_field& f, KEY key); static const char* link_handler(TMask&, int, const char*, bool doubleclick); static bool sheet_action(int r, KEY k); static bool vers_action(int r, KEY k); public: static Visliq_app& app() { return (Visliq_app&)main_app(); } TArray_sheet* get_ditte_sheet() { return _ditte; } void build_ditte_sheet(); void build_nomiditte(); bool look_lia(long ditta = 0l, int year = 0); bool look_lim(int m); bool look_del(int month, int type, bool create = FALSE); void set_freqviva(); void set_freqviva(const char* f) { _freqviva = f; } void set_mask_freq(TMask&); void set_year(const char* y) { _year = atoi(y); } void set_year(int y) { _year = y; } void reset_fields(); // 2 palle TMask* get_main_mask() { return _mask; } void update_sheet_row(TToken_string& t); // workhorses bool vis_liq(); bool vis_all(); bool vis_one(int); Visliq_app() : TApplication() {} virtual ~Visliq_app() {} };