home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mega Top 1
/
os2_top1.zip
/
os2_top1
/
APPS
/
PROG
/
REXX
/
REXXTRA
/
RXEXTRAS.VPR
< prev
Wrap
Text File
|
1993-09-25
|
11KB
|
289 lines
RxExtras VisPro/REXX extensions
===============================
These functions are all to be used within Event processing, such
as When Opened, or When Clicked/Selected, in the VisPro/REXX
development environment.
RxListBoxFromFile Example
-------------------------
Call RxListBoxFromFile window, 1000, 'c:\config.sys'
This loads the file 'c:\config.sys' into the listbox with ID number
1000 (this is found in the settings of the listbox , on the General Page). It is
many times faster than doing it using REXX LineIn and VpAddItem calls.
'window' is passed to all VPR events.
RxListBoxToFile Example
-------------------------
Call RxListBoxToFile window, 1000, 'c:\config.sys'
This saves the listbox with id 1000 into the file 'c:\config.sys'
It is many times faster than doing it using REXX LineOut and VpGetItem calls.
'window' is passed to all VPR events.
RxListBoxToStem Example
-------------------------
Call RxListBoxToStem window, 1000, 'data.'
This saves the listbox with id 1000 into the stem 'data.'
It is many times faster than doing it using a REXX DO Loop and VpGetItem calls.
'window' is passed to all VPR events
data.0 is set to the number of items retrieved from the listbox.
RxListBoxFromStem Example
-------------------------
Call RxListBoxFromStem window, 1000, 'listboxdata.'
This loads the stem 'listboxdata.' into the listbox with ID number
1000 (this is found in the settings of the listbox , on the General Page). It is
many times faster than doing it using REXX DO loop and VpAddItem calls.
'window' is passed to all VPR events.
listboxdata.0 holds the number of lines to be inserted into the listbox
RxGetListBoxCount Example
-------------------------
NumLines = RxGetListBoxCount(window, 1000)
NumLines will hold the number of lines in the listbox.
Explanations of window and 1000 are given above.
RxGetItemFromListBox Example
----------------------------
Line = RxGetItemFromListBox(window, 1000)
Line will hold the text of the first selected item in the listbox.
Explanations of window and 1000 are given above.
Line will hold up to 4096 chars. VpGetItemValue will truncate at 256!
RxGetItemFromListBoxAtIndex Example
-----------------------------------
Line = RxGetItemFromListBoxAtIndex(window, 1000, 4)
Line will hold the text of the 4th line in the listbox
Limits and explanations as for RxGetItemFromListBox
RxAddItemAtIndex Example
-----------------------------------
Call RxAddtItemAtIndex window, 1000, 4, "This is the fourth line"
Line 4 of the listbox with have the text "This is the fourth line"
Limits and explanations as for RxGetItemFromListBox
RxSetSpinButtonCharRange Example
--------------------------------
Call RxSetSpinButtonCharRange window, 1000, 'a', 'z'
Sets the spinbutton with id 1000 (found in the spin button settings
on the general page) to hold the characters from 'a' to 'z'.
Only the first character is used if the 3rd and 4th parameters are longer
than one character.
RxSetSpinButtonRangeFromStem Example
------------------------------------
day.0 = 5; day.1 = 'Mon'; day.2 = 'Tues', day.3 = 'Wed'
day.4 = 'Thurs'; day.5 = 'Fri'
Call RxSetSpinButtonRangeFromStem window, 1000, 'day.'
This sets the spin button with id 1000 to hold the days of the week.
To make Thursday the currently displayed day, use VpSetItemValue with a
zero based index, i.e. one less than the index in the stem. Example :-
CALL VpSetItemValue window, 1000, 3
RxSetSpinButtonRangeWithIncrement Example
-----------------------------------------
Call RxSetSpinButtonRangeFromStem window, 1000, 0, 100000, 2000
This sets the spin button with id 1000 to hold the numbers from 0 to 100,000
inclusively in steps of 2,000. i.e. the numbers in the spin buttons are
0, 2000, 4000, 6000, 8000, 10000, 12000 etc up to 100000
RxMorphButtonToIcon Example
-----------------------------------
Call RxMorphButtonToIcon window, 1000, value
or
Call RxMorphButtonToIcon window, 1000, DLLName, ResourceNumber
This function enables toolbars to be created in VisPro/REXX.
To create a toolbar, simply design your form normally using VisPro/REXX's
Layout view, except make the button size a little bigger than an icon.
Then in the 'Form->When Opened...' event, call RxMorphButtonToIcon as above.
The first form of the function gets the icon 'value' from VpLoadPicture,
which is available on the 'Add' menu of the event coding area.
The second form loads an icon from a DLL. This can be handy for packaing many
icons, or reusing someone elses icons.
If using the first form of the function, value MUST be obtained
from a VpLoadPicture call.
If using the second form of the function, DLLName can be either the
name of the DLL to be found in LIBPATH *without the .DLL extension*, or the
fully qualified name of the file.
RxSearchItem Example
--------------------
FoundLine = RxSearchItem window, 1000, text, startline, 'F'
or
FoundLine = RxSearchItem window, 1000, text, startline, 'B'
This function searches the listbox with id 1000 for the text
specified (case insensitive), starting at 'startline', going
Forwards in the first case, and Backwards in the second.
FoundLine will contain zero if the text can't be found, otherwise
it will contain the index into the listbox of the first line that
contains the text.
RxQueryWindow Example
---------------------
Parent = RxQueryWindow(window, "parent")
OR
Owner = RxQueryWindow(window, "owner")
This function implements WinQueryWindow for use in REXX.
The first argument is a window handle, expressed in decimal.
The second argument determines which window handle (relative
to the window passed) is to be returned.
Valid values are :- Owner, Parent,
NEXT (Next window in z-order, window below),
PREV (Previous window in z-order (window above)),
TOP (Topmost child window)
BOTTOM (Bottommost child window)
NEXTTOP (Returns the next window of the owner window hierarchy subject to their
z-ordering)
PREVTOP (Returns the previous main window, in the enumeration order defined by NEXTTOP)
FRAMEOWNER (Returns the owner of window normalized so that it shares the same parent as window)
RxMaximize Example
------------------
Call RxMaximize RxQueryWindow(RxQueryWindow(window, 'parent'), 'parent')
where RxQueryWindow is described above, and window is the window handle passed to
all VisPro/REXX events
RxMinimize Example
------------------
Call RxMinimize RxQueryWindow(RxQueryWindow(window, 'parent'), 'parent')
where RxQueryWindow is described above, and window is the window handle passed to
all VisPro/REXX events
RxRestore Example
-----------------
Call RxRestore RxQueryWindow(RxQueryWindow(window, 'parent'), 'parent')
where RxQueryWindow is described above, and window is the window handle passed to
all VisPro/REXX events
RxQueryClassName Example
------------------------
class = RxQueryClassName(window)
where window is the window handle passed to all VisPro/REXX events
RxQueryFonts Example
--------------------
Call RxQueryFonts window, 'fonts.'
where window is the window handle passed to all VisPro/REXX events
fonts.0 holds the number of fonts found on return and font.1 to font.n hold a description
of the fonts, for example '10.System Proportional'.
Currently duplicate fonts are being returned. This will be fixed in a future release
RxThread Example
----------------
ThreadID = RxThread('ProcName', arg1, arg2, arg3)
where ProcName is the name of a SUBPROC and
arg1, arg2, arg3 can be ANY number of arguments (up to the REXX limit of 16) that
you would like passed to the subproc.
Note: RxThread will work in a Form Test by loading the SubProc
from .\SubProcs, if you change the working directory, this
function may not work as expected.
Limitations: You can't access Form global variables or call other subprocs
from within a subproc started using RxThread
RxKillThread Example
--------------------
result = RxKillThread(ThreadID)
where ThreadID is returned from RxThread
RxSuspendThread Example
-----------------------
result = RxSuspendThread(ThreadID)
where ThreadID is returned from RxThread
RxResumeThread Example
----------------------
result = RxKillThread(ThreadID)
where ThreadID is returned from RxThread
RxChangeThreadPriority Example
------------------------------
result = RxChangeThreadPriority(threadId, delta)
where threadId is returned from RxThread and
delta is a number from -31 to +31 or one of the strings
'MAXIMUM' or 'MINIMUM'
RxSetThreadClass Example
------------------------
result = RxSetThreadClass(threadId, class)
where threadId is returned from RxThread and
class is one of 'idle', 'regular', 'timecritical' or 'foregroundserver'
only the first letter is significant
RxSetIcon Example
-----------------
Call RxSetIcon RxQueryWindow(RxQueryWindow(window, 'parent'), 'parent'), value
or
Call RxSetIcon RxQueryWindow(RxQueryWindow(window, 'parent'), 'parent'), DLLName, ResourceNumber
Where window is passed to all VisPro/REXX events.
The first form of the function gets the icon 'value' from VpLoadPicture,
which is available on the 'Add' menu of the event coding area.
The second form loads an icon from a DLL. This can be handy for packaging many
icons, or reusing someone elses icons.
DLLName is either the fully qualified name of a DLL (i.e. 'C:\OS2\DLL\PMWIN.DLL'), or
the name without the extension (i.e. 'PMWIN').
ResourceNumber is the 'ID' of the bitmap when it was resource compiled into the DLL.
RxDrawBitmap Example
--------------------
Call RxDrawBitmap window, id, value
or
Call RxDrawBitmap window, id, DLLName, ResourceNumber
Where window is passed to all VisPro/REXX events,
and id is the ITEM id in your VisPro/REXX application of the free form window that you want to load the bitmap into (these usually start at 1000).
The first form of the function gets the icon 'value' from VpLoadPicture,
which is available on the 'Add' menu of the event coding area.
The second form loads an icon from a DLL. This can be handy for packaging many
icons, or reusing someone elses icons.
DLLName is either the fully qualified name of a DLL (i.e. 'C:\OS2\DLL\PMWIN.DLL'), or
the name without the extension (i.e. 'PMWIN').
ResourceNumber is the 'ID' of the bitmap when it was resource compiled into the DLL.