1 | /*:VRX Main
|
---|
2 | */
|
---|
3 | /* Main
|
---|
4 | */
|
---|
5 | Main:
|
---|
6 | /* Process the arguments.
|
---|
7 | Get the parent window.
|
---|
8 | */
|
---|
9 | parse source . calledAs .
|
---|
10 | parent = ""
|
---|
11 | argCount = arg()
|
---|
12 | argOff = 0
|
---|
13 | if( calledAs \= "COMMAND" )then do
|
---|
14 | if argCount >= 1 then do
|
---|
15 | parent = arg(1)
|
---|
16 | argCount = argCount - 1
|
---|
17 | argOff = 1
|
---|
18 | end
|
---|
19 | end; else do
|
---|
20 | call VROptions 'ImplicitNames'
|
---|
21 | call VROptions 'NoEchoQuit'
|
---|
22 | end
|
---|
23 | InitArgs.0 = argCount
|
---|
24 | if( argCount > 0 )then do i = 1 to argCount
|
---|
25 | InitArgs.i = arg( i + argOff )
|
---|
26 | end
|
---|
27 | drop calledAs argCount argOff
|
---|
28 |
|
---|
29 | /* Load the windows
|
---|
30 | */
|
---|
31 | call VRInit
|
---|
32 | parse source . . spec
|
---|
33 | _VREPrimaryWindowPath = ,
|
---|
34 | VRParseFileName( spec, "dpn" ) || ".VRW"
|
---|
35 | _VREPrimaryWindow = ,
|
---|
36 | VRLoad( parent, _VREPrimaryWindowPath )
|
---|
37 | drop parent spec
|
---|
38 | if( _VREPrimaryWindow == "" )then do
|
---|
39 | call VRMessage "", "Cannot load window:" VRError(), ,
|
---|
40 | "Error!"
|
---|
41 | _VREReturnValue = 32000
|
---|
42 | signal _VRELeaveMain
|
---|
43 | end
|
---|
44 |
|
---|
45 | /* Process events
|
---|
46 | */
|
---|
47 | call Init
|
---|
48 | signal on halt
|
---|
49 | do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )
|
---|
50 | _VREEvent = VREvent()
|
---|
51 | interpret _VREEvent
|
---|
52 | end
|
---|
53 | _VREHalt:
|
---|
54 | _VREReturnValue = Fini()
|
---|
55 | call VRDestroy _VREPrimaryWindow
|
---|
56 | _VRELeaveMain:
|
---|
57 | call VRFini
|
---|
58 | exit _VREReturnValue
|
---|
59 |
|
---|
60 | VRLoadSecondary:
|
---|
61 | __vrlsWait = abbrev( 'WAIT', translate(arg(2)), 1 )
|
---|
62 | if __vrlsWait then do
|
---|
63 | call VRFlush
|
---|
64 | end
|
---|
65 | __vrlsHWnd = VRLoad( VRWindow(), VRWindowPath(), arg(1) )
|
---|
66 | if __vrlsHWnd = '' then signal __vrlsDone
|
---|
67 | if __vrlsWait \= 1 then signal __vrlsDone
|
---|
68 | call VRSet __vrlsHWnd, 'WindowMode', 'Modal'
|
---|
69 | __vrlsTmp = __vrlsWindows.0
|
---|
70 | if( DataType(__vrlsTmp) \= 'NUM' ) then do
|
---|
71 | __vrlsTmp = 1
|
---|
72 | end
|
---|
73 | else do
|
---|
74 | __vrlsTmp = __vrlsTmp + 1
|
---|
75 | end
|
---|
76 | __vrlsWindows.__vrlsTmp = VRWindow( __vrlsHWnd )
|
---|
77 | __vrlsWindows.0 = __vrlsTmp
|
---|
78 | do while( VRIsValidObject( VRWindow() ) = 1 )
|
---|
79 | __vrlsEvent = VREvent()
|
---|
80 | interpret __vrlsEvent
|
---|
81 | end
|
---|
82 | __vrlsTmp = __vrlsWindows.0
|
---|
83 | __vrlsWindows.0 = __vrlsTmp - 1
|
---|
84 | call VRWindow __vrlsWindows.__vrlsTmp
|
---|
85 | __vrlsHWnd = ''
|
---|
86 | __vrlsDone:
|
---|
87 | return __vrlsHWnd
|
---|
88 |
|
---|
89 | /*:VRX __VXREXX____APPENDS__
|
---|
90 | */
|
---|
91 | __VXREXX____APPENDS__:
|
---|
92 | /*
|
---|
93 | */
|
---|
94 | return
|
---|
95 | /*:VRX _AddPackages
|
---|
96 | */
|
---|
97 | _AddPackages:
|
---|
98 | if NoWPI then return
|
---|
99 | call _ButtonsDisable
|
---|
100 | do while queued() > 0
|
---|
101 | parse pull Rest
|
---|
102 | end
|
---|
103 |
|
---|
104 | do J = 1 to PackageNr.0
|
---|
105 | WICEXE' -l "'WPIFIle'" 'PackageNr.J'| rxqueue'
|
---|
106 | Anz = queued()
|
---|
107 | /* say Anz */
|
---|
108 | if ANz = 2 then leave
|
---|
109 |
|
---|
110 | parse pull Kopf1
|
---|
111 | parse upper pull Kopf2
|
---|
112 | if Word(Kopf2,1) = "ORIGSIZE" then NewWarpIN = 1 ; else NewWarpIN = 0
|
---|
113 | parse pull Kopf3
|
---|
114 | say "NewWarpIN = "NewWarpIN
|
---|
115 | I = 0
|
---|
116 | do while queued() > 0
|
---|
117 | if J = 1 then do
|
---|
118 | I = I + 1
|
---|
119 | if I = 20 then do
|
---|
120 | ok = VRSet("CN_WPIFiles", "Painting", 0)
|
---|
121 | call VRSet VRWindow(), 'Pointer', '$2'
|
---|
122 | end
|
---|
123 | end
|
---|
124 | parse pull Zeile
|
---|
125 | if pos('summary',Zeile) > 0 then leave
|
---|
126 | /* say PackageNr.J' 'zeile */
|
---|
127 | if NewWarpIN then do
|
---|
128 | parse var zeile size CompSize Ratio date time file
|
---|
129 | if strip(file) = "" then iterate
|
---|
130 | end
|
---|
131 | else do
|
---|
132 | parse var zeile file size CompSize Ratio
|
---|
133 | Date = ""
|
---|
134 | Time = ""
|
---|
135 | end
|
---|
136 |
|
---|
137 | RecHandle = VRMethod("CN_WPIFiles","AddRecord")
|
---|
138 | ok = VRMethod("CN_WPIFiles","SetfieldData",rechandle,IdFH, PackageNr.J, FileFH, File, SizeFH, Size, CompSizeFH, CompSize, RatioFH, Ratio, DateFH, Date, TimeFH, Time)
|
---|
139 | pckidx = PackageNr.J
|
---|
140 | ok = VRMethod("CN_WPIFiles","SetfieldData",rechandle,VendorFH,vendor.pckidx, appFH, application.pckidx, packnamefh, packname.pckidx, versionfh, version.pckidx)
|
---|
141 | end
|
---|
142 | do while queued() > 0
|
---|
143 | parse pull Rest
|
---|
144 | end
|
---|
145 | end
|
---|
146 |
|
---|
147 | ok = VRSet("CN_WPIFiles", "Painting", 1)
|
---|
148 | call VRSet VRWindow(), 'Pointer', '<default>'
|
---|
149 |
|
---|
150 | do while queued() > 0
|
---|
151 | parse pull Rest
|
---|
152 | end
|
---|
153 | call _ButtonsEnable
|
---|
154 | return
|
---|
155 | /*:VRX _ButtonsCenter
|
---|
156 | */
|
---|
157 | _ButtonsCenter:
|
---|
158 | ButtonDist= 980
|
---|
159 | ButtonNr = 5
|
---|
160 | ButtonPos = format(max((VRget("Main","Width")-20-ButtonDist*ButtonNr)/2,0),,0)
|
---|
161 | ok = VRSEt("PB_Load","Left",ButtonPos+ButtonDist*(ButtonNr-5))
|
---|
162 | ok = VRSEt("PB_Install","Left",ButtonPos+ButtonDist*(ButtonNr-4))
|
---|
163 | ok = VRSEt("PB_Extract","left",ButtonPos+ButtonDist*(ButtonNr-3))
|
---|
164 | ok = VRSEt("PB_Help","left",ButtonPos+ButtonDist*(ButtonNr-2))
|
---|
165 | ok = VRSEt("PB_Cancel","left",ButtonPos+ButtonDist*(ButtonNr-1))
|
---|
166 | return
|
---|
167 |
|
---|
168 | /*:VRX _ButtonsDisable
|
---|
169 | */
|
---|
170 | _ButtonsDisable:
|
---|
171 | ok = VRSet("PB_Load", "Enabled", 0)
|
---|
172 | ok = VRSet("PB_Install", "Enabled", 0)
|
---|
173 | ok = VRSet("PB_Extract", "Enabled", 0)
|
---|
174 | ok = VRSet("PB_Cancel", "Enabled", 0)
|
---|
175 | ok = VRSet("PB_Help", "Enabled", 0)
|
---|
176 | return
|
---|
177 |
|
---|
178 | /*:VRX _ButtonsEnable
|
---|
179 | */
|
---|
180 | _ButtonsEnable:
|
---|
181 | ok = VRSet("PB_Load", "Enabled", 1)
|
---|
182 | ok = VRSet("PB_Install", "Enabled", 1)
|
---|
183 | ok = VRSet("PB_Extract", "Enabled", 1)
|
---|
184 | ok = VRSet("PB_Cancel", "Enabled", 1)
|
---|
185 | ok = VRSet("PB_Help", "Enabled", 1)
|
---|
186 | return
|
---|
187 |
|
---|
188 | /*:VRX _ColumnShow
|
---|
189 | */
|
---|
190 | _ColumnShow:
|
---|
191 | userdata = VRGet(VRInfo("Object"),"Userdata")
|
---|
192 | parse var userdata Container '|' fieldh '|' VisStatus
|
---|
193 | say userdata
|
---|
194 | ok = VRMethod(Container,"SetFieldAttr", fieldh, "Visible", \VisStatus )
|
---|
195 | return
|
---|
196 |
|
---|
197 | /*:VRX _ColumnsMenu
|
---|
198 | */
|
---|
199 | _ColumnsMenu:
|
---|
200 | Container = arg(1)
|
---|
201 | ok = VRMethod(Container, "GetFieldList", "Fields." )
|
---|
202 |
|
---|
203 | do I = 1 to 12
|
---|
204 | if I <= fields.0 then do
|
---|
205 | /* say "Columns_"||right("0"||I,2)' 'VRMethod(Container, "GetFieldAttr", fields.I, "Title" ) */
|
---|
206 | ok = VRset("Columns_"||right("0"||I,2), "Visible", 1)
|
---|
207 | ok = VRset("Columns_"||right("0"||I,2), "Caption", VRMethod(Container, "GetFieldAttr", fields.I, "Title" ))
|
---|
208 | ok = VRset("Columns_"||right("0"||I,2), "Checked", VRMethod(Container, "GetFieldAttr", fields.I, "Visible" ))
|
---|
209 | ok = VRset("Columns_"||right("0"||I,2), "Userdata", Container'|'fields.I'|'VRMethod(Container, "GetFieldAttr", fields.I, "Visible" ))
|
---|
210 | end
|
---|
211 | else ok = VRset("Columns_"||right("0"||I,2), "Visible", 0)
|
---|
212 | end
|
---|
213 | ok = VRMethod( "Columns", "Popup", , , "", "" )
|
---|
214 | return
|
---|
215 |
|
---|
216 | /*:VRX _ContainerInit
|
---|
217 | */
|
---|
218 | _ContainerInit:
|
---|
219 | say 'Start _ContainerInit()'
|
---|
220 | IdFH = VRMethod( "CN_WPIfiles", "AddField", "String", "ID" )
|
---|
221 | FileFH = VRMethod( "CN_WPIfiles", "AddField", "String", "File" )
|
---|
222 | SizeFH = VRMethod( "CN_WPIfiles", "AddField", "String", "Orig. Size" )
|
---|
223 | CompSizeFH= VRMethod( "CN_WPIfiles", "AddField", "String", "Comp. Size" )
|
---|
224 | RatioFH = VRMethod( "CN_WPIfiles", "AddField", "String", "Ratio" )
|
---|
225 | DateFH = VRMethod( "CN_WPIfiles", "AddField", "String", "Date" )
|
---|
226 | TimeFH = VRMethod( "CN_WPIfiles", "AddField", "String", "Time" )
|
---|
227 | VersionFH = VRMethod( "CN_WPIfiles", "AddField", "String", "Version" )
|
---|
228 | PackNameFH= VRMethod( "CN_WPIfiles", "AddField", "String", "Package" )
|
---|
229 | AppFH = VRMethod( "CN_WPIfiles", "AddField", "String", "Application" )
|
---|
230 | VendorFH = VRMethod( "CN_WPIfiles", "AddField", "String", "Vendor" )
|
---|
231 |
|
---|
232 |
|
---|
233 | ok = VRMethod("CN_WPIfiles","SetfieldAttr",IdFH, "ReadOnly", 1)
|
---|
234 | ok = VRMethod("CN_WPIfiles","SetfieldAttr",FileFH, "ReadOnly", 1)
|
---|
235 | ok = VRMethod("CN_WPIfiles","SetfieldAttr",SizeFH, "ReadOnly", 1)
|
---|
236 | ok = VRMethod("CN_WPIfiles","SetfieldAttr",CompSizeFH, "ReadOnly", 1)
|
---|
237 | ok = VRMethod("CN_WPIfiles","SetfieldAttr",RatioFH, "ReadOnly", 1)
|
---|
238 | ok = VRMethod("CN_WPIfiles","SetfieldAttr",DateFH, "ReadOnly", 1)
|
---|
239 | ok = VRMethod("CN_WPIfiles","SetfieldAttr",TimeFH, "ReadOnly", 1)
|
---|
240 | ok = VRMethod("CN_WPIfiles","SetfieldAttr",VendorFH, "ReadOnly", 1)
|
---|
241 | ok = VRMethod("CN_WPIfiles","SetfieldAttr",AppFH, "ReadOnly", 1)
|
---|
242 | ok = VRMethod("CN_WPIfiles","SetfieldAttr",PackNameFH, "ReadOnly", 1)
|
---|
243 | ok = VRMethod("CN_WPIfiles","SetfieldAttr",VersionFH, "ReadOnly", 1)
|
---|
244 |
|
---|
245 | ok = VRMethod("CN_WPIfiles","SetfieldAttr",SizeFH, "Justification", "Right")
|
---|
246 | ok = VRMethod("CN_WPIfiles","SetfieldAttr",CompSizeFH, "Justification", "Right")
|
---|
247 | ok = VRMethod("CN_WPIfiles","SetfieldAttr",RatioFH,"Justification", "Right")
|
---|
248 | ok = VRMethod("CN_WPIfiles","SetFocus")
|
---|
249 | say 'Done _ContainerInit()'
|
---|
250 | return
|
---|
251 |
|
---|
252 | /*:VRX _DirDialog
|
---|
253 | */
|
---|
254 | _DirDialog: procedure
|
---|
255 | Title = arg(1)
|
---|
256 | InitDir = arg(2)
|
---|
257 | RC = RxFuncQuery("DRCtrlPickDirectory")
|
---|
258 | if RC = 0 then do /* use DrCtrl if available */
|
---|
259 | MyDir=DRCtrlPickDirectory(InitDir, Title)
|
---|
260 | end
|
---|
261 | else do
|
---|
262 | MyDir = VRFileDialog(VRWindow,Title, 'o', InitDir||'\dummy')
|
---|
263 | if MyDir <> '' then MyDir = strip(filespec('D',MyDir)||Filespec('P',MyDir),'T','\')
|
---|
264 | end
|
---|
265 | return MyDir
|
---|
266 | /*:VRX _DragDropWPI
|
---|
267 | */
|
---|
268 | _DragDropWPI:
|
---|
269 | LastWPIFile = WPIFile
|
---|
270 | WPIFile = VRInfo("SourceFile")
|
---|
271 | call _LoadNewArchive
|
---|
272 | return
|
---|
273 |
|
---|
274 | /*:VRX _GarbageAddTo
|
---|
275 | */
|
---|
276 | _GarbageAddTo:
|
---|
277 | Dummy = Garbage.0
|
---|
278 | Dummy = Dummy + 1
|
---|
279 | Garbage.Dummy = arg(1)
|
---|
280 | if pos("%",Garbage.Dummy) > 0 then do
|
---|
281 | GarbageMask = substr(Garbage.Dummy,1,pos("%",Garbage.Dummy)-1)'???.'VRParseFileName(Garbage.Dummy,'E')
|
---|
282 | say 'GarbageMask= 'GarbageMask
|
---|
283 | ok = SysFileTree(GarbageMask,NewGarbage.,'FO')
|
---|
284 | do GarbageAdd = 1 to NewGarbage.0
|
---|
285 | Dummy = Dummy + 1
|
---|
286 | Garbage.Dummy = NewGarbage.GarbageAdd
|
---|
287 | end
|
---|
288 | end
|
---|
289 | Garbage.0 = Dummy
|
---|
290 | Drop GarbageAdd
|
---|
291 | drop Dummy
|
---|
292 | return
|
---|
293 |
|
---|
294 | /*:VRX _GarbageRemove
|
---|
295 | */
|
---|
296 | _GarbageRemove: procedure expose Garbage.
|
---|
297 | if datatype(Garbage.0) <> 'NUM' then return
|
---|
298 | do I = 1 to Garbage.0
|
---|
299 | ok = SysfileDelete(Garbage.I)
|
---|
300 | end
|
---|
301 | Garbage.0 = 0
|
---|
302 | return
|
---|
303 |
|
---|
304 | /*:VRX _GetPackages
|
---|
305 | */
|
---|
306 | _GetPackages:
|
---|
307 | if NoWPI then return
|
---|
308 | say 'Start _GetPackages()'
|
---|
309 | do while queued() > 0
|
---|
310 | parse pull Rest
|
---|
311 | end
|
---|
312 |
|
---|
313 | WICEXE' -l "'WPIFile'" | rxqueue'
|
---|
314 |
|
---|
315 | PackageNr.0 = 0
|
---|
316 | I = 0
|
---|
317 | do while queued() > 0
|
---|
318 | parse pull Zeile
|
---|
319 | say Zeile
|
---|
320 | if pos('UNABLE', translate(Zeile)) > 0 then do
|
---|
321 | NoWPI = 1
|
---|
322 | Msg.Text = substr(Zeile, 5)
|
---|
323 | Msg.Type = 'E'
|
---|
324 | call _ShowMsg
|
---|
325 | leave
|
---|
326 | end
|
---|
327 | if word(Zeile,1) = 'Package' then do
|
---|
328 | I = I + 1
|
---|
329 | PackageNR.I = word(Zeile,2)
|
---|
330 | end
|
---|
331 | end
|
---|
332 | PackageNr.0 = I
|
---|
333 | say 'Done _GetPackages()'
|
---|
334 | return
|
---|
335 |
|
---|
336 | /*:VRX _GetScript
|
---|
337 | */
|
---|
338 | _GetScript:
|
---|
339 | if NoWPI then return
|
---|
340 | say 'Started _GetScript()'
|
---|
341 | Script = TempDir||VRParseFileName(WPIFile,'N')'.WIS'
|
---|
342 | say script
|
---|
343 | WICEXE' -X "'WPIFile'" "'Script'"'
|
---|
344 | ScriptStr = ''
|
---|
345 | CRLF = '0D0A'x
|
---|
346 | ExternalPackage.0 = 0
|
---|
347 | packname. = ""
|
---|
348 | vendor. = ""
|
---|
349 | application. = ""
|
---|
350 | version. = ""
|
---|
351 | do while lines(Script) > 0
|
---|
352 | NextLine = linein(Script)
|
---|
353 | ScriptStr = ScriptStr||NextLine||CRLF
|
---|
354 | /* Analyse */
|
---|
355 | OrgNextLine = NextLine
|
---|
356 | NextLine =Translate(Nextline)
|
---|
357 | if pos('INDEX',Nextline) > 0 then do
|
---|
358 | parse var Nextline dummy'='pckidx Rest
|
---|
359 | say '1:pckidx = #'pckidx'#'
|
---|
360 | end
|
---|
361 | if pos('PCK INDEX',Nextline) > 0 then do
|
---|
362 | parse var Nextline dummy'='pckidx Rest
|
---|
363 | say '2:pckidx = #'pckidx'#'
|
---|
364 | end
|
---|
365 | if pos('PACKAGEID',Nextline) > 0 then do
|
---|
366 | ok = VRSet("CB_Installable","set",1)
|
---|
367 | parse var OrgNextline 'PACKAGEID="'vendor.pckidx'\'application.pckidx'\'packname.pckidx'\'version.pckidx
|
---|
368 | say 'Vendor:'vendor.pckidx
|
---|
369 | packname.pckidx = strip(translate(packname.pckidx ,'. ','\"'))
|
---|
370 | application.pckidx= strip(translate(application.pckidx ,'. ','\"'))
|
---|
371 | vendor.pckidx = strip(translate(vendor.pckidx ,'. ','\"'))
|
---|
372 | version.pckidx = strip(translate(version.pckidx ,'. ','\"'))
|
---|
373 | end
|
---|
374 | if pos('OS="',Nextline) > 0 then do
|
---|
375 | parse var Nextline dummy'OS="OS2_'Os2Ver'"'Rest
|
---|
376 | ok = VRset("DT_OS2Ver","Caption",left(Os2Ver,1)'.'substr(Os2Ver,2))
|
---|
377 | end
|
---|
378 | if pos('OS "',Nextline) > 0 then do
|
---|
379 | parse var Nextline dummy'OS="OS2_'Os2Ver'"'Rest
|
---|
380 | ok = VRset("DT_OS2Ver","Caption",left(Os2Ver,1)'.'substr(Os2Ver,2))
|
---|
381 | end
|
---|
382 | if pos('VERSION="',Nextline) > 0 then do
|
---|
383 | parse var Nextline dummy'VERSION="'Ver'"'Rest
|
---|
384 | Ver = word(Ver,1)
|
---|
385 | ok = VRset("DT_WarpinVer","Caption",Ver)
|
---|
386 | end
|
---|
387 | if pos('VERSION "',Nextline) > 0 then do
|
---|
388 | parse var Nextline dummy'VERSION "'Ver'"'Rest
|
---|
389 | Ver = word(Ver,1)
|
---|
390 | ok = VRset("DT_WarpinVer","Caption",Ver)
|
---|
391 | end
|
---|
392 | if pos('CODEPAGE=',Nextline) > 0 then do
|
---|
393 | parse var Nextline dummy'CODEPAGE='Codepage' 'Rest
|
---|
394 | Codepage= strip(Translate(Codepage,' ','">'))
|
---|
395 | ok = VRset("DT_CodepageVer","Caption",Codepage)
|
---|
396 | end
|
---|
397 | if pos('CODEPAGE="',Nextline) > 0 then do
|
---|
398 | parse var Nextline dummy'CODEPAGE="'Codepage'"'Rest
|
---|
399 | Codepage= strip(Translate(Codepage,' ','">'))
|
---|
400 | ok = VRset("DT_CodepageVer","Caption",Codepage)
|
---|
401 | end
|
---|
402 | if pos('CODEPAGE ',Nextline) > 0 then do
|
---|
403 | parse var Nextline dummy'CODEPAGE 'Codepage' 'Rest
|
---|
404 | ok = VRset("DT_CodepageVer","Caption",Codepage)
|
---|
405 | end
|
---|
406 | if pos('CONFIGSYS=',NextLine) > 0 then do
|
---|
407 | ok = VRSet("CB_ModifiesCONFIGSYS","set",1)
|
---|
408 | end
|
---|
409 | if pos('<REXX',Nextline) > 0 then do
|
---|
410 | ok = VRSet("CB_ExecutesREXX","set",1)
|
---|
411 | end
|
---|
412 | if pos('EXECUTE=',NextLine) > 0 then do
|
---|
413 | ok = VRSet("CB_ExecutesCode","set",1)
|
---|
414 | end
|
---|
415 | if pos('PROFILE=',NextLine) > 0 | pos('SYSINI(',NextLine) > 0 then do
|
---|
416 | ok = VRSet("CB_ModifiesINI","set",1)
|
---|
417 | end
|
---|
418 | if pos('EXTERNAL="',NextLine) > 0 then do
|
---|
419 | /* das ist nicht wasserdicht! */
|
---|
420 | parse var Nextline dummy'EXTERNAL="'ExtPack'"'Rest
|
---|
421 | X = ExternalPackage.0
|
---|
422 | if Extpack <> ExternalPackage.X then do
|
---|
423 | X = X + 1
|
---|
424 | ExternalPackage.X = ExtPack
|
---|
425 | ExternalPackage.0 = X
|
---|
426 | end
|
---|
427 | end
|
---|
428 | end
|
---|
429 | if ExternalPackage.0 > 0 then ok = VRSet("Menu_ContextFiles_LoadExternal","Visible",1)
|
---|
430 | do X = 1 to min(ExternalPackage.0, 10)
|
---|
431 | say 'Externalpackage: 'ExternalPackage.X
|
---|
432 | if pos('|',ExternalPackage.X ) > 1 then parse var ExternalPackage.X dummy'|'ExternalPackage.X
|
---|
433 | WPIPath = VRParseFileName(WPIFile,"DP")
|
---|
434 | say 'Externalpackage: 'WPIPath'\'ExternalPackage.X
|
---|
435 | say 'Exist? 'VRFileExists(WPIPath'\'ExternalPackage.X)
|
---|
436 | ok = VRSet("Menu_ExtPack_"||X, "Enabled", VRFileExists(WPIPath'\'ExternalPackage.X))
|
---|
437 | ok = VRSet("Menu_ExtPack_"||X, "Visible", VRFileExists(WPIPath'\'ExternalPackage.X))
|
---|
438 | ok = VRSet("Menu_ExtPack_"||X, "Caption", ExternalPackage.X)
|
---|
439 | end
|
---|
440 | ok = stream(Script,'c','close')
|
---|
441 | ok = VRSet("MLE_Script","Value",ScriptStr)
|
---|
442 | ok = VRMethod( "MLE_Script", "SetChanged", 0 )
|
---|
443 | ok = SysFileDelete(Script)
|
---|
444 |
|
---|
445 | /* if WarpINver > Ver then do
|
---|
446 | ok = VRset("DT_RequiresWarpinVer","BackColor", "red")
|
---|
447 | ok = VRset("DT_WarpinVer","BackColor", "red")
|
---|
448 | end
|
---|
449 | else do
|
---|
450 | ok = VRset("DT_RequiresWarpinVer","BackColor", "<default>")
|
---|
451 | ok = VRset("DT_WarpinVer","BackColor", "<default>")
|
---|
452 | end */
|
---|
453 |
|
---|
454 | say 'Vendor is still: 'Vendor.1
|
---|
455 | say 'Done _GetScript()'
|
---|
456 | return
|
---|
457 |
|
---|
458 | /*:VRX _GUIInit
|
---|
459 | */
|
---|
460 | _GUIInit:
|
---|
461 | say 'Start _GUIInit()'
|
---|
462 | ok = VRset("Main","Helpfile", Helpfile)
|
---|
463 | ok = VRset("Menu_Shell", "Caption", "Shell ("value('COMSPEC',,'OS2ENVIRONMENT')")")
|
---|
464 | if datatype(Top) = 'NUM' then do
|
---|
465 | ok = VRset("Main","Top",Top)
|
---|
466 | ok = VRset("Main","Left",Left)
|
---|
467 | ok = VRset("Main","Width",Width)
|
---|
468 | ok = VRset("Main","Height",Height)
|
---|
469 | end
|
---|
470 | ok = VRSet("Main","Font", Font_Main)
|
---|
471 | ok = VRSet("Main","Statusfont", Font_Status)
|
---|
472 | ok = VRSet("Page_1","Font", Font_Page_1)
|
---|
473 | ok = VRSet("Page_2","Font", Font_Page_2)
|
---|
474 | ok = VRSet("Page_3","Font", Font_Page_3)
|
---|
475 | ok = VRSet("Page_4","Font", Font_Page_4)
|
---|
476 |
|
---|
477 | ok = VRSet("DT_WarpinVer","Hinttext", "You have installed WarpIN Version "WarpinVer)
|
---|
478 |
|
---|
479 | ok = VRSet("CN_WPIFiles", "Font", Font_CN)
|
---|
480 | say 'Font_MLE='Font_MLE
|
---|
481 | ok = VRSet("MLE_Script", "Font", Font_MLE)
|
---|
482 | say 'Jetzt 'VRget("MLE_Script", "Font")
|
---|
483 |
|
---|
484 | ok = VRset("CB_AutoOpenFile","Set",AutoOpenFile)
|
---|
485 | ok = VRset("CB_ReadOnlyMode","Set",ReadOnlyMode)
|
---|
486 | ok = VRset("CB_DeBug","Set",Debug)
|
---|
487 | call CB_Debug_Click
|
---|
488 | ok = VRset("CB_ResetAfterInstall","Set",ResetAfterInstall)
|
---|
489 | ok = VRset("CB_CloseAfterInstall","Set",CloseAfterInstall)
|
---|
490 | ok = VRset("CB_OpenTargetFolderAfterExtraction","Set",OpenTargetFolderAfterExtraction)
|
---|
491 |
|
---|
492 | ok = VRSet("EF_Mask","Value", Mask)
|
---|
493 |
|
---|
494 | ok = VRSet("MLE_Script","Readonly", ReadOnlyMode)
|
---|
495 | ok = VRSet("MLE_Script","Wordwrap", Wordwrap)
|
---|
496 | ok = VRSet("Menu_ContextScript_Wordwrap","Checked", Wordwrap)
|
---|
497 | ok = VRset("Menu_ContextScript_Update","Visible",\ReadOnlyMode)
|
---|
498 | ok = VRset("MItem_13","Visible",\ReadOnlyMode)
|
---|
499 |
|
---|
500 | ok = VRSet("DT_InstWarpinVer","Caption", WarpINVer)
|
---|
501 | call _ButtonsCenter
|
---|
502 | call _ContainerInit
|
---|
503 |
|
---|
504 | call _INILayoutRead "CN_WPIFiles"
|
---|
505 |
|
---|
506 | say 'Done _GUIInit()'
|
---|
507 | return
|
---|
508 |
|
---|
509 | /*:VRX _INILayoutRead
|
---|
510 | */
|
---|
511 | _INILayoutRead:
|
---|
512 | Container = arg(1)
|
---|
513 | ok = VRMethod(Container, "GetFieldList", "Fields." )
|
---|
514 | Layout = VRGetIni( "Layout", Container, OurINI )
|
---|
515 | if Layout = "" then return
|
---|
516 | do I = 1 to Fields.0
|
---|
517 | say Container' 'fields.I' 'substr(Layout,I,1)
|
---|
518 | ok = VRMethod(Container, "SetFieldAttr", fields.I,"Visible", substr(Layout,I,1))
|
---|
519 | end
|
---|
520 | return
|
---|
521 |
|
---|
522 | /*:VRX _INILayoutWrite
|
---|
523 | */
|
---|
524 | _INILayoutWrite:
|
---|
525 | say '_INILayoutWrite'
|
---|
526 | Container = arg(1)
|
---|
527 | ok = VRMethod(Container, "GetFieldList", "Fields." )
|
---|
528 | Layout = ""
|
---|
529 | do I = 1 to fields.0
|
---|
530 | Layout = Layout||VRMethod(Container, "GetFieldAttr", fields.I, "Visible" )
|
---|
531 | end
|
---|
532 | ok = VRSetIni( "Layout", Container , Layout, OurINI, 'NoClose' )
|
---|
533 | say '_INILayoutWrite done'
|
---|
534 | return
|
---|
535 |
|
---|
536 | /*:VRX _INIRead
|
---|
537 | */
|
---|
538 | _INIRead:
|
---|
539 | say 'Start _INIRead()'
|
---|
540 | OurINI = strip(VRParseFileName(VRget("Application","Program"),'DP')'\WPIVIEW.INI',,'\')
|
---|
541 | ok = SysFileTree(OurINI, INIFound.,'FO')
|
---|
542 | if INIFound.0 = 1 then OurINI = VRParseFileName(INIFound.1,'DPNE')
|
---|
543 | say 'OurINI='OurINI
|
---|
544 | HelpFIle = VRParseFileName(OurINI,'DPN')'.HLP'
|
---|
545 | say 'HelpFile='HelpFile
|
---|
546 |
|
---|
547 | Top = VRGetIni( "Pos", "Top", OurINI , 'NoClose')
|
---|
548 | Left = VRGetIni( "Pos", "Left", OurINI , 'NoClose')
|
---|
549 | Width = VRGetIni( "Pos", "Width", OurINI , 'NoClose')
|
---|
550 | Height= VRGetIni( "Pos", "Height", OurINI , 'NoClose')
|
---|
551 |
|
---|
552 | Font_Page_1 = VRGetIni( "Fonts", "Page_1", OurINI , 'NoClose' )
|
---|
553 | Font_Page_2 = VRGetIni( "Fonts", "Page_2", OurINI , 'NoClose' )
|
---|
554 | Font_Page_3 = VRGetIni( "Fonts", "Page_3", OurINI , 'NoClose' )
|
---|
555 | Font_Page_4 = VRGetIni( "Fonts", "Page_4", OurINI , 'NoClose' )
|
---|
556 | Font_Main = VRGetIni( "Fonts", "Main", OurINI , 'NoClose' )
|
---|
557 | Font_Status = VRGetIni( "Fonts", "Statusfont", OurINI , 'NoClose' )
|
---|
558 | Font_CN = VRGetIni( "Fonts", "CN_WPIFiles", OurINI , 'NoClose' )
|
---|
559 | Font_MLE = VRGetIni( "Fonts", "MLE_Script", OurINI , 'NoClose' )
|
---|
560 |
|
---|
561 | say 'Font_MLE='Font_MLE
|
---|
562 | if Font_MLE = '' |Font_MLE = '<default>' then Font_MLE = '6. System VIO'
|
---|
563 |
|
---|
564 | AutoOpenFile= VRGetINI( "Options","AutoOpenFile", OurINI, 'NoClose')
|
---|
565 | if AutoOpenFile = '' then AutoOpenFile = 1
|
---|
566 |
|
---|
567 | ReadOnlyMode= VRGetINI( "Options","ReadOnlyMode", OurINI, 'NoClose')
|
---|
568 | if ReadOnlyMode = '' then ReadOnlyMode = 1
|
---|
569 |
|
---|
570 | Debug = VRGetINI( "Options","Debug", OurINI, 'NoClose')
|
---|
571 | if Debug = '' then Debug = 0
|
---|
572 |
|
---|
573 | Wordwrap = VRGetINI( "Options","Wordwrap", OurINI, 'NoClose')
|
---|
574 | if Wordwrap = '' then Wordwrap = 0
|
---|
575 |
|
---|
576 | ResetAfterInstall = VRGetINI( "Options","ResetAfterInstall", OurINI, 'NoClose')
|
---|
577 | if ResetAfterInstall = '' then ResetAfterInstall = 1
|
---|
578 |
|
---|
579 | CloseAfterInstall = VRGetINI( "Options","CloseAfterInstall", OurINI, 'NoClose')
|
---|
580 | if CloseAfterInstall = '' then CloseAfterInstall = 1
|
---|
581 |
|
---|
582 | Mask = VRGetINI( "Options","Mask", OurINI, 'NoClose')
|
---|
583 | if Mask = "" then Mask = "*.WPI;*.EXE"
|
---|
584 |
|
---|
585 | OpenTargetFolderAfterExtraction = VRGetINI( "Options","OpenTargetFolderAfterExtraction", OurINI, 'NoClose')
|
---|
586 | if OpenTargetFolderAfterExtraction = '' then OpenTargetFolderAfterExtraction = 0
|
---|
587 |
|
---|
588 | LastWPIFile = VRGetINI( "Options","LastWPIFile", OurINI)
|
---|
589 |
|
---|
590 | /* Variables */
|
---|
591 | Garbage.0 = 0
|
---|
592 | /* if AutoOpenFile = 0 then LastWPIFile = '' */
|
---|
593 | OldWPIFile = ''
|
---|
594 | History.0 = 0
|
---|
595 | NoWPI = 0
|
---|
596 | SearchString = ""
|
---|
597 | say 'Done _INIRead()'
|
---|
598 | return
|
---|
599 |
|
---|
600 | /*:VRX _InitTempDir
|
---|
601 | */
|
---|
602 | _InitTempDir:
|
---|
603 | say 'Main: _InitTempDir()'
|
---|
604 | /* Get temporary directory */
|
---|
605 | TempDir = translate(value('TEMP',,'OS2ENVIRONMENT'),'\','/')
|
---|
606 | if TempDir = '' then TempDir = translate(value('TMP',,'OS2ENVIRONMENT'),'\','/')
|
---|
607 | if TempDir = '' then TempDir = translate(value('TMPDIR',,'OS2ENVIRONMENT'),'\','/')
|
---|
608 | if TempDir = '' then TempDir = directory()
|
---|
609 | TempDir = strip(TempDir,'T','\')||'\'
|
---|
610 | ErrorFile = Tempdir'WPIView.error'
|
---|
611 | say 'Main: _InitTempDir() done'
|
---|
612 | return
|
---|
613 |
|
---|
614 |
|
---|
615 | /*:VRX _INIWrite
|
---|
616 | */
|
---|
617 | _INIWrite:
|
---|
618 | say '_INIWrite'
|
---|
619 | ok = VRSetIni( "Pos", "Top", VRGet("Main","Top"), OurINI, 'NoClose')
|
---|
620 | ok = VRSetIni( "Pos", "Left", VRGet("Main","Left"), OurINI, 'NoClose')
|
---|
621 | ok = VRSetIni( "Pos", "Width", VRGet("Main","Width"), OurINI, 'NoClose')
|
---|
622 | ok = VRSetIni( "Pos", "Height", VRGet("Main","Height"), OurINI, 'NoClose')
|
---|
623 |
|
---|
624 | ok = VRSetIni( "Fonts", "Main", VRGet("Main","Font"), OurINI, 'NoClose' )
|
---|
625 | ok = VRSetIni( "Fonts", "Statusfont", VRGet("Main","Statusfont"), OurINI, 'NoClose' )
|
---|
626 |
|
---|
627 | ok = VRSetIni( "Fonts", "CN_WPIFiles",VRGet("CN_WPIFiles","Font"), OurINI, 'NoClose' )
|
---|
628 | say VRGet("MLE_Script","Font")
|
---|
629 | ok = VRSetIni( "Fonts", "MLE_Script", VRGet("MLE_Script","Font"), OurINI, 'NoClose' )
|
---|
630 | ok = VRSetIni( "Fonts", "Page_1", VRGet("Page_1","Font"), OurINI, 'NoClose' )
|
---|
631 | ok = VRSetIni( "Fonts", "Page_2", VRGet("Page_2","Font"), OurINI, 'NoClose' )
|
---|
632 | ok = VRSetIni( "Fonts", "Page_3", VRGet("Page_3","Font"), OurINI, 'NoClose' )
|
---|
633 | ok = VRSetIni( "Fonts", "Page_4", VRGet("Page_4","Font"), OurINI, 'NoClose' )
|
---|
634 |
|
---|
635 | call _INILayoutWrite "CN_WPIFiles"
|
---|
636 |
|
---|
637 | ok = VRsetINI( "Options","AutoOpenFile", VRGet("CB_AutoOpenFile","Set"), OurINI, 'NoClose')
|
---|
638 | ok = VRsetINI( "Options","ResetAfterInstall", VRGet("CB_ResetAfterInstall","Set"), OurINI, 'NoClose')
|
---|
639 | ok = VRsetINI( "Options","CloseAfterInstall", VRGet("CB_CloseAfterInstall","Set"), OurINI, 'NoClose')
|
---|
640 | ok = VRsetINI( "Options","OpenTargetFolderAfterExtraction", VRGet("CB_OpenTargetFolderAfterExtraction","Set"), OurINI, 'NoClose')
|
---|
641 | ok = VRsetINI( "Options","Debug", VRGet("CB_Debug","Set"), OurINI, 'NoClose')
|
---|
642 | ok = VRsetINI( "Options","Wordwrap", VRGet("MLE_Script","Wordwrap"), OurINI, 'NoClose')
|
---|
643 |
|
---|
644 | ok = VRSetINI( "Options","Mask", VRGet("EF_Mask","Value"), OurINI, 'NoClose')
|
---|
645 |
|
---|
646 | if WPIFile <> "" then ok = VRsetINI( "Options","LastWPIFile", WPIFile, OurINI, 'NoClose')
|
---|
647 | ok = VRsetINI( "Options","ReadOnlyMode", VRGet("CB_ReadOnlyMode","Set"), OurINI, )
|
---|
648 | say '_INIWrite done'
|
---|
649 | return
|
---|
650 |
|
---|
651 | /*:VRX _LoadExternalPackage
|
---|
652 | */
|
---|
653 | _LoadExternalPackage:
|
---|
654 | ObjID = VRInfo("Object")
|
---|
655 | say VRGet(ObjID, "Caption")
|
---|
656 | LastWPIFile = WPIFile
|
---|
657 | if pos(WPIPath, VRGet(ObjID, "Caption")) > 0
|
---|
658 | then WPIFIle = VRGet(ObjID, "Caption")
|
---|
659 | else WPIFIle = WPIPath'\'VRGet(ObjID, "Caption")
|
---|
660 |
|
---|
661 | call _LoadNewArchiveContent
|
---|
662 | return
|
---|
663 |
|
---|
664 | /*:VRX _LoadNewArchiveContent
|
---|
665 | */
|
---|
666 | _LoadNewArchiveContent:
|
---|
667 | say 'Start _LoadNewArchive()'
|
---|
668 | call _UpdateHistory
|
---|
669 | ok = VRset("Menu_ContextFiles_GoBack","Visible",1)
|
---|
670 | if WPIFile <> "" then ok = VRSet("Main","Caption", 'WPIView - 'VRParseFilename(WPIFIle,'NE'))
|
---|
671 | call _Reset
|
---|
672 | call _GetPackages
|
---|
673 | call _GetScript
|
---|
674 | call _AddPackages
|
---|
675 | say 'Done _LoadNewArchive()'
|
---|
676 | return
|
---|
677 |
|
---|
678 | /*:VRX _LoadOtherFuncs
|
---|
679 | */
|
---|
680 | _LoadOtherFuncs:
|
---|
681 | ok = VRRedirectStdIO('OFF')
|
---|
682 |
|
---|
683 | /* Load RexxUtil */
|
---|
684 | call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
|
---|
685 | call SysLoadFuncs
|
---|
686 |
|
---|
687 | /* Deal with DRCtrlxxx */
|
---|
688 | RC = RxFuncQuery("DRCtrlPickDirectory")
|
---|
689 | if RC = 1 then do /* DRCtrlXXX not already registered */
|
---|
690 | /* Load DRCtrl functions */
|
---|
691 | ok = RxFuncAdd('DRCtrlLoadFuncs', 'drctl017', 'DRCtrlLoadFuncs')
|
---|
692 | if ok = 0 then CALL DRCtrlLoadFuncs
|
---|
693 | end
|
---|
694 | /* We need this as early as possible */
|
---|
695 | Msg.Title = word(VRget("Main","Hinttext"),1)
|
---|
696 | return
|
---|
697 |
|
---|
698 | /*:VRX _MsgYesNo
|
---|
699 | */
|
---|
700 | _MsgYesNo:
|
---|
701 | buttons.0 = 2
|
---|
702 | buttons.1 = "~Yes"
|
---|
703 | buttons.2 = "~No"
|
---|
704 | default = 2
|
---|
705 | buttons.default = "~No"
|
---|
706 | esc = 2
|
---|
707 | buttons.esc = "~No"
|
---|
708 | RC = VRMessage( VRWindow(), Msg.Text, Msg.Title,"Q","buttons.",default, esc )
|
---|
709 | say 'Antwort: 'RC
|
---|
710 | return RC
|
---|
711 |
|
---|
712 | /*:VRX _ParseCommandLine
|
---|
713 | */
|
---|
714 | _ParseCommandLine:
|
---|
715 | WPIFile = strip(VRGet("Application","Commandline"),,'"')
|
---|
716 |
|
---|
717 | WPIFiLE = VRParseFilename(WPIFile,'DPNE')
|
---|
718 | say '##'WPIFile'##'
|
---|
719 | if WPIFile = '' & AutoOpenFile then do
|
---|
720 | LoadDir = VRParseFileName(LastWPIFile,'DP')
|
---|
721 | say 'LoadDir = 'LoadDir
|
---|
722 | WPIFIle = VRFileDialog( VRWindow(), "Choose WPI archive to view", "Open", LoadDir||'\'||Mask, , , )
|
---|
723 | end
|
---|
724 | if \VRFileExists(WPIFile) & WPIFile <> '' then do
|
---|
725 | Msg.Text = 'Specified archive "'WPIFile'" does not exist!'
|
---|
726 | Msg.Type = 'E'
|
---|
727 | call _ShowMsg
|
---|
728 | WPIFile = ""
|
---|
729 | NoWPI = 1
|
---|
730 | end
|
---|
731 |
|
---|
732 | if WPIFile <> "" then ok = VRSet("Main","Caption", VRGet("Main","Caption")' - 'VRParseFilename(WPIFIle,'NE'))
|
---|
733 | else NoWPI = 1
|
---|
734 | return
|
---|
735 |
|
---|
736 | /*:VRX _Reset
|
---|
737 | */
|
---|
738 | _Reset:
|
---|
739 | ok = VRSet("Main","Caption", 'WPIView')
|
---|
740 | ok = VRMethod( "CN_WPIFiles", "RemoveRecord", "All" )
|
---|
741 | ok = VRSet("MLE_Script","value","")
|
---|
742 |
|
---|
743 | ok = VRSet("DT_OS2Ver","Caption","any")
|
---|
744 | ok = VRSet("DT_WarpINVer","Caption","any")
|
---|
745 | ok = VRSet("DT_CodePageVer","Caption","any")
|
---|
746 | ok = VRSet("CB_ModifiesCONFIGSYS","set",0)
|
---|
747 | ok = VRSet("CB_ModifiesINI","set",0)
|
---|
748 | ok = VRSet("CB_WPSClasses","set",0)
|
---|
749 | ok = VRSet("CB_ExecutesREXX","set",0)
|
---|
750 | ok = VRSet("CB_ExecutesCode","set",0)
|
---|
751 | ok = VRSet("CB_Installable","set",0)
|
---|
752 |
|
---|
753 | ok = VRSet("Menu_ContextFiles_LoadExternal","Visible",0)
|
---|
754 | do X = 1 to 10
|
---|
755 | ok = VRSet("Menu_ExtPack_"||X, "Visible", 0)
|
---|
756 | end
|
---|
757 | return
|
---|
758 |
|
---|
759 | /*:VRX _ShowMsg
|
---|
760 | */
|
---|
761 | _ShowMsg:
|
---|
762 | Buttons.1 = "OK"
|
---|
763 | Buttons.0 = 1
|
---|
764 | id = VRMessage( VRWindow(), Msg.Text, Msg.Title, Msg.Type, "Buttons.", buttons.1, buttons.1 )
|
---|
765 | return
|
---|
766 | /*:VRX _UpdateHistory
|
---|
767 | */
|
---|
768 | _UpdateHistory:
|
---|
769 | if NoWPI | LastWPIFile = '' Then return
|
---|
770 | say 'Started _UpdateHistory()'
|
---|
771 | say 'LastWPIFile='LastWPIFile
|
---|
772 | ok = VRSet("Menu_ContextFiles_History","Visible", 1)
|
---|
773 | AlreadyThere = 0
|
---|
774 | do I = 1 to History.0
|
---|
775 | if History.I = LastWPIFile then do
|
---|
776 | AlreadyThere = 1
|
---|
777 | leave
|
---|
778 | end
|
---|
779 | end
|
---|
780 | if \AlreadyThere then do
|
---|
781 | X = min(1+History.0, 10)
|
---|
782 | ok = VRSet("Menu_History_"||X, "Enabled", 1)
|
---|
783 | ok = VRSet("Menu_History_"||X, "Visible", 1)
|
---|
784 | ok = VRSet("Menu_History_"||X, "Caption", LastWPIFile)
|
---|
785 | History.X = LastWPIFile
|
---|
786 | History.0 = X
|
---|
787 | end
|
---|
788 | say 'Done _UpdateHistory()'
|
---|
789 | return
|
---|
790 |
|
---|
791 | /*:VRX _WICInit
|
---|
792 | */
|
---|
793 | _WICInit:
|
---|
794 | say 'Start _WICInit()'
|
---|
795 | WarpINPath = strip(VRGetIni( "WarpIN", "Path", "User" ),,'00'x)
|
---|
796 | if WarpINPath = "" then do
|
---|
797 | Msg.Text = "WarpIN not properly installed! Aborting..."
|
---|
798 | Msg.Type = "E"
|
---|
799 | call _ShowMsg
|
---|
800 | call Quit
|
---|
801 | return 0
|
---|
802 | end
|
---|
803 | WarpINEXE = WarpINPath'\WarpIN.EXE'
|
---|
804 | if \VRFileExists( WarpINEXE ) then do
|
---|
805 | Msg.Text = "WarpIN.EXE is missing! Aborting..."
|
---|
806 | Msg.Type = "E"
|
---|
807 | call _ShowMsg
|
---|
808 | call Quit
|
---|
809 | return 0
|
---|
810 | end
|
---|
811 |
|
---|
812 | WICEXE = WarpINPath'\WIC.EXE'
|
---|
813 | if \VRFileExists( WICEXE ) then do
|
---|
814 | Msg.Text = "WIC.EXE is missing! Aborting..."
|
---|
815 | Msg.Type = "E"
|
---|
816 | call _ShowMsg
|
---|
817 | call Quit
|
---|
818 | return 0
|
---|
819 | end
|
---|
820 |
|
---|
821 | /* For people who don't put WARPIN Directory into LIBPATH
|
---|
822 | we must not call WICEXE before this statement */
|
---|
823 | /* ok = RxSetExtLibPath( VRParseFileName(WICEXE,'DP')';','B' ) */
|
---|
824 |
|
---|
825 | OldBeginLibPath = strip(SysQueryExtLIBPATH('B'),'T',';')||';'
|
---|
826 | NewBeginLibPath = OldBeginLibPath||WarpInPath';'
|
---|
827 | ok = SysSetExtLIBPATH(NewBeginLibPath, 'B')
|
---|
828 |
|
---|
829 | WICEXE' | rxqueue'
|
---|
830 | parse pull WarpINVer
|
---|
831 | do while queued() > 0
|
---|
832 | parse pull Rest
|
---|
833 | end
|
---|
834 | WarpINVer = strip(word(WarpInVer,2),,'V')
|
---|
835 | say 'Found WarpIN Version 'WarpINVer
|
---|
836 |
|
---|
837 |
|
---|
838 | /* Old hack */
|
---|
839 | /* ok = VRCopyFile(VRParseFileName(WICEXE,'DP')'\WPIRTL.DLL',SysBootDrive()'\OS2\DLL\WPIRTL.DLL') */
|
---|
840 | say 'Done _WICInit()'
|
---|
841 | return 1
|
---|
842 |
|
---|
843 | /*:VRX Activate
|
---|
844 | */
|
---|
845 | Activate:
|
---|
846 | parse arg Nr
|
---|
847 | call PushbackAll
|
---|
848 | CurrentPageNr = Nr
|
---|
849 | /* ok = VRSet("PB_"Nr,"Font","9.WarpSans Bold") */
|
---|
850 | ok = VRSet("TAB_"Nr,"Top", TabTop-8)
|
---|
851 | ok = VRSet("TAB_"Nr,"Left",TabWidth*(Nr-1)+PageLeft)
|
---|
852 | ok = VRSet("TAB_"Nr,"PicturePath", "#1"||Nr||";#1"||Nr)
|
---|
853 | ok = VRset("DT_PageName", "Caption", VRGet("TAB_"Nr, "UserData"))
|
---|
854 | ok = VRSet("Page_"Nr,"Visible", 1)
|
---|
855 | ok = VRSet("PB_help", "HelpTag", VRget("Page_"Nr,"HelpTag"))
|
---|
856 | select
|
---|
857 | when Nr = 1 then ok = VRSet("IPB_paper","PicturePath","#4;#4")
|
---|
858 | when Nr = Pages then ok = VRSet("IPB_paper","PicturePath","#6;#6")
|
---|
859 | otherwise ok = VRSet("IPB_paper","PicturePath","#5;#5")
|
---|
860 | end
|
---|
861 | return
|
---|
862 |
|
---|
863 | /*:VRX CB_AutoOpenFile_Click
|
---|
864 | */
|
---|
865 | CB_AutoOpenFile_Click:
|
---|
866 | AutoOpenFile = VRGet("CB_AutoOpenFile", "Set")
|
---|
867 | return
|
---|
868 |
|
---|
869 | /*:VRX CB_CloseAfterInstall_Click
|
---|
870 | */
|
---|
871 | CB_CloseAfterInstall_Click:
|
---|
872 | CloseAfterInstall = VRGet("CB_CloseAfterInstall","set")
|
---|
873 | return
|
---|
874 |
|
---|
875 | /*:VRX CB_Debug_Click
|
---|
876 | */
|
---|
877 | CB_Debug_Click:
|
---|
878 | if VRGet("CB_Debug","set") then ok = VRRedirectStdIO("ON")
|
---|
879 | else ok = VRRedirectStdIO("OFF")
|
---|
880 | return
|
---|
881 |
|
---|
882 | /*:VRX CB_ExecutesCode_Click
|
---|
883 | */
|
---|
884 | CB_ExecutesCode_Click:
|
---|
885 | ok = VRSet("CB_ExecutesCode", "Set", \VRGet("CB_ExecutesCode","set"))
|
---|
886 | return
|
---|
887 |
|
---|
888 | /*:VRX CB_ExecutesREXX_Click
|
---|
889 | */
|
---|
890 | CB_ExecutesREXX_Click:
|
---|
891 | ok = VRSet("CB_ExecutesRexx", "Set", \VRGet("CB_ExecutesRexx","set"))
|
---|
892 | return
|
---|
893 |
|
---|
894 | /*:VRX CB_Installable_Click
|
---|
895 | */
|
---|
896 | CB_Installable_Click:
|
---|
897 | ok = VRSet("CB_Installable", "Set", \VRGet("CB_Installable","set"))
|
---|
898 | return
|
---|
899 |
|
---|
900 | /*:VRX CB_ModifiesCONFIGSYS_Click
|
---|
901 | */
|
---|
902 | CB_ModifiesCONFIGSYS_Click:
|
---|
903 | ok = VRSet("CB_ModifiesCONFIGSYS", "Set", \VRGet("CB_ModifiesCONFIGSYS","set"))
|
---|
904 | return
|
---|
905 |
|
---|
906 | /*:VRX CB_ModifiesINI_Click
|
---|
907 | */
|
---|
908 | CB_ModifiesINI_Click:
|
---|
909 | ok = VRSet("CB_ModifiesINI", "Set", \VRGet("CB_ModifiesINI","set"))
|
---|
910 | return
|
---|
911 |
|
---|
912 | /*:VRX CB_OpenTargetFolderAfterExtraction_Click
|
---|
913 | */
|
---|
914 | CB_OpenTargetFolderAfterExtraction_Click:
|
---|
915 | CloseAfterInstall = VRGet("CB_CloseAfterInstall","set")
|
---|
916 | return
|
---|
917 |
|
---|
918 | /*:VRX CB_ReadOnlyMode_Click
|
---|
919 | */
|
---|
920 | CB_ReadOnlyMode_Click:
|
---|
921 | ReadOnlyMode = VRGet("CB_ReadOnlyMode", "Set")
|
---|
922 | if \ReadOnlyMode then do
|
---|
923 | Msg.Type = "W"
|
---|
924 | Msg.Text = "Be careful. By manipulating the installation script you may render the package unusable!"
|
---|
925 | call _ShowMsg
|
---|
926 | end
|
---|
927 | ok = VRset("MLE_Script","Readonly",ReadOnlyMode)
|
---|
928 | ok = VRset("Menu_ContextScript_Update","Visible",\ReadOnlyMode)
|
---|
929 | ok = VRset("MItem_13","Visible",\ReadOnlyMode)
|
---|
930 | return
|
---|
931 |
|
---|
932 | /*:VRX CB_ResetAfterInstall_Click
|
---|
933 | */
|
---|
934 | CB_ResetAfterInstall_Click:
|
---|
935 | ResetAfterInstall = VRGet("CB_ResetAfterInstall","set")
|
---|
936 | return
|
---|
937 |
|
---|
938 | /*:VRX CB_WPSclasses_Click
|
---|
939 | */
|
---|
940 | CB_WPSclasses_Click:
|
---|
941 | ok = VRSet("CB_WPSclasses", "Set", \VRGet("CB_WPSclasses","set"))
|
---|
942 | return
|
---|
943 |
|
---|
944 | /*:VRX CN_WPIFiles_ContextMenu
|
---|
945 | */
|
---|
946 | CN_WPIFiles_ContextMenu:
|
---|
947 | if VRInfo("Top") < 1325 & VRGet("CN_WPIFIles", "View") = "Detail" then call _ColumnsMenu "CN_WPIFiles"
|
---|
948 | else do
|
---|
949 | ok = VRMethod( "Menu_ContextFiles", "Popup")
|
---|
950 | end
|
---|
951 | return
|
---|
952 |
|
---|
953 | /*:VRX CN_WPIFiles_DoubleClick
|
---|
954 | */
|
---|
955 | CN_WPIFiles_DoubleClick:
|
---|
956 | call Menu_ContextFiles_OpenSelected_Click
|
---|
957 | return
|
---|
958 |
|
---|
959 | /*:VRX CN_WPIFiles_DragDrop
|
---|
960 | */
|
---|
961 | CN_WPIFiles_DragDrop:
|
---|
962 | call _DragDropWPI
|
---|
963 | return
|
---|
964 |
|
---|
965 | /*:VRX Columns_01_Click
|
---|
966 | */
|
---|
967 | Columns_01_Click:
|
---|
968 | call _ColumnShow
|
---|
969 | return
|
---|
970 |
|
---|
971 | /*:VRX Columns_02_Click
|
---|
972 | */
|
---|
973 | Columns_02_Click:
|
---|
974 | call _ColumnShow
|
---|
975 | return
|
---|
976 |
|
---|
977 | /*:VRX Columns_03_Click
|
---|
978 | */
|
---|
979 | Columns_03_Click:
|
---|
980 | call _ColumnShow
|
---|
981 | return
|
---|
982 |
|
---|
983 | /*:VRX Columns_04_Click
|
---|
984 | */
|
---|
985 | Columns_04_Click:
|
---|
986 | call _ColumnShow
|
---|
987 | return
|
---|
988 |
|
---|
989 | /*:VRX Columns_05_Click
|
---|
990 | */
|
---|
991 | Columns_05_Click:
|
---|
992 | call _ColumnShow
|
---|
993 | return
|
---|
994 |
|
---|
995 | /*:VRX Columns_06_Click
|
---|
996 | */
|
---|
997 | Columns_06_Click:
|
---|
998 | call _ColumnShow
|
---|
999 | return
|
---|
1000 |
|
---|
1001 | /*:VRX Columns_07_Click
|
---|
1002 | */
|
---|
1003 | Columns_07_Click:
|
---|
1004 | call _ColumnShow
|
---|
1005 | return
|
---|
1006 |
|
---|
1007 | /*:VRX Columns_08_Click
|
---|
1008 | */
|
---|
1009 | Columns_08_Click:
|
---|
1010 | call _ColumnShow
|
---|
1011 | return
|
---|
1012 |
|
---|
1013 | /*:VRX Columns_09_Click
|
---|
1014 | */
|
---|
1015 | Columns_09_Click:
|
---|
1016 | call _ColumnShow
|
---|
1017 | return
|
---|
1018 |
|
---|
1019 | /*:VRX Columns_10_Click
|
---|
1020 | */
|
---|
1021 | Columns_10_Click:
|
---|
1022 | call _ColumnShow
|
---|
1023 | return
|
---|
1024 |
|
---|
1025 | /*:VRX Columns_11_Click
|
---|
1026 | */
|
---|
1027 | Columns_11_Click:
|
---|
1028 | call _ColumnShow
|
---|
1029 | return
|
---|
1030 |
|
---|
1031 | /*:VRX Columns_12_Click
|
---|
1032 | */
|
---|
1033 | Columns_12_Click:
|
---|
1034 | call _ColumnShow
|
---|
1035 | return
|
---|
1036 |
|
---|
1037 | /*:VRX EF_Mask_Change
|
---|
1038 | */
|
---|
1039 | EF_Mask_Change:
|
---|
1040 | Mask = VRGet("EF_Mask","Value")
|
---|
1041 | return
|
---|
1042 |
|
---|
1043 | /*:VRX Fini
|
---|
1044 | */
|
---|
1045 | Fini:
|
---|
1046 | window = VRWindow()
|
---|
1047 | call VRSet window, "Visible", 0
|
---|
1048 | drop window
|
---|
1049 | return 0
|
---|
1050 |
|
---|
1051 | /*:VRX GetBootDrive
|
---|
1052 | */
|
---|
1053 | GetBootDrive:
|
---|
1054 | /* Use SysBootDrive if possible */
|
---|
1055 | If Rxfuncadd('SysBootDrive', 'RexxUtil', 'SysBootDrive') Then
|
---|
1056 | Return Left(Value('RUNWORKPLACE',,'OS2ENVIRONMENT'),2)
|
---|
1057 | Else
|
---|
1058 | Return SysBootDrive()
|
---|
1059 |
|
---|
1060 |
|
---|
1061 | /*:VRX Halt
|
---|
1062 | */
|
---|
1063 | Halt:
|
---|
1064 | signal _VREHalt
|
---|
1065 | return
|
---|
1066 |
|
---|
1067 | /*:VRX Init
|
---|
1068 | */
|
---|
1069 | Init:
|
---|
1070 | window = VRWindow()
|
---|
1071 | call VRMethod window, "CenterWindow"
|
---|
1072 | call VRSet window, "Visible", 0
|
---|
1073 | call VRMethod window, "Activate"
|
---|
1074 | drop window
|
---|
1075 | return
|
---|
1076 |
|
---|
1077 | /*:VRX IPB_Paper_Click
|
---|
1078 | */
|
---|
1079 | IPB_Paper_Click:
|
---|
1080 | if VRInfo("Left") > VRInfo("Top") then call Activate min(CurrentPageNr+1,Pages)
|
---|
1081 | if VRInfo("Left") <= VRInfo("Top") then call Activate max(CurrentPageNr-1,1)
|
---|
1082 | return
|
---|
1083 |
|
---|
1084 | /*:VRX Main_Close
|
---|
1085 | */
|
---|
1086 | Main_Close:
|
---|
1087 | call Quit
|
---|
1088 | return
|
---|
1089 |
|
---|
1090 | /*:VRX Main_Create
|
---|
1091 | */
|
---|
1092 | Main_Create:
|
---|
1093 | call VRSet VRWindow(), 'Pointer', 'Wait'
|
---|
1094 | call _LoadOtherFuncs
|
---|
1095 | /* ok = VRMethod("PB_Install","SetFocus") */
|
---|
1096 | call Page1_Create
|
---|
1097 | call Page2_Create
|
---|
1098 | call Page3_Create
|
---|
1099 | call Page4_Create
|
---|
1100 | call Page5_Create
|
---|
1101 | call Paper_Init
|
---|
1102 | call _InitTempdir
|
---|
1103 | InitOk = _WICInit()
|
---|
1104 | if InitOK then do
|
---|
1105 | call _INIRead
|
---|
1106 | call _GUIInit
|
---|
1107 |
|
---|
1108 | call _ParseCommandLine
|
---|
1109 | call _GetPackages
|
---|
1110 | call _GetScript
|
---|
1111 | call _AddPackages
|
---|
1112 | ok = VRSet("Main", "Visible", 1)
|
---|
1113 | call VRSet VRWindow(), 'Pointer', '<default>'
|
---|
1114 | call TAB_1_Click
|
---|
1115 | end
|
---|
1116 | return
|
---|
1117 | /*:VRX Main_DragDrop
|
---|
1118 | */
|
---|
1119 | Main_DragDrop:
|
---|
1120 | call _DragDropWPI
|
---|
1121 | return
|
---|
1122 |
|
---|
1123 | /*:VRX Main_Resize
|
---|
1124 | */
|
---|
1125 | Main_Resize:
|
---|
1126 | MainWin = "Main"
|
---|
1127 | ok = VRSet(MainWin,"Painting", 0)
|
---|
1128 | /* ok = VRset(MainWin,"Visible", 0) */
|
---|
1129 | ok = VRSet(MainWin,"Width",max(VRget(MainWin,"Width"),Pages*TabWidth+300))
|
---|
1130 | ok = VRset("GB_Main","width",VRget(MainWin,"Width")-150)
|
---|
1131 | ok = VRset("GB_Main","Height",VRget(MainWin,"Height")-1175-240)
|
---|
1132 | ok = VRset("GB_Main2","width",VRget("GB_Main","Width")-260)
|
---|
1133 | ok = VRset("GB_Main2","Height",VRget("GB_Main","Height")-275)
|
---|
1134 | ok = VRset("GB_VerticalLine","Left",VRget("GB_Main2","Width")-60)
|
---|
1135 | ok = VRset("GB_VerticalLine","Height",VRget("GB_Main2","Height")-410)
|
---|
1136 | ok = VRset("IPB_Paper","Left",VRget("GB_Main2","width")-420)
|
---|
1137 | ok = VRset("GB_HorLineTop","Width",VRget("GB_Main2","width")-440)
|
---|
1138 | ok = VRset("GB_HorLineTop","Width",VRget("GB_Main2","width")-440)
|
---|
1139 | ok = VRset("GB_LineSubtitle","Width",VRget("GB_Main2","width")-480)
|
---|
1140 | do I = 1 to Pages
|
---|
1141 | ok = VRSet("Page_"I,"Height", max(PageHeight,VRget("GB_Main2","Height")-600))
|
---|
1142 | ok = VRSet("Page_"I,"Width", max(PageWidth,VRget("GB_Main2","Width")-450))
|
---|
1143 | end
|
---|
1144 | ok = VRSet("CB_Installable","Width",VRGet("Page_3","Width")-128)
|
---|
1145 | ok = VRSet("CB_ModifiesCONFIGSYS","Width",VRGet("Page_3","Width")-128)
|
---|
1146 | ok = VRSet("CB_ModifiesINI","Width",VRGet("Page_3","Width")-128)
|
---|
1147 | ok = VRSet("CB_WPSClasses","Width",VRGet("Page_3","Width")-128)
|
---|
1148 | ok = VRSet("CB_ExecutesREXX","Width",VRGet("Page_3","Width")-128)
|
---|
1149 | ok = VRSet("CB_ExecutesCode","Width",VRGet("Page_3","Width")-128)
|
---|
1150 |
|
---|
1151 | ok = VRSet("DT_RunsOnOS2Ver","Width",VRGet("Page_3","Width")-1500)
|
---|
1152 | ok = VRSet("DT_RequiresWarpINVer","Width",VRGet("Page_3","Width")-1500)
|
---|
1153 | ok = VRSet("DT_BuiltForCodePage","Width",VRGet("Page_3","Width")-1500)
|
---|
1154 |
|
---|
1155 | ok = VRSet("DT_OS2Ver","Left",VRGet("Page_3","Width")-800)
|
---|
1156 | ok = VRSet("DT_WarpINVer","Left",VRGet("Page_3","Width")-800)
|
---|
1157 | ok = VRSet("DT_InstWarpINVer","Left",VRGet("Page_3","Width")-800)
|
---|
1158 | ok = VRSet("DT_CodePageVer","Left",VRGet("Page_3","Width")-800)
|
---|
1159 |
|
---|
1160 | ok = VRSet("CB_AutoOpenFile","Width",VRGet("Page_4","Width")-128)
|
---|
1161 | ok = VRSet("CB_ReadOnlyMode","Width",VRGet("Page_4","Width")-128)
|
---|
1162 |
|
---|
1163 | ok = VRset("CN_WPIFiles","Width", VRGet("Page_1","Width")-80)
|
---|
1164 | ok = VRset("CN_WPIFiles","Height", VRGet("Page_1","Height")-80)
|
---|
1165 | ok = VRset("MLE_Script","Width", VRGet("Page_2","Width")-80)
|
---|
1166 | ok = VRset("MLE_Script","Height", VRGet("Page_2","Height")-80)
|
---|
1167 |
|
---|
1168 | ok = VRSEt("PB_Load","top",VRGet("GB_Main","Height")+280)
|
---|
1169 | ok = VRSEt("PB_Install","top",VRGet("GB_Main","Height")+280)
|
---|
1170 | ok = VRSEt("PB_Extract","top",VRGet("GB_Main","Height")+280)
|
---|
1171 | ok = VRSEt("PB_Cancel","top",VRGet("GB_Main","Height")+280)
|
---|
1172 | ok = VRSEt("PB_Help","top",VRGet("GB_Main","Height")+280)
|
---|
1173 |
|
---|
1174 | call _ButtonsCenter
|
---|
1175 |
|
---|
1176 | /* check and empty event queue, trash spurious resize events */
|
---|
1177 | EventString = ''
|
---|
1178 | TrashedResize = 0
|
---|
1179 | do until EventString = 'nop'
|
---|
1180 | EventString = VREvent('N')
|
---|
1181 | if EventString <> 'nop' then do
|
---|
1182 | if EventString = 'CALL 'MainWin'_Resize' then TrashedResize = 1
|
---|
1183 | else interpret eventString
|
---|
1184 | end
|
---|
1185 | end
|
---|
1186 | if TrashedResize then CALL Main_Resize
|
---|
1187 |
|
---|
1188 | ok = VRSet(MainWin, "Painting", 1)
|
---|
1189 |
|
---|
1190 | /* ok = VRset(MainWin,"Visible", 1) */
|
---|
1191 | return
|
---|
1192 |
|
---|
1193 | /*:VRX Menu_ContextFiles_ExtractSelected_Click
|
---|
1194 | */
|
---|
1195 | Menu_ContextFiles_ExtractSelected_Click:
|
---|
1196 | ok = VRMethod( "CN_WPIFiles", "GetRecordList", "Selected", "Selected." )
|
---|
1197 | if Selected.0 = 0 then return
|
---|
1198 | TargetDir = _DirDialog()
|
---|
1199 | say TargetDir
|
---|
1200 | if TargetDir = '' then return
|
---|
1201 |
|
---|
1202 | OldDir = directory()
|
---|
1203 | ok = directory(TargetDir)
|
---|
1204 | do I = 1 to Selected.0
|
---|
1205 | say Selected.I
|
---|
1206 | ExtrFile = VRMethod("CN_WPIfiles","getFieldData", Selected.I, FileFH)
|
---|
1207 | ExtrPack = VRMethod("CN_WPIfiles","getFieldData", Selected.I, IdFH)
|
---|
1208 | WICEXE' "'WPIFile'" -x 'ExtrPack' 'ExtrFile
|
---|
1209 | ok = VRMethod("CN_WPIfiles", "SetRecordAttr", Selected.I, "Selected", 0, "Cursored", 0)
|
---|
1210 | end
|
---|
1211 | ok = directory(OldDir)
|
---|
1212 |
|
---|
1213 | if VRGet("CB_OpenTargetFolderAfterExtraction","Set") then ok = SysOpenObject(TargetDir,"DEFAULT",1)
|
---|
1214 |
|
---|
1215 | Msg.Text = 'Selected files from "'WPIFile'" extracted to "'TargetDir'"'
|
---|
1216 | Msg.Type = 'I'
|
---|
1217 | call _ShowMsg
|
---|
1218 | return
|
---|
1219 |
|
---|
1220 | /*:VRX Menu_ContextFiles_GoBack_Click
|
---|
1221 | */
|
---|
1222 | Menu_ContextFiles_GoBack_Click:
|
---|
1223 | if LastWPIFile = '' then return
|
---|
1224 | Dummy = WPIFile
|
---|
1225 | WPIFile = LastWPIFile
|
---|
1226 | LastWPIFile = Dummy
|
---|
1227 | drop Dummy
|
---|
1228 | call _LoadNewArchive
|
---|
1229 | return
|
---|
1230 |
|
---|
1231 | /*:VRX Menu_ContextFiles_LoadArchive_Click
|
---|
1232 | */
|
---|
1233 | Menu_ContextFiles_LoadArchive_Click:
|
---|
1234 | say 'Start Menu_ContextFiles_LoadArchive_Click'
|
---|
1235 | say 'OldWPIFile = 'OldWPIFile
|
---|
1236 | say 'WPIFile = 'WPIFile
|
---|
1237 | say 'LastWPIFile= 'LastWPIFile
|
---|
1238 | NoWPI = 0
|
---|
1239 | OldWPIFile = WPIFile
|
---|
1240 | LoadDir = VRParseFileName(WPIFile,'DP') /* War LastWPIFile */
|
---|
1241 | if LoadDir = "" then LoadDir = VRParseFileName(LastWPIFile,'DP')
|
---|
1242 | say 'LoadDir = 'LoadDir
|
---|
1243 | WPIFIle = VRFileDialog( VRWindow(), "Choose WPI archive to view", "Open", LoadDir||"\"||Mask, , , )
|
---|
1244 | if WPIFile = '' then do
|
---|
1245 | WPIFile = OldWPIFile
|
---|
1246 | return
|
---|
1247 | end
|
---|
1248 | LastWPIFile = OldWPIFile
|
---|
1249 | call _LoadNewArchiveContent
|
---|
1250 | say 'Done Menu_ContextFiles_LoadArchive_Click'
|
---|
1251 | return
|
---|
1252 |
|
---|
1253 | /*:VRX Menu_ContextFiles_OpenSelected_Click
|
---|
1254 | */
|
---|
1255 | Menu_ContextFiles_OpenSelected_Click:
|
---|
1256 | say 'Start Menu_ContextFiles_OpenSelected_Click()'
|
---|
1257 | ok = VRMethod( "CN_WPIFiles", "GetRecordList", "Selected", "Selected." )
|
---|
1258 | if Selected.0 = 0 then return
|
---|
1259 |
|
---|
1260 | OldDir = directory()
|
---|
1261 | ok = directory(strip(TempDir,,'\'))
|
---|
1262 | do I = 1 to Selected.0
|
---|
1263 | say Selected.I
|
---|
1264 | ExtrFile = VRMethod("CN_WPIfiles","getFieldData", Selected.I, FileFH)
|
---|
1265 | ExtrPack = VRMethod("CN_WPIfiles","getFieldData", Selected.I, IdFH)
|
---|
1266 | say WICEXE' "'WPIFile'" -x 'ExtrPack' 'ExtrFile
|
---|
1267 | WICEXE' "'WPIFile'" -x 'ExtrPack' 'ExtrFile
|
---|
1268 | say TempDir||ExtrFile
|
---|
1269 | call _GarbageAddTo TempDir||ExtrFile
|
---|
1270 | if ReadOnlyMode then do
|
---|
1271 | select
|
---|
1272 | when pos(translate(VRParseFilename(ExtrFile,'E')),'BAT CMD') > 0 then do
|
---|
1273 | 'start E.EXE 'TempDir||ExtrFile
|
---|
1274 | end
|
---|
1275 | when pos(translate(VRParseFilename(ExtrFile,'E')),'EXE COM') > 0 then do
|
---|
1276 | Msg.Type = 'E'
|
---|
1277 | Msg.Text = 'You cannot execute binary code in readonly mode!'
|
---|
1278 | call _ShowMsg
|
---|
1279 | end
|
---|
1280 | otherwise ok = SysOpenObject(TempDir||ExtrFile,'DEFAULT','TRUE')
|
---|
1281 | end
|
---|
1282 | end
|
---|
1283 | else ok = SysOpenObject(TempDir||ExtrFile,'DEFAULT','TRUE')
|
---|
1284 | end
|
---|
1285 | ok = directory(OldDir)
|
---|
1286 | say 'Done Menu_ContextFiles_OpenSelected_Click()'
|
---|
1287 | return
|
---|
1288 |
|
---|
1289 | /*:VRX Menu_ContextScript_Copy_Click
|
---|
1290 | */
|
---|
1291 | Menu_ContextScript_Copy_Click:
|
---|
1292 | SelStr = VRGet("MLE_Script", "SelectedText")
|
---|
1293 | ok = VRMethod( "Application", "PutClipboard", SelStr )
|
---|
1294 | return
|
---|
1295 |
|
---|
1296 | /*:VRX Menu_ContextScript_Find_Click
|
---|
1297 | */
|
---|
1298 | Menu_ContextScript_Find_Click:
|
---|
1299 | ok = VRMethod("MLE_Script","setFocus")
|
---|
1300 | Buttons.1 = "OK"
|
---|
1301 | Buttons.2 = "Abort"
|
---|
1302 | Buttons.0 = 2
|
---|
1303 | id = VRPrompt("MLE_Script", "Find a string within the script (no wildcards allowed)", "SearchString", "WPIView", "Buttons.", buttons.1, buttons.2 )
|
---|
1304 |
|
---|
1305 | ok = VRMethod( "MLE_Script", "Search", SearchString,,, VRGet("MLE_Script","SelectedStart"))
|
---|
1306 | if ok = -1 then do
|
---|
1307 | Msg.Text = '"'SearchString'" not found!'
|
---|
1308 | Msg.Type = 'I'
|
---|
1309 | call _ShowMsg
|
---|
1310 | end
|
---|
1311 | return
|
---|
1312 |
|
---|
1313 | /*:VRX Menu_ContextScript_FindAgain_Click
|
---|
1314 | */
|
---|
1315 | Menu_ContextScript_FindAgain_Click:
|
---|
1316 | if SearchString = "" then return
|
---|
1317 | ok = VRMethod("MLE_Script","setFocus")
|
---|
1318 | ok = VRMethod( "MLE_Script", "Search", SearchString,,, VRGet("MLE_Script","SelectedStart"))
|
---|
1319 | if ok = -1 then do
|
---|
1320 | Msg.Text = '"'SearchString'" not found!'
|
---|
1321 | Msg.Type = 'I'
|
---|
1322 | call _ShowMsg
|
---|
1323 | end
|
---|
1324 | return
|
---|
1325 |
|
---|
1326 | /*:VRX Menu_ContextScript_Help_Click
|
---|
1327 | */
|
---|
1328 | Menu_ContextScript_Help_Click:
|
---|
1329 | ok = VRMethod( "Page_2", "InvokeHelp" )
|
---|
1330 | return
|
---|
1331 |
|
---|
1332 | /*:VRX Menu_ContextScript_SaveScript_Click
|
---|
1333 | */
|
---|
1334 | Menu_ContextScript_SaveScript_Click:
|
---|
1335 | Script = TempDir||VRParseFileName(WPIFile,'N')'.WIS'
|
---|
1336 | say script
|
---|
1337 | if ReadOnlyMode then do
|
---|
1338 | WICEXE' -X "'WPIFile'" "'Script'"'
|
---|
1339 | SaveType = 'Original '
|
---|
1340 | end
|
---|
1341 | else do
|
---|
1342 | content = VRget("MLE_Script","value")
|
---|
1343 | ok = VRCreateFile(Script)
|
---|
1344 | call charout Script, Content
|
---|
1345 | ok = stream(Script, 'c', 'close')
|
---|
1346 | Ok = VRMethod("MLE_Script","QueryChanged" )
|
---|
1347 | if Ok then SaveType = 'Modified '
|
---|
1348 | else SaveType = 'Original '
|
---|
1349 | end
|
---|
1350 |
|
---|
1351 | TargetScript = VRFileDialog( VRWindow(), "Save script to disk", "Save", VRParseFileName(WPIFile,'DPN')'.WIS', , , )
|
---|
1352 |
|
---|
1353 | if TargetScript <> '' then do
|
---|
1354 | ok = VRCopyFile(Script,TargetScript)
|
---|
1355 | if \ok then do
|
---|
1356 | Msg.Text = VRError()
|
---|
1357 | Msg.Type ="E"
|
---|
1358 | end
|
---|
1359 | else do
|
---|
1360 | Msg.Text = SaveType'"'TargetScript'" saved successfully!'
|
---|
1361 | Msg.Type = "I"
|
---|
1362 | end
|
---|
1363 | call _ShowMsg
|
---|
1364 | end
|
---|
1365 | ok = SysFileDelete(Script)
|
---|
1366 | return
|
---|
1367 |
|
---|
1368 | /*:VRX Menu_ContextScript_SelectAll_Click
|
---|
1369 | */
|
---|
1370 | Menu_ContextScript_SelectAll_Click:
|
---|
1371 | ok = VRset("MLE_Script","SelectedStart", 1)
|
---|
1372 | ok = VRset("MLE_Script","SelectedEnd", length(VRGet("MLE_Script","Value")))
|
---|
1373 | return
|
---|
1374 |
|
---|
1375 | /*:VRX Menu_ContextScript_Update_Click
|
---|
1376 | */
|
---|
1377 | Menu_ContextScript_Update_Click:
|
---|
1378 | content = VRget("MLE_Script","value")
|
---|
1379 | ok = VRCreateFile(Script)
|
---|
1380 | call charout Script, Content
|
---|
1381 | ok = stream(Script, 'c', 'close')
|
---|
1382 |
|
---|
1383 | Ok = VRMethod("MLE_Script","QueryChanged" )
|
---|
1384 | if Ok then SaveType = 'Modified '
|
---|
1385 | else SaveType = 'Original '
|
---|
1386 |
|
---|
1387 | WICEXE' "'WPIFile'" -s 'Script'| rxqueue'
|
---|
1388 |
|
---|
1389 | do while queued() > 0
|
---|
1390 | Msg.Type = 'i'
|
---|
1391 | parse pull msg.Text
|
---|
1392 | if left(Msg.Text,4) = 'wic:' then do
|
---|
1393 | Msg.Text = SaveType||substr(Msg.Text,5)
|
---|
1394 | call _ShowMsg
|
---|
1395 | end
|
---|
1396 | end
|
---|
1397 | ok = SysFileDelete(Script)
|
---|
1398 |
|
---|
1399 | return
|
---|
1400 |
|
---|
1401 | /*:VRX Menu_ContextScript_Validate_Click
|
---|
1402 | */
|
---|
1403 | Menu_ContextScript_Validate_Click:
|
---|
1404 | do while queued() > 0
|
---|
1405 | parse pull Rest
|
---|
1406 | end
|
---|
1407 |
|
---|
1408 | Script = Tempdir||VRParseFileName(WPIFile,'N')'.WIS'
|
---|
1409 | say script
|
---|
1410 | if ReadOnlyMode then do
|
---|
1411 | WICEXE' -X "'WPIFile'" "'Script'"'
|
---|
1412 | SaveType = 'Original '
|
---|
1413 | end
|
---|
1414 | else do
|
---|
1415 | content = VRget("MLE_Script","value")
|
---|
1416 | ok = VRCreateFile(Script)
|
---|
1417 | call charout Script, Content
|
---|
1418 | ok = stream(Script, 'c', 'close')
|
---|
1419 |
|
---|
1420 | ok = VRMethod("MLE_Script","QueryChanged" )
|
---|
1421 | if Ok then SaveType = 'Modified '
|
---|
1422 | else SaveType = 'Original '
|
---|
1423 | end
|
---|
1424 |
|
---|
1425 | WICEXE' -t "'Script'"| rxqueue'
|
---|
1426 |
|
---|
1427 | do while queued() > 0
|
---|
1428 | Msg.Type = 'i'
|
---|
1429 | parse pull msg.Text
|
---|
1430 | if left(Msg.Text,4) = 'wic:' then do
|
---|
1431 | Msg.Text = SaveType||substr(Msg.Text,5)
|
---|
1432 | call _ShowMsg
|
---|
1433 | end
|
---|
1434 | end
|
---|
1435 | return
|
---|
1436 |
|
---|
1437 | /*:VRX Menu_ContextScript_Wordwrap_Click
|
---|
1438 | */
|
---|
1439 | Menu_ContextScript_Wordwrap_Click:
|
---|
1440 | ok = VRSet("MLE_Script","WordWrap",\VRGet("MLE_Script","WordWrap"))
|
---|
1441 | ok = VRSet("Menu_ContextScript_Wordwrap","Checked",VRGet("MLE_Script","WordWrap"))
|
---|
1442 | return
|
---|
1443 |
|
---|
1444 | /*:VRX Menu_ExtPack_10_Click
|
---|
1445 | */
|
---|
1446 | Menu_ExtPack_10_Click:
|
---|
1447 | call _LoadExternalPackage
|
---|
1448 | return
|
---|
1449 |
|
---|
1450 | /*:VRX Menu_ExtPack_1_Click
|
---|
1451 | */
|
---|
1452 | Menu_ExtPack_1_Click:
|
---|
1453 | call _LoadExternalPackage
|
---|
1454 | return
|
---|
1455 |
|
---|
1456 | /*:VRX Menu_ExtPack_2_Click
|
---|
1457 | */
|
---|
1458 | Menu_ExtPack_2_Click:
|
---|
1459 | call _LoadExternalPackage
|
---|
1460 |
|
---|
1461 | return
|
---|
1462 |
|
---|
1463 | /*:VRX Menu_ExtPack_3_Click
|
---|
1464 | */
|
---|
1465 | Menu_ExtPack_3_Click:
|
---|
1466 | call _LoadExternalPackage
|
---|
1467 |
|
---|
1468 | return
|
---|
1469 |
|
---|
1470 | /*:VRX Menu_ExtPack_4_Click
|
---|
1471 | */
|
---|
1472 | Menu_ExtPack_4_Click:
|
---|
1473 | call _LoadExternalPackage
|
---|
1474 |
|
---|
1475 | return
|
---|
1476 |
|
---|
1477 | /*:VRX Menu_ExtPack_5_Click
|
---|
1478 | */
|
---|
1479 | Menu_ExtPack_5_Click:
|
---|
1480 | call _LoadExternalPackage
|
---|
1481 |
|
---|
1482 | return
|
---|
1483 |
|
---|
1484 | /*:VRX Menu_ExtPack_6_Click
|
---|
1485 | */
|
---|
1486 | Menu_ExtPack_6_Click:
|
---|
1487 | call _LoadExternalPackage
|
---|
1488 |
|
---|
1489 | return
|
---|
1490 |
|
---|
1491 | /*:VRX Menu_ExtPack_7_Click
|
---|
1492 | */
|
---|
1493 | Menu_ExtPack_7_Click:
|
---|
1494 | call _LoadExternalPackage
|
---|
1495 |
|
---|
1496 | return
|
---|
1497 |
|
---|
1498 | /*:VRX Menu_ExtPack_8_Click
|
---|
1499 | */
|
---|
1500 | Menu_ExtPack_8_Click:
|
---|
1501 | call _LoadExternalPackage
|
---|
1502 |
|
---|
1503 | return
|
---|
1504 |
|
---|
1505 | /*:VRX Menu_ExtPack_9_Click
|
---|
1506 | */
|
---|
1507 | Menu_ExtPack_9_Click:
|
---|
1508 | call _LoadExternalPackage
|
---|
1509 |
|
---|
1510 | return
|
---|
1511 |
|
---|
1512 | /*:VRX Menu_Help_Click
|
---|
1513 | */
|
---|
1514 | Menu_Help_Click:
|
---|
1515 | ok = VRMethod( "Page_1", "InvokeHelp" )
|
---|
1516 | return
|
---|
1517 |
|
---|
1518 | /*:VRX Menu_History_10_Click
|
---|
1519 | */
|
---|
1520 | Menu_History_10_Click:
|
---|
1521 | call _LoadExternalPackage
|
---|
1522 | return
|
---|
1523 |
|
---|
1524 | /*:VRX Menu_History_1_Click
|
---|
1525 | */
|
---|
1526 | Menu_History_1_Click:
|
---|
1527 | call _LoadExternalPackage
|
---|
1528 | return
|
---|
1529 |
|
---|
1530 | /*:VRX Menu_History_2_Click
|
---|
1531 | */
|
---|
1532 | Menu_History_2_Click:
|
---|
1533 | call _LoadExternalPackage
|
---|
1534 | return
|
---|
1535 |
|
---|
1536 | /*:VRX Menu_History_3_Click
|
---|
1537 | */
|
---|
1538 | Menu_History_3_Click:
|
---|
1539 | call _LoadExternalPackage
|
---|
1540 | return
|
---|
1541 |
|
---|
1542 | /*:VRX Menu_History_4_Click
|
---|
1543 | */
|
---|
1544 | Menu_History_4_Click:
|
---|
1545 | call _LoadExternalPackage
|
---|
1546 | return
|
---|
1547 |
|
---|
1548 | /*:VRX Menu_History_5_Click
|
---|
1549 | */
|
---|
1550 | Menu_History_5_Click:
|
---|
1551 | call _LoadExternalPackage
|
---|
1552 | return
|
---|
1553 |
|
---|
1554 | /*:VRX Menu_History_6_Click
|
---|
1555 | */
|
---|
1556 | Menu_History_6_Click:
|
---|
1557 | call _LoadExternalPackage
|
---|
1558 | return
|
---|
1559 |
|
---|
1560 | /*:VRX Menu_History_7_Click
|
---|
1561 | */
|
---|
1562 | Menu_History_7_Click:
|
---|
1563 | call _LoadExternalPackage
|
---|
1564 | return
|
---|
1565 |
|
---|
1566 | /*:VRX Menu_History_8_Click
|
---|
1567 | */
|
---|
1568 | Menu_History_8_Click:
|
---|
1569 | call _LoadExternalPackage
|
---|
1570 | return
|
---|
1571 |
|
---|
1572 | /*:VRX Menu_History_9_Click
|
---|
1573 | */
|
---|
1574 | Menu_History_9_Click:
|
---|
1575 | call _LoadExternalPackage
|
---|
1576 | return
|
---|
1577 |
|
---|
1578 | /*:VRX Menu_Page_3_Help_Click
|
---|
1579 | */
|
---|
1580 | Menu_Page_3_Help_Click:
|
---|
1581 | ok = VRMethod( "Page_3", "InvokeHelp" )
|
---|
1582 | return
|
---|
1583 |
|
---|
1584 | /*:VRX Menu_Page_4_Help_Click
|
---|
1585 | */
|
---|
1586 | Menu_Page_4_Help_Click:
|
---|
1587 | ok = VRMethod( "Page_4", "InvokeHelp" )
|
---|
1588 | return
|
---|
1589 |
|
---|
1590 | /*:VRX Menu_Shell_Click
|
---|
1591 | */
|
---|
1592 | Menu_Shell_Click:
|
---|
1593 | if TargetDir <> '' then do
|
---|
1594 | OldDir = directory()
|
---|
1595 | ok = directory(TargetDir)
|
---|
1596 | end
|
---|
1597 | 'start "WPIView Shell ('value('COMSPEC',,'OS2ENVIRONMENT')')" /F'
|
---|
1598 | if TargetDir <> '' then ok = directory(OldDir)
|
---|
1599 | return
|
---|
1600 |
|
---|
1601 | /*:VRX MLE_Script_ContextMenu
|
---|
1602 | */
|
---|
1603 | MLE_Script_ContextMenu:
|
---|
1604 | ok = VRMethod( "Menu_ContextScript", "Popup")
|
---|
1605 | return
|
---|
1606 |
|
---|
1607 | /*:VRX MLE_Script_DragDrop
|
---|
1608 | */
|
---|
1609 | MLE_Script_DragDrop:
|
---|
1610 | call _DragDropWPI
|
---|
1611 | return
|
---|
1612 |
|
---|
1613 | /*:VRX Page1_Create
|
---|
1614 | */
|
---|
1615 | Page1_Create:
|
---|
1616 |
|
---|
1617 | Return
|
---|
1618 |
|
---|
1619 | /*:VRX Page1_Init
|
---|
1620 | */
|
---|
1621 | Page1_Init:
|
---|
1622 |
|
---|
1623 | return
|
---|
1624 |
|
---|
1625 | /*:VRX Page2_Create
|
---|
1626 | */
|
---|
1627 | Page2_create:
|
---|
1628 |
|
---|
1629 | Return
|
---|
1630 | /*:VRX Page2_init
|
---|
1631 | */
|
---|
1632 | Page2_init:
|
---|
1633 |
|
---|
1634 | return
|
---|
1635 |
|
---|
1636 | /*:VRX Page3_Create
|
---|
1637 | */
|
---|
1638 | Page3_create:
|
---|
1639 |
|
---|
1640 | Return
|
---|
1641 | /*:VRX Page3_Init
|
---|
1642 | */
|
---|
1643 | Page3_Init:
|
---|
1644 |
|
---|
1645 | return
|
---|
1646 |
|
---|
1647 | /*:VRX Page4_Create
|
---|
1648 | */
|
---|
1649 | Page4_Create:
|
---|
1650 |
|
---|
1651 | Return
|
---|
1652 | /*:VRX Page4_init
|
---|
1653 | */
|
---|
1654 | Page4_init:
|
---|
1655 |
|
---|
1656 | return
|
---|
1657 |
|
---|
1658 | /*:VRX Page5_Create
|
---|
1659 | */
|
---|
1660 | Page5_Create:
|
---|
1661 |
|
---|
1662 | return
|
---|
1663 |
|
---|
1664 | /*:VRX Page5_Init
|
---|
1665 | */
|
---|
1666 | Page5_Init:
|
---|
1667 |
|
---|
1668 | return
|
---|
1669 |
|
---|
1670 | /*:VRX Page_3_ContextMenu
|
---|
1671 | */
|
---|
1672 | Page_3_ContextMenu:
|
---|
1673 | ok = VRMethod( "Menu_Page_3", "Popup")
|
---|
1674 | return
|
---|
1675 |
|
---|
1676 | /*:VRX Page_3_DragDrop
|
---|
1677 | */
|
---|
1678 | Page_3_DragDrop:
|
---|
1679 | call _DragDropWPI
|
---|
1680 | return
|
---|
1681 |
|
---|
1682 | /*:VRX Page_4_ContextMenu
|
---|
1683 | */
|
---|
1684 | Page_4_ContextMenu:
|
---|
1685 | ok = VRMethod( "Menu_Page_4", "Popup")
|
---|
1686 | return
|
---|
1687 |
|
---|
1688 | /*:VRX Paper_Init
|
---|
1689 | */
|
---|
1690 | Paper_Init:
|
---|
1691 | ok = VRSet("IPB_Paper","Width" ,VRMethod( "Screen", "PixelsToTwips", 32 ))
|
---|
1692 | ok = VRSet("IPB_Paper","Height",VRMethod( "Screen", "PixelsToTwips", 32 ))
|
---|
1693 | ok = VRset("IPB_Paper","Left",VRget("GB_Main2","width")-420)
|
---|
1694 | return
|
---|
1695 |
|
---|
1696 | /*:VRX PB_Cancel_Click
|
---|
1697 | */
|
---|
1698 | PB_Cancel_Click:
|
---|
1699 | Call Quit
|
---|
1700 | return
|
---|
1701 |
|
---|
1702 | /*:VRX PB_Extract_Click
|
---|
1703 | */
|
---|
1704 | PB_Extract_Click:
|
---|
1705 | if NoWPI then return
|
---|
1706 | if WPIFile = '' then do
|
---|
1707 | Msg.Text = "Nothing to extract!"
|
---|
1708 | Msg.Type = "E"
|
---|
1709 | call _ShowMsg
|
---|
1710 | return
|
---|
1711 | end
|
---|
1712 |
|
---|
1713 | TargetDir = _DirDialog()
|
---|
1714 | say TargetDir
|
---|
1715 | if TargetDir = '' then return
|
---|
1716 |
|
---|
1717 | OldDir = directory()
|
---|
1718 | ok = directory(TargetDir)
|
---|
1719 | WICEXE' -x "'WPIFile'"'
|
---|
1720 | ok = directory(OldDir)
|
---|
1721 | Msg.Text = '"'WPIFile'" extracted to "'TargetDir'"'
|
---|
1722 | Msg.Type = 'I'
|
---|
1723 | call _ShowMsg
|
---|
1724 | return
|
---|
1725 |
|
---|
1726 | /*:VRX PB_Help_Click
|
---|
1727 | */
|
---|
1728 | PB_Help_Click:
|
---|
1729 | say 'Started PB_Help_Click'
|
---|
1730 | say 'HelpTag = 'VRget("PB_help","HelpTag")
|
---|
1731 | ok = VRMethod( "PB_Help", "InvokeHelp" )
|
---|
1732 | say 'Done PB_Help_Click'
|
---|
1733 | return
|
---|
1734 |
|
---|
1735 | /*:VRX PB_Install_Click
|
---|
1736 | */
|
---|
1737 | PB_Install_Click:
|
---|
1738 | if NoWPI then return
|
---|
1739 | if WPIFile = '' then do
|
---|
1740 | Msg.Text = "Nothing to install!"
|
---|
1741 | Msg.Type = "E"
|
---|
1742 | call _ShowMsg
|
---|
1743 | return
|
---|
1744 | end
|
---|
1745 | if translate(VRParseFilename(WPIFile,'E')) = 'EXE' then do
|
---|
1746 | 'start "'WPIFile'"'
|
---|
1747 | end
|
---|
1748 | else do
|
---|
1749 | 'start 'WARPINEXE' "'WPIFile'"'
|
---|
1750 | end
|
---|
1751 | if ResetAfterInstall then do
|
---|
1752 | call _Reset
|
---|
1753 | NoWPI = 1
|
---|
1754 | end
|
---|
1755 | if CloseAfterInstall then do
|
---|
1756 | Call Quit
|
---|
1757 | end
|
---|
1758 | return
|
---|
1759 |
|
---|
1760 | /*:VRX PB_Load_Click
|
---|
1761 | */
|
---|
1762 | PB_Load_Click:
|
---|
1763 | call Menu_ContextFiles_LoadArchive_Click
|
---|
1764 | return
|
---|
1765 |
|
---|
1766 | /*:VRX PushbackAll
|
---|
1767 | */
|
---|
1768 | PushbackAll:
|
---|
1769 | Pages = 4
|
---|
1770 | /* Tab distance from top */
|
---|
1771 | TabTop = 20
|
---|
1772 | TabWidth = VRMethod( "Screen", "PixelsToTwips", 78 )
|
---|
1773 | TabHeight= VRMethod( "Screen", "PixelsToTwips", 24 )
|
---|
1774 |
|
---|
1775 | /* Page Position */
|
---|
1776 | PageLeft = 120
|
---|
1777 | PageTop = PageLeft + TabTop + 330
|
---|
1778 |
|
---|
1779 | /* Page size */
|
---|
1780 | PageHeight = 3000
|
---|
1781 | PageWidth = 3000
|
---|
1782 | ok = VRset("DT_PageName", "Caption", "")
|
---|
1783 | ok = VRSet("GB_Main","Left", 0)
|
---|
1784 | ok = VRSet("GB_Main","Top", TabTop+230)
|
---|
1785 | do I = 1 to Pages
|
---|
1786 | ok = VRSet("TAB_"I,"Top", TabTop)
|
---|
1787 | ok = VRSet("TAB_"I,"PicturePath","#2"||I||";#2"||I)
|
---|
1788 | ok = VRSet("TAB_"I,"Left",TabWidth*(I-1)+PageLeft)
|
---|
1789 | ok = VRSet("TAB_"I,"Width",TabWidth)
|
---|
1790 | ok = VRSet("TAB_"I,"Height",TabHeight)
|
---|
1791 | ok = VRSet("Page_"I,"Visible", 0)
|
---|
1792 | ok = VRSet("Page_"I,"Left", PageLeft)
|
---|
1793 | ok = VRSet("Page_"I,"Top", PageTop)
|
---|
1794 | ok = VRSet("Page_"I,"Height", max(PageHeight,VRget("GB_Main2","Height")-600))
|
---|
1795 | ok = VRSet("Page_"I,"Width", max(PageWidth,VRget("GB_Main2","Width")-450))
|
---|
1796 | ok = VRSet("Page_"I,"BackColor", "<default>")
|
---|
1797 | end
|
---|
1798 | return
|
---|
1799 |
|
---|
1800 | /*:VRX Quit
|
---|
1801 | */
|
---|
1802 | Quit:
|
---|
1803 | if OurINI <> 'OURINI' then do
|
---|
1804 | call _GarbageRemove
|
---|
1805 | ok = VRMethod("Main", "Restore")
|
---|
1806 | call _INIWrite
|
---|
1807 | ok = SysSetExtLIBPATH(OldBeginLibPath, 'B')
|
---|
1808 | end
|
---|
1809 | window = VRWindow()
|
---|
1810 | call VRSet window, "Shutdown", 1
|
---|
1811 | drop window
|
---|
1812 | return
|
---|
1813 |
|
---|
1814 | /*:VRX TAB_1_Click
|
---|
1815 | */
|
---|
1816 | TAB_1_Click:
|
---|
1817 | call Activate 1
|
---|
1818 | ok = VRset("CN_WPIFiles","Width", VRGet("Page_1","Width")-80)
|
---|
1819 | ok = VRset("CN_WPIFiles","Height", VRGet("Page_1","Height")-80)
|
---|
1820 | ok = VRMethod("CN_WPIFiles", "Setfocus")
|
---|
1821 | return
|
---|
1822 |
|
---|
1823 | /*:VRX TAB_2_Click
|
---|
1824 | */
|
---|
1825 | TAB_2_Click:
|
---|
1826 | call Activate 2
|
---|
1827 | ok = VRset("MLE_Script","Width", VRGet("Page_1","Width")-80)
|
---|
1828 | ok = VRset("MLE_Script","Height", VRGet("Page_1","Height")-80)
|
---|
1829 | ok = VRMethod("MLE_Script","Setfocus")
|
---|
1830 | return
|
---|
1831 |
|
---|
1832 | /*:VRX TAB_3_Click
|
---|
1833 | */
|
---|
1834 | TAB_3_Click:
|
---|
1835 | call Activate 3
|
---|
1836 | ok = VRMethod("CB_Installable","setfocus")
|
---|
1837 | return
|
---|
1838 |
|
---|
1839 | /*:VRX TAB_4_Click
|
---|
1840 | */
|
---|
1841 | TAB_4_Click:
|
---|
1842 | call Activate 4
|
---|
1843 | ok = VRMethod("CB_AutoOpenFile","Setfocus")
|
---|
1844 | return
|
---|
1845 |
|
---|
1846 | /*:VRX TAB_5_Click
|
---|
1847 | */
|
---|
1848 | TAB_5_Click:
|
---|
1849 | call Activate 5
|
---|
1850 | return
|
---|
1851 |
|
---|
1852 | /*:VRX TM_Allow_Trigger
|
---|
1853 | */
|
---|
1854 | TM_Allow_Trigger:
|
---|
1855 | if NoWPI | WPIfile = '' then Allow = 0
|
---|
1856 | else Allow = 1
|
---|
1857 | ok = VRset("PB_Install","Enabled", Allow)
|
---|
1858 | ok = VRset("PB_Extract","Enabled", Allow)
|
---|
1859 | ok = VRset("Menu_ContextFiles_ExtractSelected","Enabled", Allow)
|
---|
1860 | ok = VRset("Menu_ContextFiles_OpenSelected","Enabled", Allow)
|
---|
1861 | ok = VRset("Menu_ContextScript_Copy","Enabled", Allow)
|
---|
1862 | ok = VRset("Menu_ContextScript_FindAgain","Enabled", Allow)
|
---|
1863 | ok = VRset("Menu_ContextScript_Find","Enabled", Allow)
|
---|
1864 | ok = VRset("Menu_ContextScript_SaveScript","Enabled", Allow)
|
---|
1865 | ok = VRset("Menu_ContextScript_Update","Enabled", Allow)
|
---|
1866 | ok = VRset("Menu_ContextScript_Validate","Enabled", Allow)
|
---|
1867 | return
|
---|
1868 |
|
---|