home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
checkt.zip
/
WINDOW1.VRX
< prev
next >
Wrap
Text File
|
1995-01-23
|
5KB
|
225 lines
/*: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
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: procedure
name = arg( 1 )
window = VRLoad( VRWindow(), VRWindowPath(), name )
call VRMethod window, "CenterWindow"
call VRSet window, "Visible", 1
call VRMethod window, "Activate"
return window
/*:VRX Fini
*/
Fini:
window = VRWindow()
call VRSet window, "Visible", 0
drop window
return 0
/*:VRX Halt
*/
Halt:
signal _VREHalt
return
/*:VRX Init
*/
Init:
window = VRWindow()
call VRMethod window, "CenterWindow"
call VRSet window, "Visible", 1
call VRMethod window, "Activate"
drop window
return
/*:VRX PB_1_Click
*/
PB_1_Click:
ok = VRSet( "PB_1", "Enabled", 0 )
ok = VRSet( "CB_1", "Enabled", 0 )
ok = VRSet( "SL_5", "Percentile", 0 )
ok = VRMethod( "LB_1", "Clear" )
source = VRGet( "EF_1", "Value" )
cs = VRGet( "CB_1", "Set" )
sftopts='BO'
set = VRGet( "CB_2", "Set" )
if set=1 then sftopts='BOS'
call SysFileTree source, 'path', sftopts
if path.0 = 0 then do
id = VRMessage( VRWindow(), "No files found", "Error", "None", , , )
ok = VRSet( "PB_1", "Enabled", 1 )
ok = VRSet( "CB_1", "Enabled", 1 )
return
end
cur=1
cnt=0
lim=path.0/100
per=0
do i=1 to path.0
/* Extract the filename from the full path */
cnt=cnt+1
if cnt>=lim then do
cnt=lim-Trunc(lim, "0")
per=per+1
ok = VRSet( "SL_5", "Percentile", per )
end
pos =lastpos("\",path.i) + 1
file.i = substr(path.i,pos)
/* Get the longname */
rc = SysGetEA(path.i, ".LONGNAME", "eainfo")
if rc = 0 then do
pos = lastpos("00"x,eainfo) + 1
longname = substr(eainfo,pos)
end
else longname = ""
if longname ¬= "" & streq(file.i, longname,cs) then do
str=path.i "->" longname
position = VRMethod( "LB_1", "AddString", str, )
ok = VRMethod( "LB_1", "SetItemData", cur, i )
cur=cur+1
end
end
ok = VRSet( "PB_1", "Enabled", 1)
ok = VRSet( "CB_1", "Enabled", 1)
ok = VRSet( "SL_5", "Percentile", 0 )
return
streq:
parse arg s1,s2,csen
if csen=0 then do
s1=Translate( s1 )
s2=Translate( s2 )
end
if s1¬=s2 then return 1
return 0
/*:VRX PB_2_Click
*/
PB_2_Click:
ok = VRMethod( "LB_1", "GetSelectedList", "sel." )
if sel.0>0 then do
do s=1 to sel.0
i= VRMethod( "LB_1", "GetItemData", sel.s)
/* Extract the filename from the full path */
pos =lastpos("\",path.i) + 1
file.i = substr(path.i,pos)
/* Get the longname */
rc = SysGetEA(path.i, ".LONGNAME", "eainfo")
if rc = 0 then do
pos = lastpos("00"x,eainfo) + 1
longname = substr(eainfo,pos)
end
else longname = ""
eainfo = "DFFF00000100FDFF"x || d2c(length(file.i))||"00"x||file.i
rc = SysPutEA(path.i, ".LONGNAME", eainfo)
end
ok=VRMethod( "LB_1", "DeleteList", "sel." )
end
return
/*:VRX PB_3_Click
*/
PB_3_Click:
count = VRGet( "LB_1", "Count" )
sel.0=count
do i=1 to count
sel.i=i
end
ok = VRMethod( "LB_1", "SetSelectedList", "sel." )
return
/*:VRX PB_4_Click
*/
PB_4_Click:
count = VRGet( "LB_1", "Count" )
sel.0=count
do i=1 to count
sel.i=i
end
ok = VRMethod( "LB_1", "DeselectList", "sel." )
return
/*:VRX Quit
*/
Quit:
window = VRWindow()
call VRSet window, "Shutdown", 1
drop window
return
/*:VRX Window1_Close
*/
Window1_Close:
call Quit
return
/*:VRX Window1_Create
*/
Window1_Create:
call RxFuncAdd SysLoadFuncs,RexxUtil,SysLoadFuncs
call SysLoadFuncs
ok = VRSet( "EF_1", "Value", "C:\*.*" )
return