datawindow¸¦ ÀÔ·Â,¼öÁ¤,»èÁ¦ÇÑ »óÅ¿¡¼ ½Ç¼ö·Î ¾Æ´Ï¸é Àؾî¹ö¸®°í ±×³É window¸¦ ´Ý´Â °æ¿ì°¡ ÀÖÀ»¼ö ÀÖ½À´Ï´Ù.
ÀÌ·¯ÇÑ °æ¿ì¿¡ dwÀÇ º¯°æÀ» checkÇؼ window¸¦ ´ÝÁö ¸øÇÏ°Ô ÇÏ¸é ±ú²ýÀÌ ÇØ°áµÇ°ÚÁÒ?
¿ì¼± windowÀÇ closequery event¿¡ ´ÙÀ½°ú °°ÀÌ ¾¹´Ï´Ù.
//closequery event
boolean lb_check
datawindow ldw_dw[]
//window¸¦ ´ÝÀ»¶§ º¯°æÀ» checkÇÏ°í ½ÍÀº dw
//(¿¹¸¦ µé¾î dw_exam°ú dw_exam1À϶§)
ldw_dw[1] = dw_exam
ldw_dw[2] = dw_exam1
lb_check = f_dw_check(ldw_dw[],this.title)
if lb_check = true then
close(this)
else
message.returnvalue = -1
end if
À̶§ ¾²ÀÌ´Â ÇÔ¼ö¸¦ »ìÆ캸¸é...´ÙÀ½°ú °°½À´Ï´Ù.
//f_dw_check
//adw_dwin : datawindow
//msg : string
int i,j,k, rcnt, chk_dw
dwitemstatus status_of_item
chk_dw = 0
j = Upperbound(adw_dwin)
For k = 1 to j
adw_dwin[k].accepttext()
//datawindowÀÇ º¯°æÀ¯¹«¸¦ checkÇÑ´Ù.
if chk_dw <> 1 then
if adw_dwin[k].deletedcount()>0 or adw_dwin[k].modifiedcount()>0 then
chk_dw = 1
end if
end if
Next
//datawindowµéÀÇ º¯°æÀÌ ¾øÀ¸¸é true return, ÀÖÀ¸¸é messagebox¸¦ ¸¸µç´Ù.
if check_dw = 0 then
return true
else
if MessageBox("È®ÀÎ",msg + "~r~n~r~n¿¡ º¯°æµÈ ÀÚ·á°¡ ÀÖ½À´Ï´Ù." +&
"~r~nÀúÀåÇÏÁö ¾Ê°í °è¼ÓÇϽðڽÀ´Ï±î ??? ",Question!,YesNo!,2) = 2 Then
Return false
end If
end if
return true
ÀÌ·¯ÇÑ logicÀº ÇϳªÀÇ datawindow¿¡ Á¾¼ÓµÇ¾î ÀÖ´Â ¶Ç´Ù¸¥ datawindow°¡ ÀÖÀ»¶§ ÀÀ¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.
sub-datawindowÀÇ ¼öÁ¤ÀÌ ÀÖÀ» °æ¿ì¿¡ parent-datawindow ÀÇ click event¿¡¼ row°¡ ¹Ù²îÁö ¸øÇÏ°Ô ÇÏ¸é µÇ°ÚÁö¿ä... |