// ********************************************************************** // Use Wait.utl // Something to put on screen while batching. // // By Sture Andersen & Jakob Kruse // // Create: Sat 10-05-1997 - // Update: Fri 03-04-1998 - Top-most-thing added by Jakob Kruse // Wed 03-03-1999 - Procedure batch_on now initalizes all text areas // // *********************************************************************** Use ui #IFDEF IS$WINDOWS Use statpnl Use Strings.nui // String manipulation for VDF and 3.2 #ENDIF Use buttons.utl #IF LNG_DEFAULT=LNG_DUTCH #REPLACE t.Wait.Question "Vraag" #REPLACE t.Wait.Cancel "Operatie afbreken?" #ENDIF #IF LNG_DEFAULT=LNG_SPANISH // 03/10/2002 25/01/2004 Pepe Guimar芿s Moose Software pg@moose-software.com #REPLACE t.Wait.Question "Pregunta" #REPLACE t.Wait.Cancel "–ancelar Operaci?" #ENDIF #IF LNG_DEFAULT=LNG_ENGLISH #REPLACE t.Wait.Question "Question" #REPLACE t.Wait.Cancel "Cancel operation?" #ENDIF #IF LNG_DEFAULT=LNG_DANISH #REPLACE t.Wait.Question "Sp況gsm唋" #REPLACE t.Wait.Cancel "漬sker du at afbryde?" #ENDIF #IF LNG_DEFAULT=LNG_SWEDISH #REPLACE t.Wait.Question "Question" #REPLACE t.Wait.Cancel "Cancel operation?" #ENDIF #IF LNG_DEFAULT=LNG_NORWEGIAN // 22.04.1999 torkild.resheim@emmaedb.no #REPLACE t.Wait.Question "Sp況sm唋" #REPLACE t.Wait.Cancel "Avbryt jobben?" #ENDIF #IF LNG_DEFAULT=LNG_GERMAN #REPLACE t.Wait.Question "Frage" #REPLACE t.Wait.Cancel "Verarbeitung abbrechen?" #ENDIF #IF LNG_DEFAULT=LNG_PORTUGUESE #REPLACE t.Wait.Question "Confirme" #REPLACE t.Wait.Cancel "Cancelar opera嚻o?" #ENDIF #If LNG_DEFAULT=LNG_FRENCH // by Arnaud Mallick (Fr) (Arnaud.mallick@wanadoo.fr) #Replace t.Wait.Question "Question" #Replace t.Wait.Cancel "Annuler op俽ation?" #ENDIF #IF LNG_DEFAULT=LNG_ITALIAN // 16/10/2002 Paolo Zanni CO.AS.CO. #REPLACE t.Wait.Question "Conferma" #REPLACE t.Wait.Cancel "Annulla operazione?" #ENDIF #IFDEF IS$WINDOWS Use cProcessStatusPanel.pkg Class cBatchCompanion is an cProcessStatusPanel procedure construct_object forward send construct_object property string pCancelQuestionCaption public t.Wait.Question property string pCancelQuestion public t.Wait.Cancel set button_text to t.btn.cancel end_procedure // procedure Start_StatusPanel // local handle hwnd# // local integer swp# // local string caption_text# // forward send Start_StatusPanel // get Caption_Text to Caption_Text# // move (StringOemToAnsi(Caption_Text#)) to Caption_Text# // // To make the status_panel stay-on-top, we first find it's window handle ... // move (FindWindow("DFDialogClass",Caption_Text#)) to hwnd# // // ... then we add the extended style WS_EX_TOPMOST to the window, but we use SetWindowPos // // to make sure the change takes effect immediately. // move (SetWindowPos(hwnd#, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE ior SWP_NOSIZE)) to swp# // // To manipulate this object further we could do // // get Object_From_Window hwnd# to realobj# // // and then work with the DFDialog object realobj# // end_procedure procedure batch_on string caption# set caption_text to caption# set title_text to "" set message_text to "" set action_text to "" send Start_StatusPanel end_procedure procedure batch_off send Stop_StatusPanel end_procedure procedure batch_update string str# Set Message_Text to str# end_procedure procedure batch_update2 string str# set Action_Text to str# end_procedure procedure batch_update3 string str# set title_text to str# end_procedure function batch_interrupt returns integer local integer cancel# get Check_StatusPanel to cancel# if cancel# begin send stop_statuspanel move (yesno_box(pCancelQuestion(self),pCancelQuestionCaption(self),MB_DEFBUTTON2)) to cancel# move (cancel#=mbr_yes) to cancel# if cancel# function_return 1 send Start_StatusPanel end end_function end_class // cBatchCompanion procedure ScreenEndWait_On integer min# integer max# end_procedure procedure ScreenEndWait_Update integer pos# end_procedure procedure ScreenEndWait_SetText string str# end_procedure procedure ScreenEndWait_SetText2 string str# end_procedure procedure ScreenEndWait_Off end_procedure #ELSE #REPLACE t.Wait.ThermOff "北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北" #REPLACE t.Wait.ThermOn "圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹" /Cursor_Control.img 谀哪哪哪哪哪哪哪哪哪哪哪 Wait... 滥哪哪哪哪哪哪哪哪哪哪哪 /* object cursor_control is a Message Cursor_Control.img set scope_state to true set location to 7 28 absolute procedure cursor_wait send activate end_procedure procedure cursor_ready send deactivate end_procedure end_object class cWait_Message is a message // thermometer message class procedure construct_object integer img# forward send construct_object img# set scope_state to true property number pCurrent_Position public 0 // counter property integer pItem_Position public -1 // counter item (lines or records) property integer pItem_Thermometer public -1 // thermometer item property integer pThermometer_Length public 0 // length of thermometer field property integer pThermometer_Position public -1 // thermometer position property number pMin_Position public 0 // minimum value property number pMax_Position public 0 // maximum value end_procedure procedure display_init local integer itm# get pItem_Position to itm# // display counter? if itm# ne -1 set value item itm# to (pMin_Position(self)) get pItem_Thermometer to itm# // display thermometer? if itm# ne -1 begin // get length of thermometer field (item) set value item itm# to t.Wait.ThermOff // "北...北" set pThermometer_Length to (length(value(self,itm#))) end set pCurrent_Position to (pMin_Position(self)) end_procedure procedure display_update local integer itm# TPos# local number count# get pCurrent_Position to count# get pItem_Position to itm# // display counter? if itm# ne -1 set value item itm# to count# get pItem_Thermometer to itm# // display thermometer? if itm# ne -1 begin move ((pThermometer_Length(self)*((count#-pMin_Position(self))/(pMax_Position(self)-pMin_Position(self))))+0.5) to TPos# if TPos# ne (pThermometer_Position(self)) begin set pThermometer_Position to TPos# set value item itm# to (overstrike(left(t.Wait.ThermOn,TPos#),value(self,itm#),1)) // "圹...圹" end end end_procedure procedure wait_on integer min# integer max# set pMin_Position to min# set pMax_Position to max# if (min# or max#) send display_init send activate end_procedure procedure wait_update integer count# set pCurrent_Position to count# send display_update end_procedure procedure wait_off send wait_update (pMax_Position(self)) send deactivate end_procedure end_class /ScreenEndWait __________________________________________ __________________________________ /* object oScreenEndWait is a cWait_Message ScreenEndWait set location to screenend 0 set pItem_Thermometer to 1 end_object procedure ScreenEndWait_On integer min# integer max# send wait_on to (oScreenEndWait(self)) min# max# end_procedure procedure ScreenEndWait_Update integer pos# send wait_update to (oScreenEndWait(self)) pos# end_procedure procedure ScreenEndWait_SetText string str# set value of (oScreenEndWait(self)) item 0 to str# end_procedure procedure ScreenEndWait_SetText2 string str# set value of (oScreenEndWait(self)) item 1 to str# end_procedure procedure ScreenEndWait_Off send wait_off to (oScreenEndWait(self)) end_procedure #ENDIF