// Use MsgBox.utl // obs procedure Use UI // Necessary to define IS$WINDOWS (if windows) Use Language #IF LNG_DEFAULT=LNG_DUTCH #REPLACE t.MsgBox.Question "Vraag" #REPLACE t.MsgBox.Message "Mededeling" #REPLACE t.MsgBox.Yes "Ja" #REPLACE t.MsgBox.No "Nee" #ENDIF #IF LNG_DEFAULT=LNG_SPANISH // 03/10/2002 25/01/2004 Pepe GuimarÆes Moose Software pg@moose-software.com #REPLACE t.MsgBox.Question "Pregunta" #REPLACE t.MsgBox.Message "Mensaje" #REPLACE t.MsgBox.Yes "Si" #REPLACE t.MsgBox.No "No" #ENDIF #IF LNG_DEFAULT=LNG_ENGLISH #REPLACE t.MsgBox.Question "Question" #REPLACE t.MsgBox.Message "Message" #REPLACE t.MsgBox.Yes "Yes" #REPLACE t.MsgBox.No "No" #ENDIF #IF LNG_DEFAULT=LNG_DANISH #REPLACE t.MsgBox.Question "Sp›rgsm†l" #REPLACE t.MsgBox.Message "Besked" #REPLACE t.MsgBox.Yes "Ja" #REPLACE t.MsgBox.No "Nej" #ENDIF #IF LNG_DEFAULT=LNG_SWEDISH #REPLACE t.MsgBox.Question "Fr†ga" #REPLACE t.MsgBox.Message "Meddelande" #REPLACE t.MsgBox.Yes "Ja" #REPLACE t.MsgBox.No "Nej" #ENDIF #IF LNG_DEFAULT=LNG_NORWEGIAN #REPLACE t.MsgBox.Question "Sp›rsm†l" #REPLACE t.MsgBox.Message "Beskjed" #REPLACE t.MsgBox.Yes "Ja" #REPLACE t.MsgBox.No "Nei" #ENDIF #IF LNG_DEFAULT=LNG_GERMAN #REPLACE t.MsgBox.Question "Frage" #REPLACE t.MsgBox.Message "Nachricht" #REPLACE t.MsgBox.Yes "Ja" #REPLACE t.MsgBox.No "Nein" #ENDIF #IF LNG_DEFAULT=LNG_PORTUGUESE #REPLACE t.MsgBox.Question "QuestÆo" #REPLACE t.MsgBox.Message "Mensagem" #REPLACE t.MsgBox.Yes "Sim" #REPLACE t.MsgBox.No "NÆo" #ENDIF #If LNG_DEFAULT=LNG_FRENCH #REPLACE t.MsgBox.Question "Question" #REPLACE t.MsgBox.Message "Message" #REPLACE t.MsgBox.Yes "Oui" #REPLACE t.MsgBox.No "Non" #ENDIF #IF LNG_DEFAULT=LNG_ITALIAN // 16/10/2002 Zanni Paolo #REPLACE t.MsgBox.Question "Domanda" #REPLACE t.MsgBox.Message "Messaggio" #REPLACE t.MsgBox.Yes "Si" #REPLACE t.MsgBox.No "No" #ENDIF // ====================================================================== // OBS MESSAGE // ====================================================================== #IFDEF IS$WINDOWS // Visual DataFlex Use MsgBox // DAC class Use Buttons.utl // Button texts #ELSE // DF 3.1x /OBS.Hdr ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» /OBS.Msg º º º____________________________________________________________________º º º /OBS.Btn º ___________ º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ /OBS4.Hdr ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» /OBS4.Lst º º º____________________________________________________________________ º º____________________________________________________________________ º º____________________________________________________________________ º º____________________________________________________________________ º º º /OBS4.Btn º ___________ º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ /* Use App.utl // Character Mode classes use Buttons.utl // Button texts use Strings.nui // String manipulation for VDF and 3.2 // procedure systemx // system // end_procedure object oObs is a app.ModalClient OBS.hdr on_key key_f2 send ok on_key kcancel send ok // on_key kuser send systemx set location to 9 4 absolute set scope_state to true object oMsg is a message OBS.msg set location to 1 0 relative set focus_mode to nonfocusable set center_state item 0 to true end_object object oBtn is a app.Button OBS.btn set location to 4 0 relative set focus_mode to focusable item_list on_item t.btn.ok send ok end_item_list end_object procedure run.s string str# local integer grb# set value of (oMsg(self)) item 0 to str# ui_accept self to grb# end_procedure end_object object oObs4 is a app.ModalClient OBS4.hdr on_key key_f2 send ok on_key kcancel send ok // on_key kuser send systemx set location to 7 4 absolute set scope_state to true object olst is a list OBS4.Lst set location to 1 0 relative on_key kenter send ok procedure fill_list.s string str# local integer itm# max# local string line# move (HowManyItems(str#,character(10))) to max# send delete_data for itm# from 1 to max# move (ExtractItem(str#,character(10),itm#)) to line# send add_item msg_none line# set center_state item (itm#-1) to true loop set focus_mode to (if(max#<5,NONFOCUSABLE,FOCUSABLE)) end_procedure end_object object obtn is a app.Button OBS4.btn set location to 7 0 relative set focus_mode to focusable item_list on_item t.btn.ok send ok end_item_list end_object procedure run.s string str# local integer grb# send fill_list.s to (oLst(self)) str# ui_accept self to grb# end_procedure end_object #ENDIF procedure obs global string str# local integer iArg max# self# focus# local string msg# line# move "" to msg# for iArg from 1 to num_arguments MoveStr iArg& to line# // tricky way to parse passed arguments move (msg#+line#) to msg# if iArg ne num_arguments move (msg#+character(10)) to msg# loop #IFDEF IS$WINDOWS move self to self# get focus of desktop to focus# // #IFDEF IS$NEW$FMAC // VDF 6 or higher // #ELSE if focus# gt desktop move focus# to self // #ENDIF send info_box msg# t.MsgBox.Message move self# to self #ELSE move (HowManyItems(msg#,character(10))) to max# if max# le 1 send run.s to (oObs(self)) msg# else send run.s to (oObs4(self)) msg# #ENDIF end_procedure // ====================================================================== // CONFIRM LIST // ====================================================================== #IFDEF IS$WINDOWS use APS object oConfirm_List is a aps.ModalPanel set locate_mode to center_on_screen property integer pResult public 0 on_key kcancel send close_panel_ok object lbl is a aps.textbox end_object send aps_goto_max_row object lst is a aps.list no_image set size to 105 150 set select_mode to no_select end_object procedure close_panel_ok set pResult to 1 send close_panel end_procedure object btn1 is a aps.Multi_Button on_item t.btn.ok send close_panel_ok end_object object btn2 is a aps.Multi_Button on_item t.btn.cancel send close_panel end_object send aps_locate_multi_buttons procedure delete_data send delete_data to (lst(self)) end_procedure procedure run.ss string title# string header# local integer grb# set label to title# set value of (lbl(self)) to header# send popup send delete_data end_procedure function irun.ss string title# string header# returns integer local integer rval# set label to title# set value of (lbl(self)) to header# set pResult to 0 send popup get pResult to rval# send delete_data function_return rval# end_function end_object #ELSE /Confirm_List.hdr ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º____________________________________________________________º º____________________________________________________________º ºÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĺ /Confirm_List.lst º _________________________________________________________ º º _________________________________________________________ º º _________________________________________________________ º º _________________________________________________________ º º _________________________________________________________ º º _________________________________________________________ º º _________________________________________________________ º º _________________________________________________________ º º º /Confirm_List.btn º _____________ _____________ º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ /* object oConfirm_List is a app.ModalClient Confirm_List.hdr set location to 4 9 absolute set center_state item 0 to true set center_state item 1 to true on_key ksave_record send ok on_key kcancel send cancel object lst is a list Confirm_List.lst set location to 4 0 relative end_object object btn is a app.Button Confirm_List.btn set location to 13 0 relative set focus_mode to focusable item_list on_item t.btn.ok send ok on_item t.btn.cancel send cancel end_item_list end_object procedure delete_data send delete_data to (lst(self)) end_procedure procedure run.ss string title# string header# local integer grb# set value item 0 to title# set shadow_state of (btn(self)) item 1 to true set value item 1 to header# ui_accept self to grb# send delete_data end_procedure function irun.ss string title# string header# returns integer local integer rval# set value item 0 to title# set shadow_state of (btn(self)) item 1 to false set value item 1 to header# ui_accept self to rval# send delete_data function_return (rval#=msg_ok) end_function end_object #ENDIF procedure Confirm_List_Reset send delete_data to (oConfirm_List(self)) end_procedure procedure Confirm_List_Add string str# local integer obj# move (lst(oConfirm_List(self))) to obj# send add_item to obj# msg_none str# end_procedure procedure Confirm_List_Go string title# string header# send run.ss to (oConfirm_List(self)) title# header# end_procedure function Confirm_List_Confirm global string title# string header# returns integer function_return (irun.ss(oConfirm_List(self),title#,header#)) end_function // ====================================================================== // YES/NO OBJECT // ====================================================================== #IFDEF IS$WINDOWS #ELSE /MsgBox.hdr ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º______________________________________________º ºÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĺ /MsgBox.btn º º º __________ __________ º º º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ /MsgBox4.hdr ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º º º______________________________________________º º______________________________________________º º______________________________________________º º______________________________________________º /MsgBox4.btn º º º __________ __________ º º º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ /* object oVerify is a app.ModalClient MsgBox.hdr set location to 9 16 absolute set center_state of self item 0 to true object oBtn is a app.Button MsgBox.btn set auto_top_item_state to false set location to 3 0 relative on_key kcancel send none item_list on_item t.MsgBox.yes send ok on_item t.MsgBox.no send cancel end_item_list end_object function iRun.si string str# integer def# returns integer local integer rval# set value item 0 to str# set current_item of (oBtn(self)) to (not(def#)) ui_accept self object to rval# function_return rval# end_function end_object object oVerify4 is a app.ModalClient MsgBox4.hdr set location to 7 16 absolute set center_state of self item 0 to true set center_state of self item 1 to true set center_state of self item 2 to true set center_state of self item 3 to true object oBtn is a app.Button MsgBox4.btn set auto_top_item_state to false set location to 6 0 relative on_key kcancel send none item_list on_item t.MsgBox.yes send ok on_item t.MsgBox.no send cancel end_item_list end_object function iRun.sssssi string str1# string str2# string str3# string str4# integer def# returns integer local integer rval# set value item 0 to str1# set value item 1 to str2# set value item 2 to str3# set value item 3 to str4# set current_item of (oBtn(self)) to (not(def#)) ui_accept self object to rval# function_return rval# end_function end_object #ENDIF function MB_Verify global string str# integer def# returns integer #IFDEF IS$WINDOWS local integer rval# if def# move MB_DEFBUTTON1 to def# else move MB_DEFBUTTON2 to def# move (yesno_box(str#,t.MsgBox.Question,def#)) to rval# function_return (rval#=mbr_yes) #ELSE function_return (iRun.si(oVerify(self),str#,def#)=msg_ok) #ENDIF end_function function MB_Verify4 global string str1# string str2# string str3# string str4# integer def# returns integer #IFDEF IS$WINDOWS local string lf# move (character(10)) to lf# function_return (MB_verify(str1#+lf#+str2#+lf#+str3#+lf#+str4#,def#)) #ELSE function_return (iRun.sssssi(oVerify4(self),str1#,str2#,str3#,str4#,def#)=msg_ok) #ENDIF end_function function MB_CancelOnKeypress global string str# returns integer #IFDEF IS$WINDOWS #ELSE local integer mouse_fix# keycheck [keypress] begin move 0 to mouse_fix# repeat increment mouse_fix# keycheck if mouse_fix# gt 100 indicate keypress false [keypress] loop function_return (MB_verify(str#,0)) end #ENDIF end_function //> Makes sure to catch you in a loop if your finger is on the ENTER key procedure EnterCapturingLoop global while (MB_Verify("Do you want to answer this question again?",1)) end end_procedure