home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
vxcliser.zip
/
VXREXX.3
/
SAMPLES
/
THREADS
/
CHILD.VRX
next >
Wrap
Text File
|
1994-12-23
|
3KB
|
149 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 EF_Text_Change
*/
EF_Text_Change:
/* Only allow the sending of valid messages.
*/
value = VRGet( "EF_Text", "Value" )
if( LENGTH(value) > 0 ) then do
call VRSet "PB_Send", "Enabled", 1
end
else do
call VRSet "PB_Send", "Enabled", 0
end
return
/*:VRX Fini
*/
Fini: procedure
/* Destroy the window
*/
window = VRWindow()
call VRSet window, "Visible", 0
tid = VRMethod( "Application", "GetThreadId" )
call VRMethod "Application", "PostQueue", 0, 0, 'call VRMethod "LB_Threads", "DeleteString",' tid
return 0
/*:VRX Halt
*/
Halt:
signal _VREHalt
return
/*:VRX Init
*/
Init: procedure
/* Create the window
*/
window = VRWindow()
call VRMethod window, 'CenterWindow'
call VRSet window, "Visible", 1
call VRMethod window, "Activate"
/* Get and display the thread ID
*/
tid = VRMethod( "Application", "GetThreadId" )
call VRSet window, "Caption", "Thread" tid
call VRMethod "EF_Text", "SetFocus"
call VRMethod "Application", "PostQueue", 0, 0, "call Update"
return
/*:VRX PB_Send_Click
*/
PB_Send_Click:
/* Send the message to the parent
*/
text = VRGet( "EF_Text", "Value" )
call VRMethod "Application", "PostQueue", 0, 0, "call ShowMessage", "Message", text
call VRSet "EF_Text", "Value", ""
call VRMethod "EF_Text", "SetFocus"
drop text
return
/*:VRX Quit
*/
Quit:
/* Program execution will continue in the 'Threads' file.
*/
window = VRWindow()
call VRSet window, "Shutdown", 1
drop window
return
/*:VRX Window1_Close
*/
Window1_Close:
call Quit
return