After racking my brains and sending Pysdo-bug Reports to Selwyn with array behaviours. Which He, very graciously replied to with some enlightening comments. TNX Selwyn! I put together this layout coded below:
Copy, Paste into new xbasic script in the CODE tab of Alpha, save and then run to see results.
Please feel free to use this. As I will for an Xdialog with embedded browse.
If any one can trim this down or arrange an alternative logic for coding the variable containers then please have a go! but, please post the results in this thread for everone to enjoy.
P.S. Click on the orange labels for a popup message
Copy, Paste into new xbasic script in the CODE tab of Alpha, save and then run to see results.
Code:
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: } {'%O={F=Arial,14}{C=Black}WEEK OF%} [.15mon1!change]-[.15sun1!change] ; <%B=T;O={J=C,C}{B=Orange}monday;OF={J=C,C}monday%13,1!mon> <%B=T;O={J=C,C}{B=Orange}tuesday;OF={J=C,C}tuesday%13,1!tue> <%B=T;O={J=C,C}{B=Orange}wednesday;OF={J=C,C}wednesday%13,1!wed> <%B=T;O={J=C,C}{B=Orange}thursday;OF={J=C,C}thursday%13,1!thu> <%B=T;O={J=C,C}{B=Orange}friday;OF={J=C,C}friday%13,1!fri> <%B=T;O={J=C,C}{B=Orange}saturday;OF={J=C,C}saturday%13,1!sat> <%B=T;O={J=C,C}{B=Orange}sunday;OF={J=C,C}sunday%15,1!sun>; {watch=vldate!change} [.15mon1!change] [.15tue1!change] [.15wed1!change] [.15thu1!change] [.15fri1!change] [.15sat1!change] [.15sun1!change];; <%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)
If any one can trim this down or arrange an alternative logic for coding the variable containers then please have a go! but, please post the results in this thread for everone to enjoy.
P.S. Click on the orange labels for a popup message
Comment