www.pudn.com > EmployeeManage(pb9).rar > w_calendar_1.srw, change:2003-04-12,size:25811b


$PBExportHeader$w_calendar_1.srw 
forward 
global type w_calendar_1 from w_anc_xe 
end type 
type st_2 from statictext within w_calendar_1 
end type 
type uo_2 from uo_xp_button within w_calendar_1 
end type 
type uo_1 from uo_xp_button within w_calendar_1 
end type 
type mle_record from multilineedit within w_calendar_1 
end type 
type sle_date from singlelineedit within w_calendar_1 
end type 
type st_month from statictext within w_calendar_1 
end type 
type ddlb_month from dropdownlistbox within w_calendar_1 
end type 
type st_nextmonth from statictext within w_calendar_1 
end type 
type st_priormonth from statictext within w_calendar_1 
end type 
type ddlb_year from dropdownlistbox within w_calendar_1 
end type 
type dw_calendar from datawindow within w_calendar_1 
end type 
type rr_1 from roundrectangle within w_calendar_1 
end type 
end forward 
 
global type w_calendar_1 from w_anc_xe 
integer width = 2871 
integer height = 1484 
string title = "雯田日历记事本     " 
boolean maxbox = false 
boolean resizable = false 
long backcolor = 33026303 
boolean center = true 
st_2 st_2 
uo_2 uo_2 
uo_1 uo_1 
mle_record mle_record 
sle_date sle_date 
st_month st_month 
ddlb_month ddlb_month 
st_nextmonth st_nextmonth 
st_priormonth st_priormonth 
ddlb_year ddlb_year 
dw_calendar dw_calendar 
rr_1 rr_1 
end type 
global w_calendar_1 w_calendar_1 
 
type variables 
 
Boolean ib_MoveIn 
 
Public: 
//星期六、星期日背景色 || 星期一至星期五的背景色 
constant string is_GetBackColor0 = '15780518'   //浅蓝(15780518) 
constant string is_GetBackColor1 = '15793151' //白色(1073741824) 
//鼠标点击后的背景色,鼠标移动时的背景色 
constant string is_MouseClickColor = '2685455'  //亮绿(2685455) 
constant string is_MouseMouseColor = '12381951' //淡黄(12381951) 
//淡蓝(16576967),浅蓝(15780518),粉红(14869500) 
//亮绿(2685455),淡黄(12381951),白色(1073741824) 
 
Private: 
//以下变量用于恢复点击对象的原值 
string   is_MPriorObj  //保存上次鼠标经过对象名 
string   is_Ori_MColor //保存上次鼠标经过对象的色彩值 
string   is_Ori_Color  //保存上次点击对象的色彩值 
//string   is_Ori_X, is_Ori_Y //保存上次点击对象的X,Y坐标 
//string   is_Ori_Width, is_Ori_Height //保存上次点击对象的宽度,高度 
string   is_Ori_Border //保存上次点击对象的边框 
dwobject id_PriorObj   //保存上次点击对象的名称 
end variables 
 
forward prototypes 
public function integer of_checkweek (integer ai_this) 
public function string wf_get_monthnum (string as_month) 
public function string of_get_date (string as_type) 
public function string wf_get_cweekname (date as_date) 
public function integer wf_get_monthdays (string as_year, string as_month) 
public function string wf_get_thisdayrecord (string as_date) 
public function integer wf_get_weekdays (date ad_date) 
public subroutine wf_read_record () 
public function integer wf_querysave () 
end prototypes 
 
public function integer of_checkweek (integer ai_this);//==================================================== 
//功能:判断传入的数字(代表数据窗体中一个文本控件) 
//      是否位于对应的星期六或星期日位置列 
//参数:数字 
//返回: 1 表示是 
//      -1 表示否 
//日期: 
//修改: 
//==================================================== 
CHOOSE CASE ai_this 
	CASE 1,7,8,14,15,21,22,28,29,35,36,42 
		return 1 
	CASE ELSE 
		return -1 
END CHOOSE 
 
return 1 
end function 
 
public function string wf_get_monthnum (string as_month);//=============================================== 
// 功能:返回指定月份的数字字符 
// 参数:as_month string型, 月份 
// 返回:integer型,该年该月的数字字符 
// 时间:2003.01.23 
// 作者:相如飞 
// 修改: 
//=============================================== 
string ls_month 
 
CHOOSE CASE as_month 
	CASE '一月' 
		ls_month = '01' 
	CASE '二月' 
		ls_month = '02' 
	CASE '三月' 
		ls_month = '03' 
	CASE '四月' 
		ls_month = '04' 
	CASE '五月' 
		ls_month = '05' 
	CASE '六月' 
		ls_month = '06' 
	CASE '七月' 
		ls_month = '07' 
	CASE '八月' 
		ls_month = '08' 
	CASE '九月' 
		ls_month = '09' 
	CASE '十月' 
		ls_month = '10' 
	CASE '十一月' 
		ls_month = '11' 
	CASE '十二月' 
		ls_month = '12' 
	CASE ELSE 
		MessageBox('错误', '不能识别的月份!') 
		return 'Error' 
END CHOOSE 
 
return ls_month 
end function 
 
public function string of_get_date (string as_type);//=================================================== 
//功能:获取鼠标点击日期 
//参数: 
//返回:string型,参数为 "year"  时,返回yyyy 
//                参数为 "month" 时,返回mm 
//                参数为 "day"   时,返回dd 
//                其他参数返回 yyyy/mm/dd 
//日期: 
//作者: 
//修改: 
//=================================================== 
string ls_year, ls_month, ls_date, ls_day 
 
if Not IsValid(id_PriorObj) then return 'Error' 
 
ls_day = trim(dw_calendar.Describe(id_PriorObj.name + ".Text")) 
//点击处为空 
if IsNull(ls_day) or trim(ls_day) = '' then return 'Error' 
if IsNumber(left(ls_day, 1)) then 
	ls_day = Left(ls_day, 2) 
else 
	ls_day = Mid(ls_day, 2, 2) 
end if 
 
ls_year = left(dw_calendar.object.t_date.text, 4) 
ls_month = wf_get_monthnum(ddlb_month.text) 
 
ls_date = ls_year + '/' + ls_month + '/' + ls_day 
 
CHOOSE CASE lower(as_type) 
	CASE 'year' 
		return ls_year 
	CASE 'month' 
		return ls_month 
	CASE 'day' 
		return ls_day 
	CASE ELSE 
		return ls_date 
END CHOOSE 
 
return ls_date 
end function 
 
public function string wf_get_cweekname (date as_date);//======================================== 
//功能:获得星期几 
//参数:DATE型,日期格式字符串 
//返回:STRING型,星期一-----星期日的中文字符串 
//日期:2003.01.24 
// 
//======================================== 
string ls_cweekname 
 
CHOOSE CASE lower(dayname(as_date)) 
	CASE	'sunday' 
		ls_cweekname = '星期日' 
	CASE	'monday' 
		ls_cweekname = '星期一' 
	CASE	'tuesday' 
		ls_cweekname = '星期二' 
	CASE	'wednesday' 
		ls_cweekname = '星期三' 
	CASE	'thursday' 
		ls_cweekname = '星期四' 
	CASE	'friday' 
		ls_cweekname = '星期五' 
	CASE	'saturday' 
		ls_cweekname = '星期六' 
END CHOOSE 
 
return ls_cweekname 
end function 
 
public function integer wf_get_monthdays (string as_year, string as_month);//=============================================== 
// 功能:返回指定年月的天数 
// 参数:as_year  string型, 年份 
//      as_month string型, 月份 
// 返回:integer型,该年该月的天数 
// 时间:2003.01.23 
// 作者:相如飞 
// 修改: 
//=============================================== 
string  ls_year, ls_month 
integer li_days 
date    ld_date1, ld_date2 
 
ls_year  = as_year 
ls_month = as_month 
 
ld_date1 = date(ls_year + '/' + ls_month + '/01') 
if ls_month = '12' then 
	ld_date2 = date(string(integer(ls_year) + 1) + '/01/01') 
else 
	ld_date2 = date(ls_year + '/' + string(integer(ls_month) + 1) + '/01') 
end if 
 
li_days = DaysAfter(ld_date1, ld_date2) 
 
return li_days 
end function 
 
public function string wf_get_thisdayrecord (string as_date);//=============================================== 
//功能:读取选取月日的记录信息 
//参数:年,月,日 
//返回:Integer 型. 1 表示有记录, 0 表示没有记录 
//日期:2003.01.25 
//=============================================== 
string ls_data 
 
ls_data = ProfileString("calendar.INI", "RECORD", as_date, "") 
 
return ls_data 
end function 
 
public function integer wf_get_weekdays (date ad_date);//========================================= 
//功能:获得指定日期为星期几 
//参数:ad_date date型 
//返回:星期的数字.0--星期日 
//						1--星期一 
//						2--星期二 
//						3--星期三 
//						4--星期四 
//						5--星期五 
//						6--星期六 
//作者: 
//日期: 
//修改: 
//========================================= 
integer li_weekdays 
//  1980/01/06为星期日 
li_weekdays = DaysAfter(date('1980/01/06'), ad_date) 
li_weekdays = Mod(li_weekdays, 7) 
 
return li_weekdays 
end function 
 
public subroutine wf_read_record ();////将鼠标点击日期的记事内容(如果有的话)读取到mle_record中 
 
string ls_date, ls_record 
 
ls_date = of_get_date('date') //获取鼠标点击处日期 
 
ls_record = wf_get_thisdayrecord(ls_date) 
 
mle_record.text = ls_record 
end subroutine 
 
public function integer wf_querysave ();if uo_1.Enabled = true then 
	if MessageBox('提示','修改内容未保存!需要保存吗?', question!, yesno!, 1) = 1 then 
		uo_1.TriggerEvent(clicked!) 
		return 1 
	else 
		uo_1.Enabled = false 
		return -1 
	end if 
end if 
 
return 1 
end function 
 
event mousemove;call super::mousemove;if ib_MoveIn = true then 
	mle_record.Backcolor = rgb(237,237,237) 
	mle_record.Textcolor = rgb(26,39,54) 
	ib_MoveIn = false 
end if 
 
dw_calendar.Modify(is_MPriorObj + ".Background.Color='" + is_Ori_MColor + "'") 
SetNull(is_MPriorObj) 
end event 
 
event open;call super::open;uo_1.of_setdefault(true)	//Default	按钮 
uo_1.of_setcaption('保  存') 
 
uo_2.of_setcaption('关  闭') 
uo_2.of_setdefault(true)	//Default	按钮 
 
//gs_SkinTopic = "woodskin" 
w_calendar_1.wf_destroyDC() 
w_calendar_1.wf_init_draw() 
dw_calendar.settransobject(sqlca) 
 
timer(1) 
 
dw_calendar.object.t_date.text = string(today(), 'yyyy年mm月') 
//设置当月日历 
dw_calendar.Event ue_set_calendar(ddlb_year.text, ddlb_month.text) 
//打开窗体,自动设置当日为点中状态 
dw_calendar.Event ue_clickday(string(today(), 'yyyy/mm/dd')) 
uo_1.Enabled = FALSE 
 
end event 
event timer;call super::timer;dw_calendar.object.t_time.text = string(now()) 
end event 
 
on w_calendar_1.create 
int iCurrent 
call super::create 
this.st_2=create st_2 
this.uo_2=create uo_2 
this.uo_1=create uo_1 
this.mle_record=create mle_record 
this.sle_date=create sle_date 
this.st_month=create st_month 
this.ddlb_month=create ddlb_month 
this.st_nextmonth=create st_nextmonth 
this.st_priormonth=create st_priormonth 
this.ddlb_year=create ddlb_year 
this.dw_calendar=create dw_calendar 
this.rr_1=create rr_1 
iCurrent=UpperBound(this.Control) 
this.Control[iCurrent+1]=this.st_2 
this.Control[iCurrent+2]=this.uo_2 
this.Control[iCurrent+3]=this.uo_1 
this.Control[iCurrent+4]=this.mle_record 
this.Control[iCurrent+5]=this.sle_date 
this.Control[iCurrent+6]=this.st_month 
this.Control[iCurrent+7]=this.ddlb_month 
this.Control[iCurrent+8]=this.st_nextmonth 
this.Control[iCurrent+9]=this.st_priormonth 
this.Control[iCurrent+10]=this.ddlb_year 
this.Control[iCurrent+11]=this.dw_calendar 
this.Control[iCurrent+12]=this.rr_1 
end on 
 
on w_calendar_1.destroy 
call super::destroy 
destroy(this.st_2) 
destroy(this.uo_2) 
destroy(this.uo_1) 
destroy(this.mle_record) 
destroy(this.sle_date) 
destroy(this.st_month) 
destroy(this.ddlb_month) 
destroy(this.st_nextmonth) 
destroy(this.st_priormonth) 
destroy(this.ddlb_year) 
destroy(this.dw_calendar) 
destroy(this.rr_1) 
end on 
 
event resize;call super::resize;//打开窗体,自动设置当日为点中状态 
//dw_calendar.Event ue_clickday(string(today(), 'yyyy/mm/dd')) 
end event 
 
type st_2 from statictext within w_calendar_1 
integer x = 731 
integer y = 64 
integer width = 1280 
integer height = 128 
integer textsize = -20 
integer weight = 700 
fontcharset fontcharset = gb2312charset! 
fontpitch fontpitch = fixed! 
fontfamily fontfamily = modern! 
string facename = "楷体_GB2312" 
long textcolor = 29625298 
long backcolor = 33026303 
boolean enabled = false 
string text = "日  历  记  事  本" 
alignment alignment = center! 
borderstyle borderstyle = styleraised! 
boolean focusrectangle = false 
end type 
 
type uo_2 from uo_xp_button within w_calendar_1 
integer x = 2414 
integer y = 1216 
integer taborder = 80 
boolean border = false 
long backcolor = 33026303 
end type 
 
on uo_2.destroy 
call uo_xp_button::destroy 
end on 
 
event ue_clicked();call super::ue_clicked;string ls_date, ls_data 
//询问保存 
//wf_querysave() 
 
if uo_1.Enabled = true then 
	if MessageBox('提示','修改内容未保存!需要保存吗?', question!, yesno!, 1) = 1 then 
   ls_date = trim(sle_date.text) 
if ls_date = '' or ls_date = '没选中日期!' then return 
ls_date = right(ls_date, 10) 
ls_data = mle_record.text 
if trim(ls_data) = '' then 
	SetProfileString("calendar.INI", "RECORD", ls_date, '') 
else 
	SetProfileString("calendar.INI", "RECORD", ls_date, ls_data) 
end if 
 
this.Enabled = false 
   if	uo_1.Enabled = false then 
// 	if MessageBox('提示','修改内容未保存!需要保存吗?', question!, yesno!, 1) = -1 then		 
		close(parent) 
 
 
end if 
end if 
end if 
//end if 
close(parent) 
 
end event 
 
type uo_1 from uo_xp_button within w_calendar_1 
integer x = 2011 
integer y = 1216 
integer taborder = 70 
boolean border = false 
end type 
 
on uo_1.destroy 
call uo_xp_button::destroy 
end on 
 
event ue_clicked();call super::ue_clicked;string ls_date, ls_data 
 
ls_date = trim(sle_date.text) 
if ls_date = '' or ls_date = '没选中日期!' then return 
ls_date = right(ls_date, 10) 
ls_data = mle_record.text 
if trim(ls_data) = '' then 
	SetProfileString("calendar.INI", "RECORD", ls_date, '') 
else 
	SetProfileString("calendar.INI", "RECORD", ls_date, ls_data) 
end if 
 
this.Enabled = false 
//刷新日历数据窗口 
dw_calendar.Event ue_set_calendar(ddlb_year.text, ddlb_month.text) 
end event 
 
type mle_record from multilineedit within w_calendar_1 
event ue_mousemove pbm_mousemove 
event ue_enchange pbm_enchange 
integer x = 1902 
integer y = 576 
integer width = 914 
integer height = 608 
integer taborder = 30 
boolean bringtotop = true 
integer textsize = -12 
integer weight = 400 
fontcharset fontcharset = gb2312charset! 
fontpitch fontpitch = variable! 
string facename = "宋体" 
long textcolor = 33026303 
long backcolor = 33026303 
boolean autovscroll = true 
end type 
 
event ue_mousemove; 
if ib_MoveIn = false then	 
	this.Backcolor = rgb(238,255,238) 
	this.textcolor = rgb(0,0,255) 
	ib_MoveIn = true 
end if 
end event 
 
event ue_enchange;uo_1.Enabled = true 
 
end event 
 
event constructor; 
ib_MoveIn = false 
this.Backcolor = rgb(237,237,237) 
this.textcolor = rgb(26,39,54) 
end event 
 
type sle_date from singlelineedit within w_calendar_1 
integer x = 1902 
integer y = 512 
integer width = 914 
integer height = 64 
integer taborder = 20 
integer textsize = -9 
integer weight = 400 
fontcharset fontcharset = gb2312charset! 
fontpitch fontpitch = variable! 
string facename = "宋体" 
long textcolor = 65280 
long backcolor = 0 
end type 
 
type st_month from statictext within w_calendar_1 
integer x = 2139 
integer y = 260 
integer width = 402 
integer height = 224 
integer textsize = -48 
integer weight = 700 
fontcharset fontcharset = gb2312charset! 
fontpitch fontpitch = variable! 
string facename = "华文行楷" 
long textcolor = 128 
long backcolor = 16777215 
string text = "1" 
alignment alignment = center! 
boolean focusrectangle = false 
end type 
 
type ddlb_month from dropdownlistbox within w_calendar_1 
integer x = 1600 
integer y = 232 
integer width = 283 
integer height = 836 
integer taborder = 10 
integer textsize = -9 
integer weight = 400 
fontcharset fontcharset = gb2312charset! 
fontpitch fontpitch = variable! 
string facename = "宋体" 
long textcolor = 33554432 
long backcolor = 15780518 
boolean sorted = false 
string item[] = {"一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"} 
borderstyle borderstyle = stylelowered! 
end type 
 
event constructor; 
integer li_month 
 
li_month = integer(string(today(), 'mm')) 
 
this.Selectitem(li_month) 
end event 
 
event selectionchanged; 
//询问保存 
wf_querysave() 
 
dw_calendar.Event ue_set_calendar(ddlb_year.text, ddlb_month.text) 
//模拟鼠标点击当前选中的日期所在的文本控件,可以自动刷新与日期有关的事件处理 
dw_calendar.Event ue_click(id_PriorObj) 
 
end event 
 
type st_nextmonth from statictext within w_calendar_1 
integer x = 1161 
integer y = 240 
integer width = 73 
integer height = 68 
integer textsize = -9 
integer weight = 400 
fontcharset fontcharset = gb2312charset! 
fontpitch fontpitch = variable! 
string facename = "宋体" 
long textcolor = 33554432 
long backcolor = 12639424 
string text = ">>" 
boolean border = true 
borderstyle borderstyle = styleraised! 
boolean focusrectangle = false 
end type 
 
event clicked; 
integer li_year, li_month 
 
//询问保存 
wf_querysave() 
 
li_year = integer(trim(ddlb_year.text)) 
if trim(ddlb_month.text) = '十二月' then 
	if li_year = 2050 then 
		messagebox('提示','已经到达年份上限!') 
		return 
	else 
		ddlb_year.text = string(li_year + 1) 
		ddlb_month.text = '一月' 
	end if 
else 
	li_month = integer(wf_get_monthnum(trim(ddlb_month.text))) 
	ddlb_month.SelectItem(li_month + 1) 
end if 
 
ddlb_year.TriggerEvent ("Selectionchanged") 
end event 
 
type st_priormonth from statictext within w_calendar_1 
integer x = 654 
integer y = 240 
integer width = 73 
integer height = 68 
integer textsize = -9 
integer weight = 400 
fontcharset fontcharset = gb2312charset! 
fontpitch fontpitch = variable! 
string facename = "宋体" 
long textcolor = 33554432 
long backcolor = 12639424 
string text = "<<" 
boolean border = true 
borderstyle borderstyle = styleraised! 
boolean focusrectangle = false 
end type 
 
event clicked; 
integer li_year, li_month 
 
//询问保存 
wf_querysave() 
 
li_year = integer(trim(ddlb_year.text)) 
if trim(ddlb_month.text) = '一月' then 
	if li_year = 2000 then 
		messagebox('提示','已经到达年份下限!') 
		return 
	else 
		ddlb_year.text = string(li_year - 1) 
		ddlb_month.text = '十二月' 
	end if 
else 
	li_month = integer(wf_get_monthnum(trim(ddlb_month.text))) 
	ddlb_month.SelectItem(li_month - 1) 
end if 
 
ddlb_year.TriggerEvent ("Selectionchanged") 
end event 
 
type ddlb_year from dropdownlistbox within w_calendar_1 
integer x = 37 
integer y = 228 
integer width = 283 
integer height = 644 
integer taborder = 10 
integer textsize = -9 
integer weight = 400 
fontcharset fontcharset = gb2312charset! 
fontpitch fontpitch = variable! 
string facename = "宋体" 
long textcolor = 33554432 
long backcolor = 15780518 
boolean sorted = false 
boolean vscrollbar = true 
string item[] = {"2000","2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014","2015","2016","2017","2018","2019","2020"} 
borderstyle borderstyle = stylelowered! 
end type 
 
event constructor; 
integer li_year 
 
for li_year = 2000 to 2099 
	this.insertitem(string(li_year), li_year - 2000 + 1) 
next 
 
this.text = string(today(), 'yyyy') 
 
 
end event 
 
event selectionchanged; 
ddlb_month.TriggerEvent("selectionchanged") 
end event 
 
type dw_calendar from datawindow within w_calendar_1 
event ue_init ( ) 
event ue_set_calendar ( string as_year,  string as_month ) 
event ue_clickday ( string as_date ) 
event ue_click ( any aa_dwo ) 
event ue_mousemove pbm_mousemove 
integer x = 37 
integer y = 224 
integer width = 1829 
integer height = 1056 
integer taborder = 10 
string title = "none" 
string dataobject = "d_calendar" 
boolean border = false 
boolean livescroll = true 
borderstyle borderstyle = stylelowered! 
end type 
 
event ue_init(); 
integer i 
 
this.SetRedraw(false) 
 
//数据窗体并无数据行,是由文本控件组成 
this.InsertRow(0) 
for i = 1 to 42 
	this.Modify("t_" + string(i) + ".text = ''")  
next 
 
this.SetRedraw(true) 
end event 
 
event ue_set_calendar(string as_year, string as_month);//功能:设置指定年月的日历 
// 
string  ls_date, ls_month, ls_day, ls_record 
integer li_days, i, li_col 
//☆★● 
ls_month = wf_get_monthnum(as_month)          //获得月份(中文)的数字字符 
li_days = wf_get_monthdays(as_year, ls_month) //某年某月有多少天 
 
dw_calendar.TriggerEvent("ue_init") 
//标题日期 
dw_calendar.object.t_date.text = as_year + '年' + ls_month + '月' 
 
//该月的第 1 号应放在数据窗体的第几列 
li_col = wf_get_weekdays(date(as_year + '/' + ls_month + '/01')) + 1 
//求得第 1 号位于第几列位置,然后每个文本控件(编号为t_1, t_2, t_3...) 
//依次赋值即可 
for i = 1 to li_days	 
	ls_day = string(i, '00') 
	ls_date = as_year + '/' + ls_month + '/' + ls_day 
	ls_record = wf_get_thisdayrecord(ls_date) 
	if trim(ls_record) <> "" and (Not IsNull(ls_record)) then ls_day = ls_day + '~r~n        ●' 
	dw_calendar.Modify("t_" + string(i + li_col - 1) + ".text = '" + ls_day + "'")	 
next 
 
////提示今日时间 
//if as_year = string(today(), 'yyyy') and as_month = string(today(), 'mm') then 
//	 
//end if 
 
//月份提示 
st_month.text = string(integer(ls_month)) 
 
 
 
 
 
 
 
end event 
 
event ue_clickday(string as_date);//======================================================== 
//功能:选中指定日期(模拟鼠标点击效果) 
//参数:无 
//返回:无 
//日期:2003.01.24 
//======================================================== 
dwobject ld_day 
integer  li_weeknum, li_curday, li_days 
 
//得到当日的数字 
li_curday = integer(right(as_date, 2)) 
//获得当月第 1 号为星期几 
li_weeknum = wf_get_weekdays(date(left(as_date, 8) + '/01')) 
 
//确定应该选择哪个文本控件为点击对象 
li_days = li_curday + li_weeknum 
// 
CHOOSE CASE li_days 
	CASE 1 
		ld_day = dw_calendar.object.t_1 
	CASE 2 
		ld_day = dw_calendar.object.t_2 
	CASE 3 
		ld_day = dw_calendar.object.t_3 
	CASE 4 
		ld_day = dw_calendar.object.t_4 
	CASE 5 
		ld_day = dw_calendar.object.t_5 
	CASE 6 
		ld_day = dw_calendar.object.t_6 
	CASE 7 
		ld_day = dw_calendar.object.t_7 
	CASE 8 
		ld_day = dw_calendar.object.t_8 
	CASE 9 
		ld_day = dw_calendar.object.t_9 
	CASE 10 
		ld_day = dw_calendar.object.t_10 
	CASE 11 
		ld_day = dw_calendar.object.t_11 
	CASE 12 
		ld_day = dw_calendar.object.t_12 
	CASE 13 
		ld_day = dw_calendar.object.t_13 
	CASE 14 
		ld_day = dw_calendar.object.t_14 
	CASE 15 
		ld_day = dw_calendar.object.t_15 
	CASE 16 
		ld_day = dw_calendar.object.t_16 
	CASE 17 
		ld_day = dw_calendar.object.t_17 
	CASE 18 
		ld_day = dw_calendar.object.t_18 
	CASE 19 
		ld_day = dw_calendar.object.t_19 
	CASE 20 
		ld_day = dw_calendar.object.t_20 
	CASE 21 
		ld_day = dw_calendar.object.t_21 
	CASE 22 
		ld_day = dw_calendar.object.t_22 
	CASE 23 
		ld_day = dw_calendar.object.t_23 
	CASE 24 
		ld_day = dw_calendar.object.t_24 
	CASE 25 
		ld_day = dw_calendar.object.t_25 
	CASE 26 
		ld_day = dw_calendar.object.t_26 
	CASE 27 
		ld_day = dw_calendar.object.t_27 
	CASE 28 
		ld_day = dw_calendar.object.t_28 
	CASE 29 
		ld_day = dw_calendar.object.t_29 
	CASE 30 
		ld_day = dw_calendar.object.t_30 
	CASE 31 
		ld_day = dw_calendar.object.t_31 
	CASE 32 
		ld_day = dw_calendar.object.t_32 
	CASE 33 
		ld_day = dw_calendar.object.t_33 
	CASE 34 
		ld_day = dw_calendar.object.t_34 
	CASE 35 
		ld_day = dw_calendar.object.t_35 
	CASE 36 
		ld_day = dw_calendar.object.t_36 
	CASE 37 
		ld_day = dw_calendar.object.t_37 
END CHOOSE 
 
this.Event ue_click(ld_day) 
 
 
 
end event 
 
event ue_click(any aa_dwo); 
integer  li_num 
dwobject ld_dwo 
ld_dwo = aa_dwo 
//询问保存 
//wf_querysave() 
 
this.SetRedraw(false) 
 
if ld_dwo.type = "text" then 
	//恢复原来的属性值 
	if IsValid(id_PriorObj) then 
		this.Modify(id_PriorObj.name + ".Background.Color='" + is_Ori_Color + "'") 
		this.Modify(id_PriorObj.name + ".Border='" + is_Ori_Border + "'") 
	end if 
	//保存当前点击对象属性值,以便下次恢复 
	id_PriorObj = ld_dwo 
//	is_Ori_Color = this.Describe(ld_dwo.name + ".Background.Color") 
	//================================================================ 
	//此处处理由于[Clicked]和[ue_mousemove]交叉事件引起的冲突 
	li_num = integer(Mid(string(ld_dwo.name), 3, 2)) 
	if of_checkweek(li_num) = 1 then 
		is_Ori_Color = is_GetBackColor0 
	else 
		is_Ori_Color = is_GetBackColor1 
	end if 
	is_Ori_MColor = is_MouseClickColor 
	//================================================================ 
	is_Ori_Border = this.Describe(ld_dwo.name + ".Border") 
	//改变当前点击对象的背景色,边框,位置,大小 
	this.Modify(ld_dwo.name + ".Background.Color='" + is_MouseClickColor + "'") 
	this.Modify(ld_dwo.name + ".Border='5'") 
end if 
 
this.SetRedraw(true) 
//=================================================================== 
//以下处理鼠标点击获取日期后的事务 
if of_get_date('date') = 'Error' then 
	sle_date.text = '没选中日期!' 
	mle_record.text = '' 
	mle_record.Enabled = false 
else 
	sle_date.text = '日期:'+ of_get_date('date') 
	wf_read_record() 
	mle_record.Enabled = true 
end if 
end event 
 
event ue_mousemove; 
if ib_MoveIn = true then 
	mle_record.Backcolor = rgb(237,237,237) 
	mle_record.textcolor = rgb(26,39,54) 
	ib_MoveIn = false 
end if 
 
string   ls_obj 
 
ls_obj = Getobjectatpointer() 
ls_obj = Left(ls_obj, pos(ls_obj, '~t') - 1) 
 
if is_MPriorObj = ls_obj then return 
//若鼠标移至当前点击的日期对象,则返回 
if this.Describe(ls_obj + ".Border") = '5' then 
	//恢复原来的背景色 
	if Trim(is_MPriorObj) <> '' then 
		this.Modify(is_MPriorObj + ".Background.Color='" + is_Ori_MColor + "'") 
	end if 
	SetNull(is_MPriorObj) 
	return 
end if 
 
if Pos(ls_obj, 't_') > 0 and IsNumber(Mid(ls_obj, 3, 1)) then	 
	this.SetRedraw(false) 
	//恢复原来的背景色 
	if Trim(is_MPriorObj) <> '' then 
		this.Modify(is_MPriorObj + ".Background.Color='" + is_Ori_MColor + "'") 
	end if 
	//保存当前对象属性值,以便下次恢复 
	is_MPriorObj = ls_obj 
	//============================================================ 
	//此处处理由于[Clicked]和[ue_mousemove]交叉事件引起的冲突 
	if this.Describe(ls_obj + ".Border") = '0' then 
		is_Ori_MColor = this.Describe(ls_obj + ".Background.Color") 
	else 
		is_Ori_MColor = is_MouseClickColor 
	end if 
	//============================================================ 
	//改变当前对象的背景色 
	this.Modify(ls_obj + ".Background.Color='" + is_MouseMouseColor + "'") 
	this.SetRedraw(true) 
else 
	//恢复原来的背景色 
	if Trim(is_MPriorObj) <> '' then 
		this.Modify(is_MPriorObj + ".Background.Color='" + is_Ori_MColor + "'") 
	end if 
	SetNull(is_MPriorObj) 
end if 
 
end event 
 
event clicked; 
if row <= 0 then return 
 
this.Event ue_click(dwo) 
end event 
 
event dberror; 
return 1 
end event 
 
type rr_1 from roundrectangle within w_calendar_1 
long linecolor = 33554432 
integer linethickness = 4 
long fillcolor = 16777215 
integer x = 2085 
integer y = 256 
integer width = 521 
integer height = 236 
integer cornerheight = 40 
integer cornerwidth = 46 
end type