Indeed John, thanks for the example.
The code now looks like:
Code:
{region} <%O={J=C,L}{I:'$$navigate.prev'} PREV%!prev> <%O={J=C,C}NEXT {I:'$$navigate.next'}%!next> {endregion};
Alpha Software Mobile Development Tools: Alpha Anywhere | Alpha TransForm |
{region} <%O={J=C,L}{I:'$$navigate.prev'} PREV%!prev> <%O={J=C,C}NEXT {I:'$$navigate.next'}%!next> {endregion};
{region} <%O={J=C,L}{I:'$$navigate.prev'} PREV%!prev> <%O={J=C,C}{I:'$$navigate.next'} NEXT%!next> <%O={J=C,C}Button1 {I:'$$application.chrome'}%!event1> {endregion};
dim xDlgHeader as p dim dlg_title as c dim dlg_body as c dim dlg_event as c xDlgHeader.HeadingText = " A weekly View " xDlgHeader.Image = "a5v7_largeIcon" xDlgHeader.BodyText = <<%str% All in all finished %str% dlg_title = "A weeks view " vdate = date()-(dow(date())-1) vdaynum = dow(date())-1 vldate = vdate sun1 = vldate+7 mon1 = vldate+1 tue1 = vldate+2 wed1 = vldate+3 thu1 = vldate+4 fri1 = vldate+5 sat1 = vldate+6 dlg_body = <<%dlg% 'If you include the {removecomments} command, any line that starts with an single quote will be treated as a comment. {removecomments} {theme=xp} {background=white} '{can_exit=close} {startup=init} {stretch=} {stickto=top,right} {justify=right} <%B=N;I=$$window.button.minimize%!minimize><%B=N;I=$$window.button.close%!close>; {region=1}; {image=logo} {endregion} {justify=center} {XdialogTitleSection=70,6xDlgHeader};; {lf}; {blueframe=1,5: } {watch=vldate!change} [COLOR="#0000FF"]{'%O={F=Arial,14}{C=Black}WEEK OF%} [.12mon1!change]_[.12sun1!change] ; {region} <%B=T;O={J=C,C}{B=Orange}monday;OF={J=C,C}monday%10.8,1!mon>; {justify=top,center}[.12mon1!change] {endregion} {region} <%B=T;O={J=C,C}{B=Orange}tuesday;OF={J=C,C}tuesday%10.8,1!tue>; {justify=top,center}[.12tue1!change] {endregion} {region} <%B=T;O={J=C,C}{B=Orange}wednesday;OF={J=C,C}wednesday%10.8,1!wed>; {justify=top,center}[.12wed1!change] {endregion} {region} <%B=T;O={J=C,C}{B=Green}thursday;OF={J=C,C}thursday%10.8,1!thu>; {justify=top,center}[.12thu1!change] {endregion} {region} <%B=T;O={J=C,C}{B=Orange}friday;OF={J=C,C}friday%10.8,1!fri>; {justify=top,center}[.12fri1!change] {endregion} {region} <%B=T;O={J=C,C}{B=Orange}saturday;OF={J=C,C}saturday%10.8,1!sat>; {justify=top,center}[.12sat1!change] {endregion} {region} <%B=T;O={J=C,C}{B=Orange}sunday;OF={J=C,C}sunday%10.8,1!sun>; {justify=top,center}[.12sun1!change];; {endregion} {lf}; {region} <%O={J=C,L}{I:'$$navigate.prev'} PREV%!prev> <%O={J=C,C}{I:'$$navigate.next'} NEXT%!next> {endregion}; {lf}; {region=a} {xmargin=1}{ymargin=1} {stretch=height,width} {stretch=} '{stickto=bottom,left} This is an indication of current vldate.value [.12vldate];[/COLOR]{lf}; {endregion}; {condition_begin=vldate=date()} {justify=center} [.12vldate] {condition_end} <%O={J=C,C}{I:'$$code.execute'} Today%!today>; %dlg% dlg_event = <<%code% if a_dlg_button = "init" then a_dlg_button = "" end if if a_dlg_button = "next" then 'a_dlg_button = "" button_xbasic = <<%code_string% vldate= vldate+7 sun1 = vldate+7 mon1 = vldate+1 tue1 = vldate+2 wed1 = vldate+3 thu1 = vldate+4 fri1 = vldate+5 sat1 = vldate+6 %code_string% evaluate_template(button_xbasic) end if if a_dlg_button = "prev" then 'a_dlg_button = "" button_xbasic = <<%code_string% vldate=vldate -7 sun1 = vldate+7 mon1 = vldate+1 tue1 = vldate+2 wed1 = vldate+3 thu1 = vldate+4 fri1 = vldate+5 sat1 = vldate+6 %code_string% evaluate_template(button_xbasic) end if if a_dlg_button = "today" then 'a_dlg_button = "" button_xbasic = <<%code_string% vdaynum = dow(date())-1 vldate = vdate+vdaynum vldate = date()-(dow(date())-1) sun1 = vdate+7 mon1 = vdate+1 tue1 = vdate+2 wed1 = vdate+3 thu1 = vdate+4 fri1 = vdate+5 sat1 = vdate+6 %code_string% evaluate_template(button_xbasic) button_xbasic1 = <<%code_string% vldate = vdate+vdaynum %code_string% evaluate_template(button_xbasic1) end if if a_dlg_button = "close" then ui_modeless_dlg_close(dlg_title) end if if a_dlg_button = "init" then a_dlg_button = "" end if if a_dlg_button = "minimize" then a_dlg_button = "" ui_dlg_minimize(dlg_title) end if if a_dlg_button = "sat" then a_dlg_button = "" ui_msg_box("Your Choice","The day is Saturday and the date is "+sat1) end if if a_dlg_button = "fri" then a_dlg_button = "" ui_msg_box("Your Choice","The day is Friday and the date is "+fri1) end if if a_dlg_button = "thu" then a_dlg_button = "" ui_msg_box("Your Choice","The day is Thursday and the date is "+thu1) end if if a_dlg_button = "wed" then a_dlg_button = "" ui_msg_box("Your Choice","The day is Wednesday and the date is "+wed1) end if if a_dlg_button = "tue" then a_dlg_button = "" ui_msg_box("Your Choice","The day is Tuesday and the date is "+tue1) end if if a_dlg_button = "mon" then a_dlg_button = "" ui_msg_box("Back to the Grind!","The day is Monday and the date is "+mon1) end if if a_dlg_button = "sun" then a_dlg_button = "" ui_msg_box("Don't you ever rest!","Take a day off you deserved it..") end if %code% 'Now, display the Xdialog. ui_modeless_dlg_box(dlg_title,dlg_body,dlg_event)
dim xDlgHeader as p dim dlg_title as c dim dlg_body as c dim dlg_event as c xDlgHeader.HeadingText = " A weekly View " xDlgHeader.Image = "a5v7_largeIcon" xDlgHeader.BodyText = <<%str% All in all finished %str% dlg_title = "A weeks view " vdate = date()-(dow(date())-1) vdaynum = dow(date())-1 vldate = vdate sun1 = vldate+7 mon1 = vldate+1 tue1 = vldate+2 wed1 = vldate+3 thu1 = vldate+4 fri1 = vldate+5 sat1 = vldate+6 dlg_body = <<%dlg% 'If you include the {removecomments} command, any line that starts with an single quote will be treated as a comment. {removecomments} {theme=xp} {background=white} '{can_exit=close} {startup=init} {stretch=} {stickto=top,right} {justify=right} <%B=N;I=$$window.button.minimize%!minimize><%B=N;I=$$window.button.close%!close>; {region=1}; {image=logo} {endregion} {justify=center} {XdialogTitleSection=70,6xDlgHeader};; {lf}; {blueframe=1,5: } [COLOR="#FF0000"]{watch=vldate!change} {'%O={F=Arial,14}{C=Black}WEEK OF%} [.15mon1!change]-[.15sun1!change] ; {region} <%B=T;O={J=C,C}{B=Orange}monday;OF={J=C,C}monday%14,1!mon>; [.15mon1!change] {endregion} {region} <%B=T;O={J=C,C}{B=Orange}tuesday;OF={J=C,C}tuesday%14,1!tue>; [.15tue1!change] {endregion} {region} <%B=T;O={J=C,C}{B=Orange}wednesday;OF={J=C,C}wednesday%14,1!wed>; [.15wed1!change] {endregion} {region} <%B=T;O={J=C,C}{B=Green}thursday;OF={J=C,C}thursday%14,1!thu>; [.15thu1!change] {endregion} {region} <%B=T;O={J=C,C}{B=Orange}friday;OF={J=C,C}friday%14,1!fri>; [.15fri1!change] {endregion} {region} <%B=T;O={J=C,C}{B=Orange}saturday;OF={J=C,C}saturday%14,1!sat>; [.15sat1!change] {endregion} {region} <%B=T;O={J=C,C}{B=Orange}sunday;OF={J=C,C}sunday%14,1!sun>; [.15sun1!change];; {endregion} {lf}; [/COLOR] <%O={J=C,C}{I:'$$navigate.prev'} PREV%!prev> <%O={J=C,C}{I:'$$navigate.next'} NEXT%!next> {endregion}; {lf}; {region=a} {xmargin=1}{ymargin=1} {stretch=height,width} {stretch=} '{stickto=bottom,left} This is an indication of current vldate.value [.15vldate]; {lf}; {endregion}; {condition_begin=vldate=date()} {justify=center} [.15vldate] {condition_end} <%O={J=C,C}{I:'$$code.execute'} Today%!today>; %dlg% dlg_event = <<%code% if a_dlg_button = "init" then a_dlg_button = "" end if if a_dlg_button = "next" then 'a_dlg_button = "" button_xbasic = <<%code_string% vldate= vldate+7 sun1 = vldate+7 mon1 = vldate+1 tue1 = vldate+2 wed1 = vldate+3 thu1 = vldate+4 fri1 = vldate+5 sat1 = vldate+6 %code_string% evaluate_template(button_xbasic) end if if a_dlg_button = "prev" then 'a_dlg_button = "" button_xbasic = <<%code_string% vldate=vldate -7 sun1 = vldate+7 mon1 = vldate+1 tue1 = vldate+2 wed1 = vldate+3 thu1 = vldate+4 fri1 = vldate+5 sat1 = vldate+6 %code_string% evaluate_template(button_xbasic) end if if a_dlg_button = "today" then 'a_dlg_button = "" button_xbasic = <<%code_string% vdaynum = dow(date())-1 vldate = vdate+vdaynum vldate = date()-(dow(date())-1) sun1 = vdate+7 mon1 = vdate+1 tue1 = vdate+2 wed1 = vdate+3 thu1 = vdate+4 fri1 = vdate+5 sat1 = vdate+6 %code_string% evaluate_template(button_xbasic) button_xbasic1 = <<%code_string% vldate = vdate+vdaynum %code_string% evaluate_template(button_xbasic1) end if if a_dlg_button = "close" then ui_modeless_dlg_close(dlg_title) end if if a_dlg_button = "init" then a_dlg_button = "" end if if a_dlg_button = "minimize" then a_dlg_button = "" ui_dlg_minimize(dlg_title) end if if a_dlg_button = "sat" then a_dlg_button = "" ui_msg_box("Your Choice","The day is Saturday and the date is "+sat1) end if if a_dlg_button = "fri" then a_dlg_button = "" ui_msg_box("Your Choice","The day is Friday and the date is "+fri1) end if if a_dlg_button = "thu" then a_dlg_button = "" ui_msg_box("Your Choice","The day is Thursday and the date is "+thu1) end if if a_dlg_button = "wed" then a_dlg_button = "" ui_msg_box("Your Choice","The day is Wednesday and the date is "+wed1) end if if a_dlg_button = "tue" then a_dlg_button = "" ui_msg_box("Your Choice","The day is Tuesday and the date is "+tue1) end if if a_dlg_button = "mon" then a_dlg_button = "" ui_msg_box("Back to the Grind!","The day is Monday and the date is "+mon1) end if if a_dlg_button = "sun" then a_dlg_button = "" ui_msg_box("Don't you ever rest!","Take a day off you deserved it..") end if %code% 'Now, display the Xdialog. ui_modeless_dlg_box(dlg_title,dlg_body,dlg_event)
Leave a comment: