Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@12958 c028cbd2-c16b-5b4b-a496-9718f37d4682
80 lines
1.7 KiB
C++
Executable File
80 lines
1.7 KiB
C++
Executable File
#ifndef __CILIB_H
|
|
#define __CILIB_H
|
|
|
|
#ifndef __AUTOMASK_H
|
|
#include <automask.h>
|
|
#endif
|
|
|
|
#ifndef __DBLIB_H
|
|
#include "../db/dblib.h"
|
|
#endif
|
|
|
|
// TAlmanac
|
|
|
|
class TAlmanac : public TObject
|
|
{
|
|
TDate _curr_month;
|
|
|
|
public:
|
|
const TDate& month() const { return _curr_month; }
|
|
int last_day() { return TDate::last_day(_curr_month.month(),_curr_month.year()); }
|
|
|
|
public:
|
|
bool has_documents(TDate& tdate) { return false; }
|
|
|
|
TAlmanac(int m, int a) : _curr_month(1, m, a) { }
|
|
TAlmanac() { _curr_month = TODAY; _curr_month.set_day(1); }
|
|
virtual ~TAlmanac() { }
|
|
};
|
|
|
|
// TAlmanac_field
|
|
|
|
class TAlmanac_field : public TWindowed_field
|
|
{
|
|
private:
|
|
TAlmanac _almanac;
|
|
|
|
int _padding;
|
|
bool _showmonthname;
|
|
int _selectedday;
|
|
|
|
protected: // TWindowed_field
|
|
virtual TField_window* create_window(int x, int y, int dx, int dy, WINDOW parent);
|
|
|
|
public:
|
|
bool is_selected(int tday) { return (tday==_selectedday); }
|
|
void set_selected_day(int nday);
|
|
void move_selected_day(int ddays);
|
|
|
|
public:
|
|
void set_show_month_name(bool on) { _showmonthname = on; }
|
|
void set_padding(int p) { _padding = p; }
|
|
|
|
bool show_month_name() const { return _showmonthname; }
|
|
int padding() const { return _padding; }
|
|
|
|
public:
|
|
TAlmanac& almanac() { return _almanac; }
|
|
|
|
public:
|
|
TAlmanac_field(TMask* m) : TWindowed_field(m), _almanac(), _showmonthname(true) { }
|
|
virtual ~TAlmanac_field() { }
|
|
};
|
|
|
|
// TAlmanac_window
|
|
|
|
class TAlmanac_window : public TField_window
|
|
{
|
|
protected:
|
|
virtual void update();
|
|
virtual void handler(WINDOW win, EVENT* ep);
|
|
|
|
public:
|
|
virtual bool on_key(KEY k);
|
|
|
|
TAlmanac_window(int x, int y, int dx, int dy, WINDOW parent, TWindowed_field *owner);
|
|
virtual ~TAlmanac_window() { }
|
|
};
|
|
|
|
#endif
|