|
下载地址:http://www.linuxfans.org/nuke/mo ... mydown&did=4684
描述:
包含从1900-2049年的150年农历日期。可显示生肖、阴历及干支,不含节气和纪念日。
基于gtk+-2.10.6
算法参考:lunar-2.1
包含文件:
gtkchinesecalendar.c gtkchinesecalendar.h:农历日期控件代码
tables.h: 计算农历日期相关的数据定义,界面中显示的中文字符串及格式(方便国际化支持)
calendar.c test.c calendar testcalendar: 测试及例子程序
Makefile
类型名:GtkChineseCalendar
属性及信号与GtkCalendar相同。
enum GtkChineseCalendarDisplayOptions:
typedef enum
{
GTK_CHINESE_CALENDAR_SHOW_HEADING = 1 << 0,
GTK_CHINESE_CALENDAR_SHOW_DAY_NAMES = 1 << 1,
GTK_CHINESE_CALENDAR_NO_MONTH_CHANGE = 1 << 2,
GTK_CHINESE_CALENDAR_SHOW_WEEK_NUMBERS = 1 << 3,
GTK_CHINESE_CALENDAR_WEEK_START_MONDAY = 1 << 4
} GtkChineseCalendarDisplayOptions;
函数原型:
GtkWidget* gtk_chinese_calendar_new (void);
gboolean gtk_chinese_calendar_select_month (GtkChineseCalendar *calendar,
guint month,
guint year);
void gtk_chinese_calendar_select_day (GtkChineseCalendar *calendar,
guint day);
gboolean gtk_chinese_calendar_mark_day (GtkChineseCalendar *calendar,
guint day);
gboolean gtk_chinese_calendar_unmark_day (GtkChineseCalendar *calendar,
guint day);
void gtk_chinese_calendar_clear_marks (GtkChineseCalendar *calendar);
void gtk_chinese_calendar_set_display_options (GtkChineseCalendar *calendar, GtkChineseCalendarDisplayOptions flags);
GtkChineseCalendarDisplayOptions
gtk_chinese_calendar_get_display_options (GtkChineseCalendar *calendar);
void gtk_chinese_calendar_display_options (GtkChineseCalendar *calendar, GtkChineseCalendarDisplayOptions flags);
void gtk_chinese_calendar_get_date (GtkChineseCalendar *calendar,
guint *year,
guint *month,
guint *day);
void gtk_chinese_calendar_freeze (GtkChineseCalendar *calendar);
void gtk_chinese_calendar_thaw (GtkChineseCalendar *calendar);
/* 注:以下三个函数在以后编程中不建议使用:
* gtk_chinese_calendar_display_options
* gtk_chinese_calendar_freeze
* gtk_chinese_calendar_thaw
**/
已知bug:
如果使用低版本的gtk,由于在GtkSettings中没有"gtk-timeout-initial"和"gtk-timeout-repeat"属性,所以运行时会出警告信息,并且不能持续按住年和月切换箭头改变年月。
测试环境:
gentoo
注:windows支持被移除,所以在windows系统上不能使用。 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|