Hello,
I have the Tree-Menu on left and show the xdialog form on the right side layout. I want to open the xDialog form when changed the Menu selection.
I have tried
(1) {condition} ... condition 1, condition 2, condition nth .... {condition=.t.} command which is work well but Problem is I have to write for too many conditions.
(2) {include =.... } and {embedded = ... } with UDF which is this sample code. I'd like to use this function but It did not fire, refresh, show with a proper xdialog whenever changed the Tree.
(3) {include =.... } and {embedded = ... } with String-dialog( dlg_basic=<<%dlg% ..... %dlg% .... ). - same problem, not worked
Does anyone know what did I missing on this code? or It is not suitable with Tree.
I have the Tree-Menu on left and show the xdialog form on the right side layout. I want to open the xDialog form when changed the Menu selection.
I have tried
(1) {condition} ... condition 1, condition 2, condition nth .... {condition=.t.} command which is work well but Problem is I have to write for too many conditions.
(2) {include =.... } and {embedded = ... } with UDF which is this sample code. I'd like to use this function but It did not fire, refresh, show with a proper xdialog whenever changed the Tree.
(3) {include =.... } and {embedded = ... } with String-dialog( dlg_basic=<<%dlg% ..... %dlg% .... ). - same problem, not worked
Code:
tree_data = <<%a% +3Users and Groups.1+2Basic +3Users and Groups.1+2Child +3Report.1+2Report one +3Report.1+2Report two %a% tree_images = <<%a% $a5_folder $a5_folder_open user_object16x16_0 %a% dim vDynamicTitle as c= "" vDynamicTitle ="basicDlg" 'vDynamicTitle ="ChildDlg" vDynamicTitle =eval("vDynamicTitle") ' 'structure dim vdlg as c ="" vSelect="Users and Groups.Basic" vdlg = <<%dlg% {startup=init} {watch=vSelect!vTree_changed} {Font = Arial,8,""} {region=L} [%S=LX;[email protected]_images%.30,20vSelect^<tree_data] {endregion}| {region=R} Which:|; [SIZE=4][COLOR="#0000FF"]__dlgname__; [/COLOR][/SIZE] {endregion}; {line=2,2; {region} <*15&OK!OK> <15&Cancel!CANCEL> {endregion}; %dlg% dlg_event=<<%code% if a_dlg_button = "init" then a_dlg_button = "" Show_BasicList(local_variables()) 'and {embedded=0,0:basicList}; it works 'show_embedded(local_variables()) vDynamicTitle =eval( "vDynamicTitle" ) 'vdlg = stritran(vdlg,"__dlgname__","{include="+ var->vDynamicTitle +"}") end if If a_dlg_button ="vTree_changed" then vDynamicTitle ="" If vSelect="Users and Groups.Child" then show_embedded(local_variables()) vDynamicTitle ="ChildDlg" 'vdlg = stritran(vdlg,"__dlgname__","{include=dlgchild}") else If vSelect="Users and Groups.Basic" Show_BasicList(local_variables()) vDynamicTitle ="BasicDlg" 'vdlg = stritran(vdlg,"__dlgname__","{include=dlgList}") else msgbox("selected other") end if msgbox("tree value ",vDynamicTitle) vDynamicTitle = eval("vDynamicTitle") vdlg ="" [COLOR="#FF0000"] vdlg = stritran(vdlg,"__dlgname__","{embedded=0,0:"+ var->vDynamicTitle +"}")[/COLOR] ui_dlg_refresh("Tree List and form") [COLOR="#FF0000"][SIZE=5]showvar(vdlg,"test when tree changed ")[/SIZE][/COLOR] '[COLOR="#FF0000"]It showed blank result. Problem at here.[/COLOR] a_dlg_button ="" end if %code% 'vdlg = stritran(vdlg,"__dlgname__","{include="+ var->vDynamicTitle +"}") vdlg = stritran(vdlg,"__dlgname__","{embedded=0,0:"+ var->vDynamicTitle +"}") showvar(vdlg,"test just code ") varC_result = ui_dlg_box("Tree List and form",vdlg,dlg_event) Function Show_BasicList as c (vars as p) with vars data = <<%a% Row 1 Column 1{T=$1}Row 1 Column 2{T=$2}Row 1 Column 3 Row 2 Column 1{T=$1}Row 2 Column 2{T=$2}Row 2 Column 3 Row 3 Column 1{T=$1}Row 3 Column 2{T=$2}Row 3 Column 3 Row 4 Column 1{T=$1}Row 4 Column 2{T=$2}Row 4 Column 3 Row 5 Column 1{T=$1}Row 5 Column 2{T=$2}Row 5 Column 3 Row 6 Column 1{T=$1}Row 6 Column 2{T=$2}Row 6 Column 3 %a% vDynamicTitle = "BasicDlg" ui_Modeless_dlg_box(vDynamicTitle,<<%dlg% {watch=ui_dlg_control_anchor_from_pos(dlg_title)!resize} <%O={@@};B=ILG;F=fmt%100=fmt!click>; [%O={@@};F=fmt;R;%.100,18item^#data] %dlg%) end with end function function show_embedded as v (vars as P) with vars vDynamicTitle ="ChildDlg" ui_modeless_dlg_box(vDynamicTitle,<<%dlg% {wrap=40} This is an embedded dialog box that responds to the Hello event sent to it from its parent.; {lf}; Name: [.20name]; {lf}; Enter a name into the Name field and click this button. After 2 seconds, the "Hello" dialog box will appear.; {lf}; <Hello>; %dlg%,<<%code% if a_dlg_button = "Hello" then 'sleep(2) ui_msg_box("","Hello: " + name) ui_modeless_dlg_close("childDlg") end if %code%) end with end function
Comment