Hi All,
After changed the few codes from the "Calendar At A Glance" and other samples, I just made this xdialog Calendar. I could not figured the "Button object name" when I pressed a button from my xdialog. After I know the "object name" then I could write for Event code.
Does any one know how to get the "object name" ?
After changed the few codes from the "Calendar At A Glance" and other samples, I just made this xdialog Calendar. I could not figured the "Button object name" when I pressed a button from my xdialog. After I know the "object name" then I could write for Event code.
Does any one know how to get the "object name" ?
actdate = date()
startdate = ctod(padl(alltrim(str(month(ActDate))),2,"0")+"/01/"+alltrim(str(year(ActDate))))
startnum = dow(ctod(padl(alltrim(str(month(ActDate))),2,"0")+"/01/"+alltrim(str(year(ActDate)))))
monthname=cmonth(Actdate)+" "+cyear(actdate)
mnth=month(actdate)
curr_month=cmonth(ActDate)
curr_year=cyear(ActDate)
btns =""
daynum =""
vShow =""
dlg=<<%dlg%
{can_exit=on_exit}
{comment This first region contains the month name}
{region}
{font=Arial,14,B}
{text=35,2:monthname}
{font=Arial,8}
{endregion};
;
{comment Writing 'region=a' means that all identically designated regions
will share the same horizontal tab dimensions.
This second region contains the day of week header}
{region=a}
{font=Arial,12,B}
S M T W T F S
{endregion};
{region=a}
{font=Arial,12,b}
%dlg%
'create the button
FOR i = 1 to 42 step 1
vShow = alltrim(str(day(startdate-startnum+i)))
dlg = dlg+"<%O={@@}%5,2 "+ vShow+"!x"+vShow+">" +If(i=7 .or. i=14 .or. i=21 .or. i=28 .or. i=35 .or. i=42,";"+crlf(),"")
NEXT
dlg = dlg+<<%dlg%
{endregion};
%dlg%
code=<<%code%
if a_dlg_button="on_exit" then 'when user presses the X in the upper right corner
ui_modeless_dlg_close("@="+dlg_title)
end if
if left(a_dlg_button,1)="x" then
a_dlg_button =""
'how do I know the event or object name?
msgbox("hello","what is this object name? "+left(a_dlg_button,2))
end if
%code%
dlg_title="dlg_"+remspecial(time())
eval(dlg_title)="Calendar At A Glance"
ui_modeless_dlg_box("@="+dlg_title,dlg,code)
startdate = ctod(padl(alltrim(str(month(ActDate))),2,"0")+"/01/"+alltrim(str(year(ActDate))))
startnum = dow(ctod(padl(alltrim(str(month(ActDate))),2,"0")+"/01/"+alltrim(str(year(ActDate)))))
monthname=cmonth(Actdate)+" "+cyear(actdate)
mnth=month(actdate)
curr_month=cmonth(ActDate)
curr_year=cyear(ActDate)
btns =""
daynum =""
vShow =""
dlg=<<%dlg%
{can_exit=on_exit}
{comment This first region contains the month name}
{region}
{font=Arial,14,B}
{text=35,2:monthname}
{font=Arial,8}
{endregion};
;
{comment Writing 'region=a' means that all identically designated regions
will share the same horizontal tab dimensions.
This second region contains the day of week header}
{region=a}
{font=Arial,12,B}
S M T W T F S
{endregion};
{region=a}
{font=Arial,12,b}
%dlg%
'create the button
FOR i = 1 to 42 step 1
vShow = alltrim(str(day(startdate-startnum+i)))
dlg = dlg+"<%O={@@}%5,2 "+ vShow+"!x"+vShow+">" +If(i=7 .or. i=14 .or. i=21 .or. i=28 .or. i=35 .or. i=42,";"+crlf(),"")
NEXT
dlg = dlg+<<%dlg%
{endregion};
%dlg%
code=<<%code%
if a_dlg_button="on_exit" then 'when user presses the X in the upper right corner
ui_modeless_dlg_close("@="+dlg_title)
end if
if left(a_dlg_button,1)="x" then
a_dlg_button =""
'how do I know the event or object name?
msgbox("hello","what is this object name? "+left(a_dlg_button,2))
end if
%code%
dlg_title="dlg_"+remspecial(time())
eval(dlg_title)="Calendar At A Glance"
ui_modeless_dlg_box("@="+dlg_title,dlg,code)
Comment