// Use Conv2000.pkg // UI bricks for reindexing a set of tables Use Conv2000.utl // Make date fields y2000 Use GridUtil.utl // Grid and List utilities #IFDEF IS$WINDOWS object oWaitWhileConv2000 is a StatusPanel set allow_cancel_state to DFFALSE procedure DoCaption string sCaption set Caption_Text to sCaption set Message_Text to "" set Action_Text to "" set Title_Text to "" end_procedure procedure UpdateWait1 string sStr set Message_Text to sStr end_procedure procedure UpdateWait2 string sStr set Action_Text to sStr end_procedure // set piCallbackObj of gloConv2000# to self procedure Start_StatusPanel send DoCaption "Converting tables" forward send Start_StatusPanel end_procedure end_object #ELSE Use Wait.utl // Something to put on screen while batching. object oWaitWhileConv2000 is a cArray procedure UpdateWait1 string sStr send ScreenEndWait_SetText sStr end_procedure procedure UpdateWait2 string sStr send ScreenEndWait_SetText2 sStr end_procedure // set piCallbackObj of gloConv2000# to self procedure Stop_StatusPanel send ScreenEndWait_Off end_procedure procedure Start_StatusPanel send ScreenEndWait_On 0 0 send ScreenEndWait_SetText "" send ScreenEndWait_SetText2 "" end_procedure end_object #ENDIF #IFDEF IS$WINDOWS Use Aps Use RGB.utl // Some color functions class cConv2000List is a aps.Grid #ELSE Use App.utl // Character Mode classes class cConv2000List is a app.List #ENDIF procedure construct_object integer img# forward send construct_object img# property integer piConv2000Object public gloConv2000# // Global integer defined in Conv2000.utl #IFDEF IS$WINDOWS send GridPrepare_AddCheckBoxColumn send GridPrepare_AddColumn "Table" AFT_ASCII40 send GridPrepare_AddColumn "Status" AFT_ASCII40 send GridPrepare_Apply self #ENDIF set select_mode to MULTI_SELECT set highlight_row_state to true on_key KNEXT_ITEM send switch on_key KPREVIOUS_ITEM send switch_back end_procedure #IFDEF IS$WINDOWS procedure select_toggling integer itm# integer i# local integer ci# iColumns get Grid_Columns self to iColumns get current_item to ci# move ((ci#/iColumns)*iColumns) to ci# // Redirect to first column forward send select_toggling ci# i# end_procedure #ENDIF procedure fill_list local integer iObj iRow iMax iBase iStatus local string sStatusText send delete_data set dynamic_update_state to false get piConv2000Object to iObj get row_count of iObj to iMax decrement iMax for iRow from 0 to iMax get item_count to iBase send Grid_AddCheckBoxItem self DFTRUE set aux_value item iBase to iRow send add_item msg_none (psRootName.i(iObj,iRow)) get piStatus.i of iObj iRow to iStatus move (Y2K_TableStatusText(iStatus)) to sStatusText if iStatus eq Y2K_CONVERTED begin // move (sStatusText+" (# dates in # records)") to sStatusText move ("(# dates in # records)") to sStatusText replace "#" in sStatusText with (piAux2.i(iObj,iRow)) to sStatusText replace "#" in sStatusText with (piAux1.i(iObj,iRow)) to sStatusText end send add_item msg_none sStatusText loop send Grid_SetEntryState self DFFALSE set dynamic_update_state to true send update_total (iMax+1) end_procedure procedure update_total integer iItemsInList end_procedure procedure DoConv_Help integer iRow integer iBase send Add_Rootname to (piConv2000Object(self)) (value(self,iBase+1)) end_procedure procedure DoConv local integer iCallBackTmp iConv2000Object get piConv2000Object to iConv2000Object get piCallbackObj of iConv2000Object to iCallBackTmp set piCallbackObj of iConv2000Object to (oWaitWhileConv2000(self)) send Start_StatusPanel to (oWaitWhileConv2000(self)) send reset to iConv2000Object send Grid_RowCallBackSelected self msg_DoConv_Help send DoConv to iConv2000Object send Stop_StatusPanel to (oWaitWhileConv2000(self)) send fill_list set piCallbackObj of iConv2000Object to iCallBackTmp end_procedure procedure Reset send reset to (piConv2000Object(self)) send fill_list end_procedure end_class // cConv2000List