/*:VRX Main */ /* Main */ Main: /* Process the arguments. Get the parent window. */ parse source . calledAs . parent = "" argCount = arg() argOff = 0 if( calledAs \= "COMMAND" )then do if argCount >= 1 then do parent = arg(1) argCount = argCount - 1 argOff = 1 end end; else do call VROptions 'ImplicitNames' call VROptions 'NoEchoQuit' end InitArgs.0 = argCount if( argCount > 0 )then do i = 1 to argCount InitArgs.i = arg( i + argOff ) end drop calledAs argCount argOff /* Load the windows */ call VRInit parse source . . spec _VREPrimaryWindowPath = , VRParseFileName( spec, "dpn" ) || ".VRW" _VREPrimaryWindow = , VRLoad( parent, _VREPrimaryWindowPath ) drop parent spec if( _VREPrimaryWindow == "" )then do call VRMessage "", "Cannot load window:" VRError(), , "Error!" _VREReturnValue = 32000 signal _VRELeaveMain end /* Process events */ call Init signal on halt do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) ) _VREEvent = VREvent() interpret _VREEvent end _VREHalt: _VREReturnValue = Fini() call VRDestroy _VREPrimaryWindow _VRELeaveMain: call VRFini exit _VREReturnValue VRLoadSecondary: __vrlsWait = abbrev( 'WAIT', translate(arg(2)), 1 ) if __vrlsWait then do call VRFlush end __vrlsHWnd = VRLoad( VRWindow(), VRWindowPath(), arg(1) ) if __vrlsHWnd = '' then signal __vrlsDone if __vrlsWait \= 1 then signal __vrlsDone call VRSet __vrlsHWnd, 'WindowMode', 'Modal' __vrlsTmp = __vrlsWindows.0 if( DataType(__vrlsTmp) \= 'NUM' ) then do __vrlsTmp = 1 end else do __vrlsTmp = __vrlsTmp + 1 end __vrlsWindows.__vrlsTmp = VRWindow( __vrlsHWnd ) __vrlsWindows.0 = __vrlsTmp do while( VRIsValidObject( VRWindow() ) = 1 ) __vrlsEvent = VREvent() interpret __vrlsEvent end __vrlsTmp = __vrlsWindows.0 __vrlsWindows.0 = __vrlsTmp - 1 call VRWindow __vrlsWindows.__vrlsTmp __vrlsHWnd = '' __vrlsDone: return __vrlsHWnd /*:VRX __VXREXX____APPENDS__ */ __VXREXX____APPENDS__: /* */ return /*:VRX _AddPackages */ _AddPackages: if NoWPI then return call _ButtonsDisable do while queued() > 0 parse pull Rest end do J = 1 to PackageNr.0 WICEXE' -l "'WPIFIle'" 'PackageNr.J'| rxqueue' Anz = queued() /* say Anz */ if ANz = 2 then leave parse pull Kopf1 parse upper pull Kopf2 if Word(Kopf2,1) = "ORIGSIZE" then NewWarpIN = 1 ; else NewWarpIN = 0 parse pull Kopf3 say "NewWarpIN = "NewWarpIN I = 0 do while queued() > 0 if J = 1 then do I = I + 1 if I = 20 then do ok = VRSet("CN_WPIFiles", "Painting", 0) call VRSet VRWindow(), 'Pointer', '$2' end end parse pull Zeile if pos('summary',Zeile) > 0 then leave /* say PackageNr.J' 'zeile */ if NewWarpIN then do parse var zeile size CompSize Ratio date time file if strip(file) = "" then iterate end else do parse var zeile file size CompSize Ratio Date = "" Time = "" end RecHandle = VRMethod("CN_WPIFiles","AddRecord") ok = VRMethod("CN_WPIFiles","SetfieldData",rechandle,IdFH, PackageNr.J, FileFH, File, SizeFH, Size, CompSizeFH, CompSize, RatioFH, Ratio, DateFH, Date, TimeFH, Time) pckidx = PackageNr.J ok = VRMethod("CN_WPIFiles","SetfieldData",rechandle,VendorFH,vendor.pckidx, appFH, application.pckidx, packnamefh, packname.pckidx, versionfh, version.pckidx) end do while queued() > 0 parse pull Rest end end ok = VRSet("CN_WPIFiles", "Painting", 1) call VRSet VRWindow(), 'Pointer', '' do while queued() > 0 parse pull Rest end call _ButtonsEnable return /*:VRX _ButtonsCenter */ _ButtonsCenter: ButtonDist= 980 ButtonNr = 5 ButtonPos = format(max((VRget("Main","Width")-20-ButtonDist*ButtonNr)/2,0),,0) ok = VRSEt("PB_Load","Left",ButtonPos+ButtonDist*(ButtonNr-5)) ok = VRSEt("PB_Install","Left",ButtonPos+ButtonDist*(ButtonNr-4)) ok = VRSEt("PB_Extract","left",ButtonPos+ButtonDist*(ButtonNr-3)) ok = VRSEt("PB_Help","left",ButtonPos+ButtonDist*(ButtonNr-2)) ok = VRSEt("PB_Cancel","left",ButtonPos+ButtonDist*(ButtonNr-1)) return /*:VRX _ButtonsDisable */ _ButtonsDisable: ok = VRSet("PB_Load", "Enabled", 0) ok = VRSet("PB_Install", "Enabled", 0) ok = VRSet("PB_Extract", "Enabled", 0) ok = VRSet("PB_Cancel", "Enabled", 0) ok = VRSet("PB_Help", "Enabled", 0) return /*:VRX _ButtonsEnable */ _ButtonsEnable: ok = VRSet("PB_Load", "Enabled", 1) ok = VRSet("PB_Install", "Enabled", 1) ok = VRSet("PB_Extract", "Enabled", 1) ok = VRSet("PB_Cancel", "Enabled", 1) ok = VRSet("PB_Help", "Enabled", 1) return /*:VRX _ColumnShow */ _ColumnShow: userdata = VRGet(VRInfo("Object"),"Userdata") parse var userdata Container '|' fieldh '|' VisStatus say userdata ok = VRMethod(Container,"SetFieldAttr", fieldh, "Visible", \VisStatus ) return /*:VRX _ColumnsMenu */ _ColumnsMenu: Container = arg(1) ok = VRMethod(Container, "GetFieldList", "Fields." ) do I = 1 to 12 if I <= fields.0 then do /* say "Columns_"||right("0"||I,2)' 'VRMethod(Container, "GetFieldAttr", fields.I, "Title" ) */ ok = VRset("Columns_"||right("0"||I,2), "Visible", 1) ok = VRset("Columns_"||right("0"||I,2), "Caption", VRMethod(Container, "GetFieldAttr", fields.I, "Title" )) ok = VRset("Columns_"||right("0"||I,2), "Checked", VRMethod(Container, "GetFieldAttr", fields.I, "Visible" )) ok = VRset("Columns_"||right("0"||I,2), "Userdata", Container'|'fields.I'|'VRMethod(Container, "GetFieldAttr", fields.I, "Visible" )) end else ok = VRset("Columns_"||right("0"||I,2), "Visible", 0) end ok = VRMethod( "Columns", "Popup", , , "", "" ) return /*:VRX _ContainerInit */ _ContainerInit: say 'Start _ContainerInit()' IdFH = VRMethod( "CN_WPIfiles", "AddField", "String", "ID" ) FileFH = VRMethod( "CN_WPIfiles", "AddField", "String", "File" ) SizeFH = VRMethod( "CN_WPIfiles", "AddField", "String", "Orig. Size" ) CompSizeFH= VRMethod( "CN_WPIfiles", "AddField", "String", "Comp. Size" ) RatioFH = VRMethod( "CN_WPIfiles", "AddField", "String", "Ratio" ) DateFH = VRMethod( "CN_WPIfiles", "AddField", "String", "Date" ) TimeFH = VRMethod( "CN_WPIfiles", "AddField", "String", "Time" ) VersionFH = VRMethod( "CN_WPIfiles", "AddField", "String", "Version" ) PackNameFH= VRMethod( "CN_WPIfiles", "AddField", "String", "Package" ) AppFH = VRMethod( "CN_WPIfiles", "AddField", "String", "Application" ) VendorFH = VRMethod( "CN_WPIfiles", "AddField", "String", "Vendor" ) ok = VRMethod("CN_WPIfiles","SetfieldAttr",IdFH, "ReadOnly", 1) ok = VRMethod("CN_WPIfiles","SetfieldAttr",FileFH, "ReadOnly", 1) ok = VRMethod("CN_WPIfiles","SetfieldAttr",SizeFH, "ReadOnly", 1) ok = VRMethod("CN_WPIfiles","SetfieldAttr",CompSizeFH, "ReadOnly", 1) ok = VRMethod("CN_WPIfiles","SetfieldAttr",RatioFH, "ReadOnly", 1) ok = VRMethod("CN_WPIfiles","SetfieldAttr",DateFH, "ReadOnly", 1) ok = VRMethod("CN_WPIfiles","SetfieldAttr",TimeFH, "ReadOnly", 1) ok = VRMethod("CN_WPIfiles","SetfieldAttr",VendorFH, "ReadOnly", 1) ok = VRMethod("CN_WPIfiles","SetfieldAttr",AppFH, "ReadOnly", 1) ok = VRMethod("CN_WPIfiles","SetfieldAttr",PackNameFH, "ReadOnly", 1) ok = VRMethod("CN_WPIfiles","SetfieldAttr",VersionFH, "ReadOnly", 1) ok = VRMethod("CN_WPIfiles","SetfieldAttr",SizeFH, "Justification", "Right") ok = VRMethod("CN_WPIfiles","SetfieldAttr",CompSizeFH, "Justification", "Right") ok = VRMethod("CN_WPIfiles","SetfieldAttr",RatioFH,"Justification", "Right") ok = VRMethod("CN_WPIfiles","SetFocus") say 'Done _ContainerInit()' return /*:VRX _DirDialog */ _DirDialog: procedure Title = arg(1) InitDir = arg(2) RC = RxFuncQuery("DRCtrlPickDirectory") if RC = 0 then do /* use DrCtrl if available */ MyDir=DRCtrlPickDirectory(InitDir, Title) end else do MyDir = VRFileDialog(VRWindow,Title, 'o', InitDir||'\dummy') if MyDir <> '' then MyDir = strip(filespec('D',MyDir)||Filespec('P',MyDir),'T','\') end return MyDir /*:VRX _DragDropWPI */ _DragDropWPI: LastWPIFile = WPIFile WPIFile = VRInfo("SourceFile") call _LoadNewArchive return /*:VRX _GarbageAddTo */ _GarbageAddTo: Dummy = Garbage.0 Dummy = Dummy + 1 Garbage.Dummy = arg(1) if pos("%",Garbage.Dummy) > 0 then do GarbageMask = substr(Garbage.Dummy,1,pos("%",Garbage.Dummy)-1)'???.'VRParseFileName(Garbage.Dummy,'E') say 'GarbageMask= 'GarbageMask ok = SysFileTree(GarbageMask,NewGarbage.,'FO') do GarbageAdd = 1 to NewGarbage.0 Dummy = Dummy + 1 Garbage.Dummy = NewGarbage.GarbageAdd end end Garbage.0 = Dummy Drop GarbageAdd drop Dummy return /*:VRX _GarbageRemove */ _GarbageRemove: procedure expose Garbage. if datatype(Garbage.0) <> 'NUM' then return do I = 1 to Garbage.0 ok = SysfileDelete(Garbage.I) end Garbage.0 = 0 return /*:VRX _GetPackages */ _GetPackages: if NoWPI then return say 'Start _GetPackages()' do while queued() > 0 parse pull Rest end WICEXE' -l "'WPIFile'" | rxqueue' PackageNr.0 = 0 I = 0 do while queued() > 0 parse pull Zeile say Zeile if pos('UNABLE', translate(Zeile)) > 0 then do NoWPI = 1 Msg.Text = substr(Zeile, 5) Msg.Type = 'E' call _ShowMsg leave end if word(Zeile,1) = 'Package' then do I = I + 1 PackageNR.I = word(Zeile,2) end end PackageNr.0 = I say 'Done _GetPackages()' return /*:VRX _GetScript */ _GetScript: if NoWPI then return say 'Started _GetScript()' Script = TempDir||VRParseFileName(WPIFile,'N')'.WIS' say script WICEXE' -X "'WPIFile'" "'Script'"' ScriptStr = '' CRLF = '0D0A'x ExternalPackage.0 = 0 packname. = "" vendor. = "" application. = "" version. = "" do while lines(Script) > 0 NextLine = linein(Script) ScriptStr = ScriptStr||NextLine||CRLF /* Analyse */ OrgNextLine = NextLine NextLine =Translate(Nextline) if pos('INDEX',Nextline) > 0 then do parse var Nextline dummy'='pckidx Rest say '1:pckidx = #'pckidx'#' end if pos('PCK INDEX',Nextline) > 0 then do parse var Nextline dummy'='pckidx Rest say '2:pckidx = #'pckidx'#' end if pos('PACKAGEID',Nextline) > 0 then do ok = VRSet("CB_Installable","set",1) parse var OrgNextline 'PACKAGEID="'vendor.pckidx'\'application.pckidx'\'packname.pckidx'\'version.pckidx say 'Vendor:'vendor.pckidx packname.pckidx = strip(translate(packname.pckidx ,'. ','\"')) application.pckidx= strip(translate(application.pckidx ,'. ','\"')) vendor.pckidx = strip(translate(vendor.pckidx ,'. ','\"')) version.pckidx = strip(translate(version.pckidx ,'. ','\"')) end if pos('OS="',Nextline) > 0 then do parse var Nextline dummy'OS="OS2_'Os2Ver'"'Rest ok = VRset("DT_OS2Ver","Caption",left(Os2Ver,1)'.'substr(Os2Ver,2)) end if pos('OS "',Nextline) > 0 then do parse var Nextline dummy'OS="OS2_'Os2Ver'"'Rest ok = VRset("DT_OS2Ver","Caption",left(Os2Ver,1)'.'substr(Os2Ver,2)) end if pos('VERSION="',Nextline) > 0 then do parse var Nextline dummy'VERSION="'Ver'"'Rest Ver = word(Ver,1) ok = VRset("DT_WarpinVer","Caption",Ver) end if pos('VERSION "',Nextline) > 0 then do parse var Nextline dummy'VERSION "'Ver'"'Rest Ver = word(Ver,1) ok = VRset("DT_WarpinVer","Caption",Ver) end if pos('CODEPAGE=',Nextline) > 0 then do parse var Nextline dummy'CODEPAGE='Codepage' 'Rest Codepage= strip(Translate(Codepage,' ','">')) ok = VRset("DT_CodepageVer","Caption",Codepage) end if pos('CODEPAGE="',Nextline) > 0 then do parse var Nextline dummy'CODEPAGE="'Codepage'"'Rest Codepage= strip(Translate(Codepage,' ','">')) ok = VRset("DT_CodepageVer","Caption",Codepage) end if pos('CODEPAGE ',Nextline) > 0 then do parse var Nextline dummy'CODEPAGE 'Codepage' 'Rest ok = VRset("DT_CodepageVer","Caption",Codepage) end if pos('CONFIGSYS=',NextLine) > 0 then do ok = VRSet("CB_ModifiesCONFIGSYS","set",1) end if pos(' 0 then do ok = VRSet("CB_ExecutesREXX","set",1) end if pos('EXECUTE=',NextLine) > 0 then do ok = VRSet("CB_ExecutesCode","set",1) end if pos('PROFILE=',NextLine) > 0 | pos('SYSINI(',NextLine) > 0 then do ok = VRSet("CB_ModifiesINI","set",1) end if pos('EXTERNAL="',NextLine) > 0 then do /* das ist nicht wasserdicht! */ parse var Nextline dummy'EXTERNAL="'ExtPack'"'Rest X = ExternalPackage.0 if Extpack <> ExternalPackage.X then do X = X + 1 ExternalPackage.X = ExtPack ExternalPackage.0 = X end end end if ExternalPackage.0 > 0 then ok = VRSet("Menu_ContextFiles_LoadExternal","Visible",1) do X = 1 to min(ExternalPackage.0, 10) say 'Externalpackage: 'ExternalPackage.X if pos('|',ExternalPackage.X ) > 1 then parse var ExternalPackage.X dummy'|'ExternalPackage.X WPIPath = VRParseFileName(WPIFile,"DP") say 'Externalpackage: 'WPIPath'\'ExternalPackage.X say 'Exist? 'VRFileExists(WPIPath'\'ExternalPackage.X) ok = VRSet("Menu_ExtPack_"||X, "Enabled", VRFileExists(WPIPath'\'ExternalPackage.X)) ok = VRSet("Menu_ExtPack_"||X, "Visible", VRFileExists(WPIPath'\'ExternalPackage.X)) ok = VRSet("Menu_ExtPack_"||X, "Caption", ExternalPackage.X) end ok = stream(Script,'c','close') ok = VRSet("MLE_Script","Value",ScriptStr) ok = VRMethod( "MLE_Script", "SetChanged", 0 ) ok = SysFileDelete(Script) /* if WarpINver > Ver then do ok = VRset("DT_RequiresWarpinVer","BackColor", "red") ok = VRset("DT_WarpinVer","BackColor", "red") end else do ok = VRset("DT_RequiresWarpinVer","BackColor", "") ok = VRset("DT_WarpinVer","BackColor", "") end */ say 'Vendor is still: 'Vendor.1 say 'Done _GetScript()' return /*:VRX _GUIInit */ _GUIInit: say 'Start _GUIInit()' ok = VRset("Main","Helpfile", Helpfile) ok = VRset("Menu_Shell", "Caption", "Shell ("value('COMSPEC',,'OS2ENVIRONMENT')")") if datatype(Top) = 'NUM' then do ok = VRset("Main","Top",Top) ok = VRset("Main","Left",Left) ok = VRset("Main","Width",Width) ok = VRset("Main","Height",Height) end ok = VRSet("Main","Font", Font_Main) ok = VRSet("Main","Statusfont", Font_Status) ok = VRSet("Page_1","Font", Font_Page_1) ok = VRSet("Page_2","Font", Font_Page_2) ok = VRSet("Page_3","Font", Font_Page_3) ok = VRSet("Page_4","Font", Font_Page_4) ok = VRSet("DT_WarpinVer","Hinttext", "You have installed WarpIN Version "WarpinVer) ok = VRSet("CN_WPIFiles", "Font", Font_CN) say 'Font_MLE='Font_MLE ok = VRSet("MLE_Script", "Font", Font_MLE) say 'Jetzt 'VRget("MLE_Script", "Font") ok = VRset("CB_AutoOpenFile","Set",AutoOpenFile) ok = VRset("CB_ReadOnlyMode","Set",ReadOnlyMode) ok = VRset("CB_DeBug","Set",Debug) call CB_Debug_Click ok = VRset("CB_ResetAfterInstall","Set",ResetAfterInstall) ok = VRset("CB_CloseAfterInstall","Set",CloseAfterInstall) ok = VRset("CB_OpenTargetFolderAfterExtraction","Set",OpenTargetFolderAfterExtraction) ok = VRSet("EF_Mask","Value", Mask) ok = VRSet("MLE_Script","Readonly", ReadOnlyMode) ok = VRSet("MLE_Script","Wordwrap", Wordwrap) ok = VRSet("Menu_ContextScript_Wordwrap","Checked", Wordwrap) ok = VRset("Menu_ContextScript_Update","Visible",\ReadOnlyMode) ok = VRset("MItem_13","Visible",\ReadOnlyMode) ok = VRSet("DT_InstWarpinVer","Caption", WarpINVer) call _ButtonsCenter call _ContainerInit call _INILayoutRead "CN_WPIFiles" say 'Done _GUIInit()' return /*:VRX _INILayoutRead */ _INILayoutRead: Container = arg(1) ok = VRMethod(Container, "GetFieldList", "Fields." ) Layout = VRGetIni( "Layout", Container, OurINI ) if Layout = "" then return do I = 1 to Fields.0 say Container' 'fields.I' 'substr(Layout,I,1) ok = VRMethod(Container, "SetFieldAttr", fields.I,"Visible", substr(Layout,I,1)) end return /*:VRX _INILayoutWrite */ _INILayoutWrite: say '_INILayoutWrite' Container = arg(1) ok = VRMethod(Container, "GetFieldList", "Fields." ) Layout = "" do I = 1 to fields.0 Layout = Layout||VRMethod(Container, "GetFieldAttr", fields.I, "Visible" ) end ok = VRSetIni( "Layout", Container , Layout, OurINI, 'NoClose' ) say '_INILayoutWrite done' return /*:VRX _INIRead */ _INIRead: say 'Start _INIRead()' OurINI = strip(VRParseFileName(VRget("Application","Program"),'DP')'\WPIVIEW.INI',,'\') ok = SysFileTree(OurINI, INIFound.,'FO') if INIFound.0 = 1 then OurINI = VRParseFileName(INIFound.1,'DPNE') say 'OurINI='OurINI HelpFIle = VRParseFileName(OurINI,'DPN')'.HLP' say 'HelpFile='HelpFile Top = VRGetIni( "Pos", "Top", OurINI , 'NoClose') Left = VRGetIni( "Pos", "Left", OurINI , 'NoClose') Width = VRGetIni( "Pos", "Width", OurINI , 'NoClose') Height= VRGetIni( "Pos", "Height", OurINI , 'NoClose') Font_Page_1 = VRGetIni( "Fonts", "Page_1", OurINI , 'NoClose' ) Font_Page_2 = VRGetIni( "Fonts", "Page_2", OurINI , 'NoClose' ) Font_Page_3 = VRGetIni( "Fonts", "Page_3", OurINI , 'NoClose' ) Font_Page_4 = VRGetIni( "Fonts", "Page_4", OurINI , 'NoClose' ) Font_Main = VRGetIni( "Fonts", "Main", OurINI , 'NoClose' ) Font_Status = VRGetIni( "Fonts", "Statusfont", OurINI , 'NoClose' ) Font_CN = VRGetIni( "Fonts", "CN_WPIFiles", OurINI , 'NoClose' ) Font_MLE = VRGetIni( "Fonts", "MLE_Script", OurINI , 'NoClose' ) say 'Font_MLE='Font_MLE if Font_MLE = '' |Font_MLE = '' then Font_MLE = '6. System VIO' AutoOpenFile= VRGetINI( "Options","AutoOpenFile", OurINI, 'NoClose') if AutoOpenFile = '' then AutoOpenFile = 1 ReadOnlyMode= VRGetINI( "Options","ReadOnlyMode", OurINI, 'NoClose') if ReadOnlyMode = '' then ReadOnlyMode = 1 Debug = VRGetINI( "Options","Debug", OurINI, 'NoClose') if Debug = '' then Debug = 0 Wordwrap = VRGetINI( "Options","Wordwrap", OurINI, 'NoClose') if Wordwrap = '' then Wordwrap = 0 ResetAfterInstall = VRGetINI( "Options","ResetAfterInstall", OurINI, 'NoClose') if ResetAfterInstall = '' then ResetAfterInstall = 1 CloseAfterInstall = VRGetINI( "Options","CloseAfterInstall", OurINI, 'NoClose') if CloseAfterInstall = '' then CloseAfterInstall = 1 Mask = VRGetINI( "Options","Mask", OurINI, 'NoClose') if Mask = "" then Mask = "*.WPI;*.EXE" OpenTargetFolderAfterExtraction = VRGetINI( "Options","OpenTargetFolderAfterExtraction", OurINI, 'NoClose') if OpenTargetFolderAfterExtraction = '' then OpenTargetFolderAfterExtraction = 0 LastWPIFile = VRGetINI( "Options","LastWPIFile", OurINI) /* Variables */ Garbage.0 = 0 /* if AutoOpenFile = 0 then LastWPIFile = '' */ OldWPIFile = '' History.0 = 0 NoWPI = 0 SearchString = "" say 'Done _INIRead()' return /*:VRX _InitTempDir */ _InitTempDir: say 'Main: _InitTempDir()' /* Get temporary directory */ TempDir = translate(value('TEMP',,'OS2ENVIRONMENT'),'\','/') if TempDir = '' then TempDir = translate(value('TMP',,'OS2ENVIRONMENT'),'\','/') if TempDir = '' then TempDir = translate(value('TMPDIR',,'OS2ENVIRONMENT'),'\','/') if TempDir = '' then TempDir = directory() TempDir = strip(TempDir,'T','\')||'\' ErrorFile = Tempdir'WPIView.error' say 'Main: _InitTempDir() done' return /*:VRX _INIWrite */ _INIWrite: say '_INIWrite' ok = VRSetIni( "Pos", "Top", VRGet("Main","Top"), OurINI, 'NoClose') ok = VRSetIni( "Pos", "Left", VRGet("Main","Left"), OurINI, 'NoClose') ok = VRSetIni( "Pos", "Width", VRGet("Main","Width"), OurINI, 'NoClose') ok = VRSetIni( "Pos", "Height", VRGet("Main","Height"), OurINI, 'NoClose') ok = VRSetIni( "Fonts", "Main", VRGet("Main","Font"), OurINI, 'NoClose' ) ok = VRSetIni( "Fonts", "Statusfont", VRGet("Main","Statusfont"), OurINI, 'NoClose' ) ok = VRSetIni( "Fonts", "CN_WPIFiles",VRGet("CN_WPIFiles","Font"), OurINI, 'NoClose' ) say VRGet("MLE_Script","Font") ok = VRSetIni( "Fonts", "MLE_Script", VRGet("MLE_Script","Font"), OurINI, 'NoClose' ) ok = VRSetIni( "Fonts", "Page_1", VRGet("Page_1","Font"), OurINI, 'NoClose' ) ok = VRSetIni( "Fonts", "Page_2", VRGet("Page_2","Font"), OurINI, 'NoClose' ) ok = VRSetIni( "Fonts", "Page_3", VRGet("Page_3","Font"), OurINI, 'NoClose' ) ok = VRSetIni( "Fonts", "Page_4", VRGet("Page_4","Font"), OurINI, 'NoClose' ) call _INILayoutWrite "CN_WPIFiles" ok = VRsetINI( "Options","AutoOpenFile", VRGet("CB_AutoOpenFile","Set"), OurINI, 'NoClose') ok = VRsetINI( "Options","ResetAfterInstall", VRGet("CB_ResetAfterInstall","Set"), OurINI, 'NoClose') ok = VRsetINI( "Options","CloseAfterInstall", VRGet("CB_CloseAfterInstall","Set"), OurINI, 'NoClose') ok = VRsetINI( "Options","OpenTargetFolderAfterExtraction", VRGet("CB_OpenTargetFolderAfterExtraction","Set"), OurINI, 'NoClose') ok = VRsetINI( "Options","Debug", VRGet("CB_Debug","Set"), OurINI, 'NoClose') ok = VRsetINI( "Options","Wordwrap", VRGet("MLE_Script","Wordwrap"), OurINI, 'NoClose') ok = VRSetINI( "Options","Mask", VRGet("EF_Mask","Value"), OurINI, 'NoClose') if WPIFile <> "" then ok = VRsetINI( "Options","LastWPIFile", WPIFile, OurINI, 'NoClose') ok = VRsetINI( "Options","ReadOnlyMode", VRGet("CB_ReadOnlyMode","Set"), OurINI, ) say '_INIWrite done' return /*:VRX _LoadExternalPackage */ _LoadExternalPackage: ObjID = VRInfo("Object") say VRGet(ObjID, "Caption") LastWPIFile = WPIFile if pos(WPIPath, VRGet(ObjID, "Caption")) > 0 then WPIFIle = VRGet(ObjID, "Caption") else WPIFIle = WPIPath'\'VRGet(ObjID, "Caption") call _LoadNewArchiveContent return /*:VRX _LoadNewArchiveContent */ _LoadNewArchiveContent: say 'Start _LoadNewArchive()' call _UpdateHistory ok = VRset("Menu_ContextFiles_GoBack","Visible",1) if WPIFile <> "" then ok = VRSet("Main","Caption", 'WPIView - 'VRParseFilename(WPIFIle,'NE')) call _Reset call _GetPackages call _GetScript call _AddPackages say 'Done _LoadNewArchive()' return /*:VRX _LoadOtherFuncs */ _LoadOtherFuncs: ok = VRRedirectStdIO('OFF') /* Load RexxUtil */ call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' call SysLoadFuncs /* Deal with DRCtrlxxx */ RC = RxFuncQuery("DRCtrlPickDirectory") if RC = 1 then do /* DRCtrlXXX not already registered */ /* Load DRCtrl functions */ ok = RxFuncAdd('DRCtrlLoadFuncs', 'drctl017', 'DRCtrlLoadFuncs') if ok = 0 then CALL DRCtrlLoadFuncs end /* We need this as early as possible */ Msg.Title = word(VRget("Main","Hinttext"),1) return /*:VRX _MsgYesNo */ _MsgYesNo: buttons.0 = 2 buttons.1 = "~Yes" buttons.2 = "~No" default = 2 buttons.default = "~No" esc = 2 buttons.esc = "~No" RC = VRMessage( VRWindow(), Msg.Text, Msg.Title,"Q","buttons.",default, esc ) say 'Antwort: 'RC return RC /*:VRX _ParseCommandLine */ _ParseCommandLine: WPIFile = strip(VRGet("Application","Commandline"),,'"') WPIFiLE = VRParseFilename(WPIFile,'DPNE') say '##'WPIFile'##' if WPIFile = '' & AutoOpenFile then do LoadDir = VRParseFileName(LastWPIFile,'DP') say 'LoadDir = 'LoadDir WPIFIle = VRFileDialog( VRWindow(), "Choose WPI archive to view", "Open", LoadDir||'\'||Mask, , , ) end if \VRFileExists(WPIFile) & WPIFile <> '' then do Msg.Text = 'Specified archive "'WPIFile'" does not exist!' Msg.Type = 'E' call _ShowMsg WPIFile = "" NoWPI = 1 end if WPIFile <> "" then ok = VRSet("Main","Caption", VRGet("Main","Caption")' - 'VRParseFilename(WPIFIle,'NE')) else NoWPI = 1 return /*:VRX _Reset */ _Reset: ok = VRSet("Main","Caption", 'WPIView') ok = VRMethod( "CN_WPIFiles", "RemoveRecord", "All" ) ok = VRSet("MLE_Script","value","") ok = VRSet("DT_OS2Ver","Caption","any") ok = VRSet("DT_WarpINVer","Caption","any") ok = VRSet("DT_CodePageVer","Caption","any") ok = VRSet("CB_ModifiesCONFIGSYS","set",0) ok = VRSet("CB_ModifiesINI","set",0) ok = VRSet("CB_WPSClasses","set",0) ok = VRSet("CB_ExecutesREXX","set",0) ok = VRSet("CB_ExecutesCode","set",0) ok = VRSet("CB_Installable","set",0) ok = VRSet("Menu_ContextFiles_LoadExternal","Visible",0) do X = 1 to 10 ok = VRSet("Menu_ExtPack_"||X, "Visible", 0) end return /*:VRX _ShowMsg */ _ShowMsg: Buttons.1 = "OK" Buttons.0 = 1 id = VRMessage( VRWindow(), Msg.Text, Msg.Title, Msg.Type, "Buttons.", buttons.1, buttons.1 ) return /*:VRX _UpdateHistory */ _UpdateHistory: if NoWPI | LastWPIFile = '' Then return say 'Started _UpdateHistory()' say 'LastWPIFile='LastWPIFile ok = VRSet("Menu_ContextFiles_History","Visible", 1) AlreadyThere = 0 do I = 1 to History.0 if History.I = LastWPIFile then do AlreadyThere = 1 leave end end if \AlreadyThere then do X = min(1+History.0, 10) ok = VRSet("Menu_History_"||X, "Enabled", 1) ok = VRSet("Menu_History_"||X, "Visible", 1) ok = VRSet("Menu_History_"||X, "Caption", LastWPIFile) History.X = LastWPIFile History.0 = X end say 'Done _UpdateHistory()' return /*:VRX _WICInit */ _WICInit: say 'Start _WICInit()' WarpINPath = strip(VRGetIni( "WarpIN", "Path", "User" ),,'00'x) if WarpINPath = "" then do Msg.Text = "WarpIN not properly installed! Aborting..." Msg.Type = "E" call _ShowMsg call Quit return 0 end WarpINEXE = WarpINPath'\WarpIN.EXE' if \VRFileExists( WarpINEXE ) then do Msg.Text = "WarpIN.EXE is missing! Aborting..." Msg.Type = "E" call _ShowMsg call Quit return 0 end WICEXE = WarpINPath'\WIC.EXE' if \VRFileExists( WICEXE ) then do Msg.Text = "WIC.EXE is missing! Aborting..." Msg.Type = "E" call _ShowMsg call Quit return 0 end /* For people who don't put WARPIN Directory into LIBPATH we must not call WICEXE before this statement */ /* ok = RxSetExtLibPath( VRParseFileName(WICEXE,'DP')';','B' ) */ OldBeginLibPath = strip(SysQueryExtLIBPATH('B'),'T',';')||';' NewBeginLibPath = OldBeginLibPath||WarpInPath';' ok = SysSetExtLIBPATH(NewBeginLibPath, 'B') WICEXE' | rxqueue' parse pull WarpINVer do while queued() > 0 parse pull Rest end WarpINVer = strip(word(WarpInVer,2),,'V') say 'Found WarpIN Version 'WarpINVer /* Old hack */ /* ok = VRCopyFile(VRParseFileName(WICEXE,'DP')'\WPIRTL.DLL',SysBootDrive()'\OS2\DLL\WPIRTL.DLL') */ say 'Done _WICInit()' return 1 /*:VRX Activate */ Activate: parse arg Nr call PushbackAll CurrentPageNr = Nr /* ok = VRSet("PB_"Nr,"Font","9.WarpSans Bold") */ ok = VRSet("TAB_"Nr,"Top", TabTop-8) ok = VRSet("TAB_"Nr,"Left",TabWidth*(Nr-1)+PageLeft) ok = VRSet("TAB_"Nr,"PicturePath", "#1"||Nr||";#1"||Nr) ok = VRset("DT_PageName", "Caption", VRGet("TAB_"Nr, "UserData")) ok = VRSet("Page_"Nr,"Visible", 1) ok = VRSet("PB_help", "HelpTag", VRget("Page_"Nr,"HelpTag")) select when Nr = 1 then ok = VRSet("IPB_paper","PicturePath","#4;#4") when Nr = Pages then ok = VRSet("IPB_paper","PicturePath","#6;#6") otherwise ok = VRSet("IPB_paper","PicturePath","#5;#5") end return /*:VRX CB_AutoOpenFile_Click */ CB_AutoOpenFile_Click: AutoOpenFile = VRGet("CB_AutoOpenFile", "Set") return /*:VRX CB_CloseAfterInstall_Click */ CB_CloseAfterInstall_Click: CloseAfterInstall = VRGet("CB_CloseAfterInstall","set") return /*:VRX CB_Debug_Click */ CB_Debug_Click: if VRGet("CB_Debug","set") then ok = VRRedirectStdIO("ON") else ok = VRRedirectStdIO("OFF") return /*:VRX CB_ExecutesCode_Click */ CB_ExecutesCode_Click: ok = VRSet("CB_ExecutesCode", "Set", \VRGet("CB_ExecutesCode","set")) return /*:VRX CB_ExecutesREXX_Click */ CB_ExecutesREXX_Click: ok = VRSet("CB_ExecutesRexx", "Set", \VRGet("CB_ExecutesRexx","set")) return /*:VRX CB_Installable_Click */ CB_Installable_Click: ok = VRSet("CB_Installable", "Set", \VRGet("CB_Installable","set")) return /*:VRX CB_ModifiesCONFIGSYS_Click */ CB_ModifiesCONFIGSYS_Click: ok = VRSet("CB_ModifiesCONFIGSYS", "Set", \VRGet("CB_ModifiesCONFIGSYS","set")) return /*:VRX CB_ModifiesINI_Click */ CB_ModifiesINI_Click: ok = VRSet("CB_ModifiesINI", "Set", \VRGet("CB_ModifiesINI","set")) return /*:VRX CB_OpenTargetFolderAfterExtraction_Click */ CB_OpenTargetFolderAfterExtraction_Click: CloseAfterInstall = VRGet("CB_CloseAfterInstall","set") return /*:VRX CB_ReadOnlyMode_Click */ CB_ReadOnlyMode_Click: ReadOnlyMode = VRGet("CB_ReadOnlyMode", "Set") if \ReadOnlyMode then do Msg.Type = "W" Msg.Text = "Be careful. By manipulating the installation script you may render the package unusable!" call _ShowMsg end ok = VRset("MLE_Script","Readonly",ReadOnlyMode) ok = VRset("Menu_ContextScript_Update","Visible",\ReadOnlyMode) ok = VRset("MItem_13","Visible",\ReadOnlyMode) return /*:VRX CB_ResetAfterInstall_Click */ CB_ResetAfterInstall_Click: ResetAfterInstall = VRGet("CB_ResetAfterInstall","set") return /*:VRX CB_WPSclasses_Click */ CB_WPSclasses_Click: ok = VRSet("CB_WPSclasses", "Set", \VRGet("CB_WPSclasses","set")) return /*:VRX CN_WPIFiles_ContextMenu */ CN_WPIFiles_ContextMenu: if VRInfo("Top") < 1325 & VRGet("CN_WPIFIles", "View") = "Detail" then call _ColumnsMenu "CN_WPIFiles" else do ok = VRMethod( "Menu_ContextFiles", "Popup") end return /*:VRX CN_WPIFiles_DoubleClick */ CN_WPIFiles_DoubleClick: call Menu_ContextFiles_OpenSelected_Click return /*:VRX CN_WPIFiles_DragDrop */ CN_WPIFiles_DragDrop: call _DragDropWPI return /*:VRX Columns_01_Click */ Columns_01_Click: call _ColumnShow return /*:VRX Columns_02_Click */ Columns_02_Click: call _ColumnShow return /*:VRX Columns_03_Click */ Columns_03_Click: call _ColumnShow return /*:VRX Columns_04_Click */ Columns_04_Click: call _ColumnShow return /*:VRX Columns_05_Click */ Columns_05_Click: call _ColumnShow return /*:VRX Columns_06_Click */ Columns_06_Click: call _ColumnShow return /*:VRX Columns_07_Click */ Columns_07_Click: call _ColumnShow return /*:VRX Columns_08_Click */ Columns_08_Click: call _ColumnShow return /*:VRX Columns_09_Click */ Columns_09_Click: call _ColumnShow return /*:VRX Columns_10_Click */ Columns_10_Click: call _ColumnShow return /*:VRX Columns_11_Click */ Columns_11_Click: call _ColumnShow return /*:VRX Columns_12_Click */ Columns_12_Click: call _ColumnShow return /*:VRX EF_Mask_Change */ EF_Mask_Change: Mask = VRGet("EF_Mask","Value") return /*:VRX Fini */ Fini: window = VRWindow() call VRSet window, "Visible", 0 drop window return 0 /*:VRX GetBootDrive */ GetBootDrive: /* Use SysBootDrive if possible */ If Rxfuncadd('SysBootDrive', 'RexxUtil', 'SysBootDrive') Then Return Left(Value('RUNWORKPLACE',,'OS2ENVIRONMENT'),2) Else Return SysBootDrive() /*:VRX Halt */ Halt: signal _VREHalt return /*:VRX Init */ Init: window = VRWindow() call VRMethod window, "CenterWindow" call VRSet window, "Visible", 0 call VRMethod window, "Activate" drop window return /*:VRX IPB_Paper_Click */ IPB_Paper_Click: if VRInfo("Left") > VRInfo("Top") then call Activate min(CurrentPageNr+1,Pages) if VRInfo("Left") <= VRInfo("Top") then call Activate max(CurrentPageNr-1,1) return /*:VRX Main_Close */ Main_Close: call Quit return /*:VRX Main_Create */ Main_Create: call VRSet VRWindow(), 'Pointer', 'Wait' call _LoadOtherFuncs /* ok = VRMethod("PB_Install","SetFocus") */ call Page1_Create call Page2_Create call Page3_Create call Page4_Create call Page5_Create call Paper_Init call _InitTempdir InitOk = _WICInit() if InitOK then do call _INIRead call _GUIInit call _ParseCommandLine call _GetPackages call _GetScript call _AddPackages ok = VRSet("Main", "Visible", 1) call VRSet VRWindow(), 'Pointer', '' call TAB_1_Click end return /*:VRX Main_DragDrop */ Main_DragDrop: call _DragDropWPI return /*:VRX Main_Resize */ Main_Resize: MainWin = "Main" ok = VRSet(MainWin,"Painting", 0) /* ok = VRset(MainWin,"Visible", 0) */ ok = VRSet(MainWin,"Width",max(VRget(MainWin,"Width"),Pages*TabWidth+300)) ok = VRset("GB_Main","width",VRget(MainWin,"Width")-150) ok = VRset("GB_Main","Height",VRget(MainWin,"Height")-1175-240) ok = VRset("GB_Main2","width",VRget("GB_Main","Width")-260) ok = VRset("GB_Main2","Height",VRget("GB_Main","Height")-275) ok = VRset("GB_VerticalLine","Left",VRget("GB_Main2","Width")-60) ok = VRset("GB_VerticalLine","Height",VRget("GB_Main2","Height")-410) ok = VRset("IPB_Paper","Left",VRget("GB_Main2","width")-420) ok = VRset("GB_HorLineTop","Width",VRget("GB_Main2","width")-440) ok = VRset("GB_HorLineTop","Width",VRget("GB_Main2","width")-440) ok = VRset("GB_LineSubtitle","Width",VRget("GB_Main2","width")-480) do I = 1 to Pages ok = VRSet("Page_"I,"Height", max(PageHeight,VRget("GB_Main2","Height")-600)) ok = VRSet("Page_"I,"Width", max(PageWidth,VRget("GB_Main2","Width")-450)) end ok = VRSet("CB_Installable","Width",VRGet("Page_3","Width")-128) ok = VRSet("CB_ModifiesCONFIGSYS","Width",VRGet("Page_3","Width")-128) ok = VRSet("CB_ModifiesINI","Width",VRGet("Page_3","Width")-128) ok = VRSet("CB_WPSClasses","Width",VRGet("Page_3","Width")-128) ok = VRSet("CB_ExecutesREXX","Width",VRGet("Page_3","Width")-128) ok = VRSet("CB_ExecutesCode","Width",VRGet("Page_3","Width")-128) ok = VRSet("DT_RunsOnOS2Ver","Width",VRGet("Page_3","Width")-1500) ok = VRSet("DT_RequiresWarpINVer","Width",VRGet("Page_3","Width")-1500) ok = VRSet("DT_BuiltForCodePage","Width",VRGet("Page_3","Width")-1500) ok = VRSet("DT_OS2Ver","Left",VRGet("Page_3","Width")-800) ok = VRSet("DT_WarpINVer","Left",VRGet("Page_3","Width")-800) ok = VRSet("DT_InstWarpINVer","Left",VRGet("Page_3","Width")-800) ok = VRSet("DT_CodePageVer","Left",VRGet("Page_3","Width")-800) ok = VRSet("CB_AutoOpenFile","Width",VRGet("Page_4","Width")-128) ok = VRSet("CB_ReadOnlyMode","Width",VRGet("Page_4","Width")-128) ok = VRset("CN_WPIFiles","Width", VRGet("Page_1","Width")-80) ok = VRset("CN_WPIFiles","Height", VRGet("Page_1","Height")-80) ok = VRset("MLE_Script","Width", VRGet("Page_2","Width")-80) ok = VRset("MLE_Script","Height", VRGet("Page_2","Height")-80) ok = VRSEt("PB_Load","top",VRGet("GB_Main","Height")+280) ok = VRSEt("PB_Install","top",VRGet("GB_Main","Height")+280) ok = VRSEt("PB_Extract","top",VRGet("GB_Main","Height")+280) ok = VRSEt("PB_Cancel","top",VRGet("GB_Main","Height")+280) ok = VRSEt("PB_Help","top",VRGet("GB_Main","Height")+280) call _ButtonsCenter /* check and empty event queue, trash spurious resize events */ EventString = '' TrashedResize = 0 do until EventString = 'nop' EventString = VREvent('N') if EventString <> 'nop' then do if EventString = 'CALL 'MainWin'_Resize' then TrashedResize = 1 else interpret eventString end end if TrashedResize then CALL Main_Resize ok = VRSet(MainWin, "Painting", 1) /* ok = VRset(MainWin,"Visible", 1) */ return /*:VRX Menu_ContextFiles_ExtractSelected_Click */ Menu_ContextFiles_ExtractSelected_Click: ok = VRMethod( "CN_WPIFiles", "GetRecordList", "Selected", "Selected." ) if Selected.0 = 0 then return TargetDir = _DirDialog() say TargetDir if TargetDir = '' then return OldDir = directory() ok = directory(TargetDir) do I = 1 to Selected.0 say Selected.I ExtrFile = VRMethod("CN_WPIfiles","getFieldData", Selected.I, FileFH) ExtrPack = VRMethod("CN_WPIfiles","getFieldData", Selected.I, IdFH) WICEXE' "'WPIFile'" -x 'ExtrPack' 'ExtrFile ok = VRMethod("CN_WPIfiles", "SetRecordAttr", Selected.I, "Selected", 0, "Cursored", 0) end ok = directory(OldDir) if VRGet("CB_OpenTargetFolderAfterExtraction","Set") then ok = SysOpenObject(TargetDir,"DEFAULT",1) Msg.Text = 'Selected files from "'WPIFile'" extracted to "'TargetDir'"' Msg.Type = 'I' call _ShowMsg return /*:VRX Menu_ContextFiles_GoBack_Click */ Menu_ContextFiles_GoBack_Click: if LastWPIFile = '' then return Dummy = WPIFile WPIFile = LastWPIFile LastWPIFile = Dummy drop Dummy call _LoadNewArchive return /*:VRX Menu_ContextFiles_LoadArchive_Click */ Menu_ContextFiles_LoadArchive_Click: say 'Start Menu_ContextFiles_LoadArchive_Click' say 'OldWPIFile = 'OldWPIFile say 'WPIFile = 'WPIFile say 'LastWPIFile= 'LastWPIFile NoWPI = 0 OldWPIFile = WPIFile LoadDir = VRParseFileName(WPIFile,'DP') /* War LastWPIFile */ if LoadDir = "" then LoadDir = VRParseFileName(LastWPIFile,'DP') say 'LoadDir = 'LoadDir WPIFIle = VRFileDialog( VRWindow(), "Choose WPI archive to view", "Open", LoadDir||"\"||Mask, , , ) if WPIFile = '' then do WPIFile = OldWPIFile return end LastWPIFile = OldWPIFile call _LoadNewArchiveContent say 'Done Menu_ContextFiles_LoadArchive_Click' return /*:VRX Menu_ContextFiles_OpenSelected_Click */ Menu_ContextFiles_OpenSelected_Click: say 'Start Menu_ContextFiles_OpenSelected_Click()' ok = VRMethod( "CN_WPIFiles", "GetRecordList", "Selected", "Selected." ) if Selected.0 = 0 then return OldDir = directory() ok = directory(strip(TempDir,,'\')) do I = 1 to Selected.0 say Selected.I ExtrFile = VRMethod("CN_WPIfiles","getFieldData", Selected.I, FileFH) ExtrPack = VRMethod("CN_WPIfiles","getFieldData", Selected.I, IdFH) say WICEXE' "'WPIFile'" -x 'ExtrPack' 'ExtrFile WICEXE' "'WPIFile'" -x 'ExtrPack' 'ExtrFile say TempDir||ExtrFile call _GarbageAddTo TempDir||ExtrFile if ReadOnlyMode then do select when pos(translate(VRParseFilename(ExtrFile,'E')),'BAT CMD') > 0 then do 'start E.EXE 'TempDir||ExtrFile end when pos(translate(VRParseFilename(ExtrFile,'E')),'EXE COM') > 0 then do Msg.Type = 'E' Msg.Text = 'You cannot execute binary code in readonly mode!' call _ShowMsg end otherwise ok = SysOpenObject(TempDir||ExtrFile,'DEFAULT','TRUE') end end else ok = SysOpenObject(TempDir||ExtrFile,'DEFAULT','TRUE') end ok = directory(OldDir) say 'Done Menu_ContextFiles_OpenSelected_Click()' return /*:VRX Menu_ContextScript_Copy_Click */ Menu_ContextScript_Copy_Click: SelStr = VRGet("MLE_Script", "SelectedText") ok = VRMethod( "Application", "PutClipboard", SelStr ) return /*:VRX Menu_ContextScript_Find_Click */ Menu_ContextScript_Find_Click: ok = VRMethod("MLE_Script","setFocus") Buttons.1 = "OK" Buttons.2 = "Abort" Buttons.0 = 2 id = VRPrompt("MLE_Script", "Find a string within the script (no wildcards allowed)", "SearchString", "WPIView", "Buttons.", buttons.1, buttons.2 ) ok = VRMethod( "MLE_Script", "Search", SearchString,,, VRGet("MLE_Script","SelectedStart")) if ok = -1 then do Msg.Text = '"'SearchString'" not found!' Msg.Type = 'I' call _ShowMsg end return /*:VRX Menu_ContextScript_FindAgain_Click */ Menu_ContextScript_FindAgain_Click: if SearchString = "" then return ok = VRMethod("MLE_Script","setFocus") ok = VRMethod( "MLE_Script", "Search", SearchString,,, VRGet("MLE_Script","SelectedStart")) if ok = -1 then do Msg.Text = '"'SearchString'" not found!' Msg.Type = 'I' call _ShowMsg end return /*:VRX Menu_ContextScript_Help_Click */ Menu_ContextScript_Help_Click: ok = VRMethod( "Page_2", "InvokeHelp" ) return /*:VRX Menu_ContextScript_SaveScript_Click */ Menu_ContextScript_SaveScript_Click: Script = TempDir||VRParseFileName(WPIFile,'N')'.WIS' say script if ReadOnlyMode then do WICEXE' -X "'WPIFile'" "'Script'"' SaveType = 'Original ' end else do content = VRget("MLE_Script","value") ok = VRCreateFile(Script) call charout Script, Content ok = stream(Script, 'c', 'close') Ok = VRMethod("MLE_Script","QueryChanged" ) if Ok then SaveType = 'Modified ' else SaveType = 'Original ' end TargetScript = VRFileDialog( VRWindow(), "Save script to disk", "Save", VRParseFileName(WPIFile,'DPN')'.WIS', , , ) if TargetScript <> '' then do ok = VRCopyFile(Script,TargetScript) if \ok then do Msg.Text = VRError() Msg.Type ="E" end else do Msg.Text = SaveType'"'TargetScript'" saved successfully!' Msg.Type = "I" end call _ShowMsg end ok = SysFileDelete(Script) return /*:VRX Menu_ContextScript_SelectAll_Click */ Menu_ContextScript_SelectAll_Click: ok = VRset("MLE_Script","SelectedStart", 1) ok = VRset("MLE_Script","SelectedEnd", length(VRGet("MLE_Script","Value"))) return /*:VRX Menu_ContextScript_Update_Click */ Menu_ContextScript_Update_Click: content = VRget("MLE_Script","value") ok = VRCreateFile(Script) call charout Script, Content ok = stream(Script, 'c', 'close') Ok = VRMethod("MLE_Script","QueryChanged" ) if Ok then SaveType = 'Modified ' else SaveType = 'Original ' WICEXE' "'WPIFile'" -s 'Script'| rxqueue' do while queued() > 0 Msg.Type = 'i' parse pull msg.Text if left(Msg.Text,4) = 'wic:' then do Msg.Text = SaveType||substr(Msg.Text,5) call _ShowMsg end end ok = SysFileDelete(Script) return /*:VRX Menu_ContextScript_Validate_Click */ Menu_ContextScript_Validate_Click: do while queued() > 0 parse pull Rest end Script = Tempdir||VRParseFileName(WPIFile,'N')'.WIS' say script if ReadOnlyMode then do WICEXE' -X "'WPIFile'" "'Script'"' SaveType = 'Original ' end else do content = VRget("MLE_Script","value") ok = VRCreateFile(Script) call charout Script, Content ok = stream(Script, 'c', 'close') ok = VRMethod("MLE_Script","QueryChanged" ) if Ok then SaveType = 'Modified ' else SaveType = 'Original ' end WICEXE' -t "'Script'"| rxqueue' do while queued() > 0 Msg.Type = 'i' parse pull msg.Text if left(Msg.Text,4) = 'wic:' then do Msg.Text = SaveType||substr(Msg.Text,5) call _ShowMsg end end return /*:VRX Menu_ContextScript_Wordwrap_Click */ Menu_ContextScript_Wordwrap_Click: ok = VRSet("MLE_Script","WordWrap",\VRGet("MLE_Script","WordWrap")) ok = VRSet("Menu_ContextScript_Wordwrap","Checked",VRGet("MLE_Script","WordWrap")) return /*:VRX Menu_ExtPack_10_Click */ Menu_ExtPack_10_Click: call _LoadExternalPackage return /*:VRX Menu_ExtPack_1_Click */ Menu_ExtPack_1_Click: call _LoadExternalPackage return /*:VRX Menu_ExtPack_2_Click */ Menu_ExtPack_2_Click: call _LoadExternalPackage return /*:VRX Menu_ExtPack_3_Click */ Menu_ExtPack_3_Click: call _LoadExternalPackage return /*:VRX Menu_ExtPack_4_Click */ Menu_ExtPack_4_Click: call _LoadExternalPackage return /*:VRX Menu_ExtPack_5_Click */ Menu_ExtPack_5_Click: call _LoadExternalPackage return /*:VRX Menu_ExtPack_6_Click */ Menu_ExtPack_6_Click: call _LoadExternalPackage return /*:VRX Menu_ExtPack_7_Click */ Menu_ExtPack_7_Click: call _LoadExternalPackage return /*:VRX Menu_ExtPack_8_Click */ Menu_ExtPack_8_Click: call _LoadExternalPackage return /*:VRX Menu_ExtPack_9_Click */ Menu_ExtPack_9_Click: call _LoadExternalPackage return /*:VRX Menu_Help_Click */ Menu_Help_Click: ok = VRMethod( "Page_1", "InvokeHelp" ) return /*:VRX Menu_History_10_Click */ Menu_History_10_Click: call _LoadExternalPackage return /*:VRX Menu_History_1_Click */ Menu_History_1_Click: call _LoadExternalPackage return /*:VRX Menu_History_2_Click */ Menu_History_2_Click: call _LoadExternalPackage return /*:VRX Menu_History_3_Click */ Menu_History_3_Click: call _LoadExternalPackage return /*:VRX Menu_History_4_Click */ Menu_History_4_Click: call _LoadExternalPackage return /*:VRX Menu_History_5_Click */ Menu_History_5_Click: call _LoadExternalPackage return /*:VRX Menu_History_6_Click */ Menu_History_6_Click: call _LoadExternalPackage return /*:VRX Menu_History_7_Click */ Menu_History_7_Click: call _LoadExternalPackage return /*:VRX Menu_History_8_Click */ Menu_History_8_Click: call _LoadExternalPackage return /*:VRX Menu_History_9_Click */ Menu_History_9_Click: call _LoadExternalPackage return /*:VRX Menu_Page_3_Help_Click */ Menu_Page_3_Help_Click: ok = VRMethod( "Page_3", "InvokeHelp" ) return /*:VRX Menu_Page_4_Help_Click */ Menu_Page_4_Help_Click: ok = VRMethod( "Page_4", "InvokeHelp" ) return /*:VRX Menu_Shell_Click */ Menu_Shell_Click: if TargetDir <> '' then do OldDir = directory() ok = directory(TargetDir) end 'start "WPIView Shell ('value('COMSPEC',,'OS2ENVIRONMENT')')" /F' if TargetDir <> '' then ok = directory(OldDir) return /*:VRX MLE_Script_ContextMenu */ MLE_Script_ContextMenu: ok = VRMethod( "Menu_ContextScript", "Popup") return /*:VRX MLE_Script_DragDrop */ MLE_Script_DragDrop: call _DragDropWPI return /*:VRX Page1_Create */ Page1_Create: Return /*:VRX Page1_Init */ Page1_Init: return /*:VRX Page2_Create */ Page2_create: Return /*:VRX Page2_init */ Page2_init: return /*:VRX Page3_Create */ Page3_create: Return /*:VRX Page3_Init */ Page3_Init: return /*:VRX Page4_Create */ Page4_Create: Return /*:VRX Page4_init */ Page4_init: return /*:VRX Page5_Create */ Page5_Create: return /*:VRX Page5_Init */ Page5_Init: return /*:VRX Page_3_ContextMenu */ Page_3_ContextMenu: ok = VRMethod( "Menu_Page_3", "Popup") return /*:VRX Page_3_DragDrop */ Page_3_DragDrop: call _DragDropWPI return /*:VRX Page_4_ContextMenu */ Page_4_ContextMenu: ok = VRset("MLE_Script","Readonly",ReadOnlyMode) ok = VRset("Menu_ContextScript_Update","Visible",\ReadOnlyMode) ok = VRset("MItem_13","Visible",\ReadOnlyMode) ok = VRMethod( "Menu_Page_4", "Popup") return /*:VRX Paper_Init */ Paper_Init: ok = VRSet("IPB_Paper","Width" ,VRMethod( "Screen", "PixelsToTwips", 32 )) ok = VRSet("IPB_Paper","Height",VRMethod( "Screen", "PixelsToTwips", 32 )) ok = VRset("IPB_Paper","Left",VRget("GB_Main2","width")-420) return /*:VRX PB_Cancel_Click */ PB_Cancel_Click: Call Quit return /*:VRX PB_Extract_Click */ PB_Extract_Click: if NoWPI then return if WPIFile = '' then do Msg.Text = "Nothing to extract!" Msg.Type = "E" call _ShowMsg return end TargetDir = _DirDialog() say TargetDir if TargetDir = '' then return OldDir = directory() ok = directory(TargetDir) WICEXE' -x "'WPIFile'"' ok = directory(OldDir) Msg.Text = '"'WPIFile'" extracted to "'TargetDir'"' Msg.Type = 'I' call _ShowMsg return /*:VRX PB_Help_Click */ PB_Help_Click: say 'Started PB_Help_Click' say 'HelpTag = 'VRget("PB_help","HelpTag") ok = VRMethod( "PB_Help", "InvokeHelp" ) say 'Done PB_Help_Click' return /*:VRX PB_Install_Click */ PB_Install_Click: if NoWPI then return if WPIFile = '' then do Msg.Text = "Nothing to install!" Msg.Type = "E" call _ShowMsg return end if translate(VRParseFilename(WPIFile,'E')) = 'EXE' then do 'start "'WPIFile'"' end else do 'start 'WARPINEXE' "'WPIFile'"' end if ResetAfterInstall then do call _Reset NoWPI = 1 end if CloseAfterInstall then do Call Quit end return /*:VRX PB_Load_Click */ PB_Load_Click: call Menu_ContextFiles_LoadArchive_Click return /*:VRX PushbackAll */ PushbackAll: Pages = 4 /* Tab distance from top */ TabTop = 20 TabWidth = VRMethod( "Screen", "PixelsToTwips", 78 ) TabHeight= VRMethod( "Screen", "PixelsToTwips", 24 ) /* Page Position */ PageLeft = 120 PageTop = PageLeft + TabTop + 330 /* Page size */ PageHeight = 3000 PageWidth = 3000 ok = VRset("DT_PageName", "Caption", "") ok = VRSet("GB_Main","Left", 0) ok = VRSet("GB_Main","Top", TabTop+230) do I = 1 to Pages ok = VRSet("TAB_"I,"Top", TabTop) ok = VRSet("TAB_"I,"PicturePath","#2"||I||";#2"||I) ok = VRSet("TAB_"I,"Left",TabWidth*(I-1)+PageLeft) ok = VRSet("TAB_"I,"Width",TabWidth) ok = VRSet("TAB_"I,"Height",TabHeight) ok = VRSet("Page_"I,"Visible", 0) ok = VRSet("Page_"I,"Left", PageLeft) ok = VRSet("Page_"I,"Top", PageTop) ok = VRSet("Page_"I,"Height", max(PageHeight,VRget("GB_Main2","Height")-600)) ok = VRSet("Page_"I,"Width", max(PageWidth,VRget("GB_Main2","Width")-450)) ok = VRSet("Page_"I,"BackColor", "") end return /*:VRX Quit */ Quit: if OurINI <> 'OURINI' then do call _GarbageRemove ok = VRMethod("Main", "Restore") call _INIWrite ok = SysSetExtLIBPATH(OldBeginLibPath, 'B') end window = VRWindow() call VRSet window, "Shutdown", 1 drop window return /*:VRX TAB_1_Click */ TAB_1_Click: call Activate 1 ok = VRset("CN_WPIFiles","Width", VRGet("Page_1","Width")-80) ok = VRset("CN_WPIFiles","Height", VRGet("Page_1","Height")-80) ok = VRMethod("CN_WPIFiles", "Setfocus") return /*:VRX TAB_2_Click */ TAB_2_Click: call Activate 2 ok = VRset("MLE_Script","Width", VRGet("Page_1","Width")-80) ok = VRset("MLE_Script","Height", VRGet("Page_1","Height")-80) ok = VRMethod("MLE_Script","Setfocus") return /*:VRX TAB_3_Click */ TAB_3_Click: call Activate 3 ok = VRMethod("CB_Installable","setfocus") return /*:VRX TAB_4_Click */ TAB_4_Click: call Activate 4 ok = VRMethod("CB_AutoOpenFile","Setfocus") return /*:VRX TAB_5_Click */ TAB_5_Click: call Activate 5 return /*:VRX TM_Allow_Trigger */ TM_Allow_Trigger: if NoWPI | WPIfile = '' then Allow = 0 else Allow = 1 ok = VRset("PB_Install","Enabled", Allow) ok = VRset("PB_Extract","Enabled", Allow) ok = VRset("Menu_ContextFiles_ExtractSelected","Enabled", Allow) ok = VRset("Menu_ContextFiles_OpenSelected","Enabled", Allow) ok = VRset("Menu_ContextScript_Copy","Enabled", Allow) ok = VRset("Menu_ContextScript_FindAgain","Enabled", Allow) ok = VRset("Menu_ContextScript_Find","Enabled", Allow) ok = VRset("Menu_ContextScript_SaveScript","Enabled", Allow) ok = VRset("Menu_ContextScript_Update","Enabled", Allow) ok = VRset("Menu_ContextScript_Validate","Enabled", Allow) return