//********************************************************************** // Use Fdx4.utl // FDX aware cFileList_List selector object // // By Sture Andersen // // Create: Sun 16-01-2000 // Update: // //********************************************************************** #HEADER Use Fdx2.utl // FDX aware object for displaying a table definiton Use Fdx3.utl // FDX aware cFileList_List selector class #ENDHEADER #IFDEF IS$WINDOWS use aps object oUserModalSelectTables is a aps.ModalPanel set Border_Style to BORDER_THICK // Make panel resizeable set pMinimumSize to 180 0 set Locate_Mode to CENTER_ON_SCREEN property integer piNeedsFilling public 1 property integer piResult public 0 on_key kCancel send close_panel on_key kSave_Record send close_panel_ok procedure close_panel_ok set piResult to 1 send close_panel end_procedure object oCont is a aps.Container3D set p_auto_column to false object oLst is a cFdxFileMultiSelector set size to 180 0 set piNo_Alias_State to true // Exclude alias files //send DriverFilter_Add DBMS_DRIVER_DATAFLEX procedure re_order end_procedure procedure update_select_display // This is called automatically by the class local integer selected# total# get File_Select_Count to selected# get Row_Count to total# send select_display selected# total# end_procedure end_object // oLst object oSelectTxt is a aps.TextBox snap sl_right end_object set auto_size_state of (oSelectTxt(self)) to true send aps_align_by_moving (oSelectTxt(self)) (oLst(self)) SL_ALIGN_BOTTOM procedure select_display integer selected# integer total# set value of (oSelectTxt(self)) to ("Selected: "+string(selected#)) end_procedure object oBtn1 is a aps.multi_button on_item t.FDX.Btn.SelectAll send select_all_not_bad to (oLst(self)) end_object object oBtn2 is a aps.multi_button on_item t.FDX.Btn.SelectNone send select_none to (oLst(self)) end_object object oBtn3 is a aps.multi_button on_item t.FDX.Btn.SelectInvert send select_invert to (oLst(self)) end_object object oBtn4 is a aps.multi_button on_item t.FDX.Btn.SelectPhys send select_master to (oLst(self)) end_object object oBtn5 is a aps.multi_button on_item t.FDX.Btn.SelectParent send select_parents to (oLst(self)) end_object object oBtn6 is a aps.multi_button on_item t.FDX.Btn.SelectChild send select_children to (oLst(self)) end_object object oBtn7 is a aps.multi_button on_item "Load selection" send load_current_selection.browse to (oLst(self)) end_object object oBtn8 is a aps.multi_button on_item "Save selection" send save_current_selection.browse to (oLst(self)) end_object object oBtn9 is a aps.multi_button on_item "Re-order" send re_order to (oLst(self)) end_object object oBtn10 is a aps.multi_button on_item "Display def." send display_file_things to (oLst(self)) end_object send aps_locate_multi_buttons sl_vertical end_object object oBtn1 is a aps.multi_button on_item t.btn.ok send close_panel_ok end_object object oBtn2 is a aps.multi_button on_item t.btn.cancel send close_panel end_object send aps_locate_multi_buttons procedure aps_onResize integer delta_rw# integer delta_cl# send aps_resize (oLst(oCont(self))) delta_rw# 0 send aps_align_by_moving (oSelectTxt(oCont(self))) (oLst(oCont(self))) SL_ALIGN_BOTTOM send aps_resize (oCont(self)) delta_rw# 0 send aps_register_multi_button (oBtn1(self)) send aps_register_multi_button (oBtn2(self)) send aps_locate_multi_buttons send aps_auto_size_container end_procedure function iRun.s string title# returns integer local integer rval# lst# srv# fdx# set piResult to false set label to title# move (oLst(oCont(self))) to lst# if (piNeedsFilling(lst#)) begin send fill_list_all_files to lst# set piNeedsFilling of lst# to false end set piFDX_Server of lst# to fdx# set object_shadow_state of (oBtn5(oCont(self))) to (not(fdx#)) set object_shadow_state of (oBtn6(oCont(self))) to (not(fdx#)) send popup function_return (piResult(self)) end_function function iCallback_Selected_Files integer get# integer obj# returns integer local integer rval# get iCallback_Selected_Files_Server of (oLst(self)) get# obj# to rval# function_return rval# end_function end_object // oUserModalSelectTables #ELSE /Fdx4.hdr ษอ______________________________________________________________________ออป บ บ /Fdx4.btn1 บ ___ ______________________________ _______________ _______________ บ /Fdx4.lst บ ___ __. ______________________________ _______________ _______________ บ บ ___ __. ______________________________ _______________ _______________ บ บ ___ __. ______________________________ _______________ _______________ บ บ ___ __. ______________________________ _______________ _______________ บ บ ___ __. ______________________________ _______________ _______________ บ บ ___ __. ______________________________ _______________ _______________ บ บ ___ __. ______________________________ _______________ _______________ บ /Fdx4.frm บ ฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤฤ บ บ Files selected: ___ of ___ บ บ บ /Fdx4.btn2 บ ________________ ________________ ________________ ________________ บ บ ________________ ________________ ________________ ________________ บ บ ________________ ________________ ________________ ________________ บ ศอออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออผ /* register_object oLst object oUserModalSelectTables is a app.ModalClient Fdx4.hdr set attach_parent_state to true set location to 4 2 absolute set scope_state to true set window_color item 0 to 2 on_key ksave_record send ok on_key kcancel send cancel procedure set caption_text string str# set value item 0 to (str#+"ออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออออ") end_procedure object oBtn1 is a Button Fdx4.btn1 set location to 2 0 relative set focus_mode to pointer_only item_list on_item "" send re_order on_item "" send re_order on_item "" send re_order on_item "" send re_order set window_color to 0 2 set window_color to 1 2 set window_color to 2 2 set window_color to 3 2 end_item_list procedure DoHeaderLabels integer by# move (by#-1) to by# set value item 0 to "#" set value item 1 to "Display name" set value item 2 to "DF name" set value item 3 to "Root name" set value item by# to ("*"+value(self,by#)+"*") end_procedure send DoHeaderLabels 1 procedure re_order local integer by# get current_item to by# send DoHeaderLabels (by#+1) send sort.i to (oLst(self)) (by#+1) end_procedure end_object object oLst is a cFdxFileMultiSelector Fdx4.lst set location to 3 0 relative set piBad_Entries_State to BAD_ENTRIES_SHADOW // Shade un-available entries set piGeneric_Display_Name_State to true on_key key_ctrl+key_r send re_order on_key key_ctrl+key_a send select_all_not_bad on_key kenter send ok property integer piNeedsFilling public 1 procedure re_order local integer by# get Current_Column to by# if by# begin send DoHeaderLabels to (oBtn1(self)) by# send sort.i by# send highlight_current_row end end_procedure procedure fill_list_all_files forward send fill_list_all_files send highlight_current_row end_procedure procedure update_select_display // This is called automatically by the class local integer selected# total# get File_Select_Count to selected# get Row_Count to total# send select_display selected# total# end_procedure end_object // oLst object oFrm is a Form Fdx4.frm set location to 10 0 relative set focus_mode to pointer_only item_list on_item "" send none on_item "" send none end_item_list end_object // oFrm procedure select_display integer selected# integer total# set value of (oFrm(self)) item 0 to selected# set value of (oFrm(self)) item 1 to total# end_procedure procedure select_all_not_bad send select_all_not_bad to (oLst(self)) end_procedure on_key key_ctrl+key_a send select_all_not_bad object oBtn2 is a app.Button Fdx4.btn2 set location to 13 0 relative item_list on_item t.FDX.Btn.SelectAll send select_all_not_bad to (oLst(self)) on_item t.FDX.Btn.SelectNone send select_none to (oLst(self)) on_item t.FDX.Btn.SelectInvert send select_invert to (oLst(self)) on_item t.FDX.Btn.SelectPhys send select_master to (oLst(self)) on_item t.FDX.Btn.SelectParent send select_parents to (oLst(self)) on_item t.FDX.Btn.SelectChild send select_children to (oLst(self)) on_item "Load selection" send load_current_selection.browse to (oLst(self)) on_item "Save selection" send save_current_selection.browse to (oLst(self)) on_item "Re-order" send re_order to (oLst(self)) on_item "Definition" send display_file_things to (oLst(self)) on_item t.btn.ok send ok on_item t.btn.cancel send cancel end_item_list end_object // oBtn2 function iRun.s string title# returns integer local integer rval# lst# srv# fdx# set caption_text to title# move (oLst(self)) to lst# if (piNeedsFilling(lst#)) begin send fill_list_all_files to lst# set piNeedsFilling of lst# to false end set piFDX_Server of (oLst(self)) to fdx# set shadow_state of (oBtn2(self)) item 4 to (not(fdx#)) set shadow_state of (oBtn2(self)) item 5 to (not(fdx#)) ui_accept self to rval# function_return (rval#=msg_ok) end_function function iCallback_Selected_Files integer get# integer obj# returns integer local integer rval# get iCallback_Selected_Files_Server of (oLst(self)) get# obj# to rval# function_return rval# end_function end_object // oUserModalSelectTables #ENDIF procedure UserModalSelectTablesSetup global ; integer oFDX ; integer BES_State# ; integer No_Alias_State# ; integer Driver_Filter_State# ; integer Generic_Display_Name_State# local integer obj# fill_list# move 0 to fill_list# #IFDEF IS$WINDOWS move (oLst(oCont(oUserModalSelectTables(self)))) to obj# #ELSE move (oLst(oUserModalSelectTables(self))) to obj# #ENDIF if oFDX ne (piFDX_Server(obj#)) begin set piFDX_Server of obj# to oFDX move 1 to fill_list# end if BES_State# ne (piBad_Entries_State(obj#)) begin set piBad_Entries_State of obj# to BES_State# move 1 to fill_list# end if No_Alias_State# ne (piNo_Alias_State(obj#)) begin set piNo_Alias_State of obj# to No_Alias_State# move 1 to fill_list# end if Driver_Filter_State# ne (piDriverFilter_State(obj#)) begin set piDriverFilter_State of obj# to Driver_Filter_State# move 1 to fill_list# end if Generic_Display_Name_State# ne (piGeneric_Display_Name_State(obj#)) begin set piGeneric_Display_Name_State of obj# to Generic_Display_Name_State# move 1 to fill_list# end if fill_list# set piNeedsFilling of obj# to true end_procedure function iUserModalSelectTables.s global string title# returns integer function_return (iRun.s(oUserModalSelectTables(self),title#)) end_function function iUserModalSelectTables.sCallBack global integer get# integer obj# returns integer function_return (iCallback_Selected_Files(oUserModalSelectTables(self),get#,obj#)) end_function // *** TEST CODE **************************************************************** // send UserModalSelectTablesSetup 0 BAD_ENTRIES_SHADOW dfFalse dfFalse dfFalse // move (iUserModalSelectTables.s("Select tables, please")) to windowindex