home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / PROG / REXX / REXXTRA / RXEXTRAS.VPR < prev   
Text File  |  1993-09-25  |  11KB  |  289 lines

  1. RxExtras VisPro/REXX extensions
  2. ===============================
  3. These functions are all to be used within Event processing, such
  4. as When Opened, or When Clicked/Selected, in the VisPro/REXX
  5. development environment.
  6.  
  7. RxListBoxFromFile Example
  8. -------------------------
  9.     Call RxListBoxFromFile window, 1000, 'c:\config.sys'
  10.     
  11.     This loads the file 'c:\config.sys' into the listbox with ID number 
  12.     1000 (this is found in the settings of the listbox , on the General Page). It is
  13.     many times faster than doing it using REXX LineIn and VpAddItem calls.
  14.     'window' is passed to all VPR events.
  15.  
  16. RxListBoxToFile Example
  17. -------------------------
  18.     Call RxListBoxToFile window, 1000, 'c:\config.sys'
  19.     
  20.     This saves the listbox with id 1000 into the file 'c:\config.sys' 
  21.     It is many times faster than doing it using REXX LineOut and VpGetItem calls.
  22.     'window' is passed to all VPR events.
  23.  
  24. RxListBoxToStem Example
  25. -------------------------
  26.     Call RxListBoxToStem window, 1000, 'data.'
  27.     
  28.     This saves the listbox with id 1000 into the stem 'data.' 
  29.     It is many times faster than doing it using a REXX DO Loop and VpGetItem calls.
  30.     'window' is passed to all VPR events
  31.     data.0 is set to the number of items retrieved from the listbox.
  32.  
  33. RxListBoxFromStem Example
  34. -------------------------
  35.     Call RxListBoxFromStem window, 1000, 'listboxdata.'
  36.     
  37.     This loads the stem 'listboxdata.' into the listbox with ID number 
  38.     1000 (this is found in the settings of the listbox , on the General Page). It is
  39.     many times faster than doing it using REXX DO loop and VpAddItem calls.
  40.     'window' is passed to all VPR events.
  41.     listboxdata.0 holds the number of lines to be inserted into the listbox
  42.  
  43.  
  44. RxGetListBoxCount Example
  45. -------------------------
  46.     NumLines = RxGetListBoxCount(window, 1000)
  47.     
  48.     NumLines will hold the number of lines in the listbox.
  49.     Explanations of window and 1000 are given above.
  50.     
  51.     
  52. RxGetItemFromListBox Example
  53. ----------------------------
  54.     Line = RxGetItemFromListBox(window, 1000)
  55.     
  56.     Line will hold the text of the first selected item in the listbox.
  57.     Explanations of window and 1000 are given above.
  58.     Line will hold up to 4096 chars. VpGetItemValue will truncate at 256!
  59.  
  60. RxGetItemFromListBoxAtIndex Example
  61. -----------------------------------
  62.     Line = RxGetItemFromListBoxAtIndex(window, 1000, 4)
  63.     
  64.     Line will hold the text of the 4th line in the listbox
  65.     Limits and explanations as for RxGetItemFromListBox
  66.  
  67. RxAddItemAtIndex Example
  68. -----------------------------------
  69.     Call RxAddtItemAtIndex window, 1000, 4, "This is the fourth line"
  70.     
  71.     Line 4 of the listbox with have the text "This is the fourth line"
  72.     Limits and explanations as for RxGetItemFromListBox
  73.  
  74.     
  75.    
  76. RxSetSpinButtonCharRange Example
  77. --------------------------------
  78.     Call RxSetSpinButtonCharRange window, 1000, 'a', 'z'
  79.     
  80.     Sets the spinbutton with id 1000 (found in the spin button settings
  81.     on the general page) to hold the characters from 'a' to 'z'.
  82.     Only the first character is used if the 3rd and 4th parameters are longer
  83.     than one character.
  84.  
  85. RxSetSpinButtonRangeFromStem Example
  86. ------------------------------------
  87.     day.0 = 5; day.1 = 'Mon'; day.2 = 'Tues', day.3 = 'Wed'
  88.     day.4 = 'Thurs'; day.5 = 'Fri'
  89.     Call RxSetSpinButtonRangeFromStem window, 1000, 'day.'
  90.     
  91.     This sets the spin button with id 1000 to hold the days of the week.
  92.     To make Thursday the currently displayed day, use VpSetItemValue with a
  93.     zero based index, i.e. one less than the index in the stem. Example :-
  94.     
  95.     CALL VpSetItemValue window, 1000, 3
  96.  
  97. RxSetSpinButtonRangeWithIncrement Example
  98. -----------------------------------------
  99.     Call RxSetSpinButtonRangeFromStem window, 1000, 0, 100000, 2000
  100.     
  101.     This sets the spin button with id 1000 to hold the numbers from 0 to 100,000
  102.     inclusively in steps of 2,000. i.e. the numbers in the spin buttons are
  103.     0, 2000, 4000, 6000, 8000, 10000, 12000 etc up to 100000
  104.  
  105. RxMorphButtonToIcon Example
  106. -----------------------------------
  107.     Call RxMorphButtonToIcon window, 1000, value
  108.         or
  109.     Call RxMorphButtonToIcon window, 1000, DLLName, ResourceNumber
  110.     
  111.     This function enables toolbars to be created in VisPro/REXX.
  112.  
  113.     To create a toolbar, simply design your form normally using VisPro/REXX's
  114.     Layout view, except make the button size a little bigger than an icon.
  115.     Then in the 'Form->When Opened...' event, call RxMorphButtonToIcon as above.
  116.  
  117.     The first form of the function gets the icon 'value' from VpLoadPicture,
  118.         which is available on the 'Add' menu of the event coding area.
  119.     The second form loads an icon from a DLL. This can be handy for packaing many
  120.     icons, or reusing someone elses icons.
  121.     
  122.     If using the first form of the function, value MUST be obtained
  123.     from a VpLoadPicture call.
  124.     If using the second form of the function, DLLName can be either the
  125.     name of the DLL to be found in LIBPATH *without the .DLL extension*, or the
  126.     fully qualified name of the file.
  127.  
  128. RxSearchItem Example
  129. --------------------
  130.     FoundLine = RxSearchItem window, 1000, text, startline, 'F'
  131.       or
  132.     FoundLine = RxSearchItem window, 1000, text, startline, 'B'
  133.     
  134.     This function searches the listbox with id 1000 for the text
  135.     specified (case insensitive), starting at 'startline', going
  136.     Forwards    in the first case, and Backwards in the second.
  137.     
  138.     FoundLine will contain zero if the text can't be found, otherwise
  139.     it will contain the index into the listbox of the first line that
  140.     contains the text.
  141.  
  142. RxQueryWindow Example
  143. ---------------------
  144.     Parent  = RxQueryWindow(window, "parent")
  145.     OR
  146.     Owner = RxQueryWindow(window, "owner")
  147.     This function implements WinQueryWindow for use in REXX.
  148.     The first argument is a window handle, expressed in decimal.
  149.  
  150.     The second argument determines which window handle (relative
  151.     to the window passed) is to be returned.
  152.     Valid values are :- Owner, Parent,
  153.     NEXT (Next window in z-order, window below),
  154.     PREV (Previous window in z-order (window above)), 
  155.     TOP (Topmost child window)
  156.     BOTTOM (Bottommost child window)
  157.     NEXTTOP (Returns the next window of the owner window hierarchy subject to their 
  158.              z-ordering)
  159.     PREVTOP (Returns the previous main window, in the enumeration order defined by NEXTTOP) 
  160.     FRAMEOWNER (Returns the owner of window normalized so that it shares the same parent as window)
  161.     
  162. RxMaximize Example
  163. ------------------
  164.     Call RxMaximize RxQueryWindow(RxQueryWindow(window, 'parent'), 'parent')
  165.     
  166.     where RxQueryWindow is described above, and window is the window handle passed to
  167.     all VisPro/REXX events
  168.     
  169. RxMinimize Example
  170. ------------------
  171.     Call RxMinimize RxQueryWindow(RxQueryWindow(window, 'parent'), 'parent')
  172.     
  173.     where RxQueryWindow is described above, and window is the window handle passed to
  174.     all VisPro/REXX events
  175.     
  176. RxRestore Example
  177. -----------------
  178.     Call RxRestore RxQueryWindow(RxQueryWindow(window, 'parent'), 'parent')
  179.     
  180.     where RxQueryWindow is described above, and window is the window handle passed to
  181.     all VisPro/REXX events
  182.  
  183. RxQueryClassName Example
  184. ------------------------
  185.     class = RxQueryClassName(window)
  186.  
  187.     where window is the window handle passed to all VisPro/REXX events
  188.  
  189. RxQueryFonts Example
  190. --------------------
  191.     Call RxQueryFonts window, 'fonts.'
  192.     
  193.     where window is the window handle passed to all VisPro/REXX events
  194.     fonts.0 holds the number of fonts found on return and font.1 to font.n hold a description
  195.     of the fonts, for example '10.System Proportional'.
  196.     
  197.     Currently duplicate fonts are being returned. This will be fixed in a future release
  198.     
  199. RxThread Example
  200. ----------------
  201.  
  202.     ThreadID = RxThread('ProcName', arg1, arg2, arg3)
  203.  
  204.     where ProcName is the name of a SUBPROC and
  205.     arg1, arg2, arg3 can be ANY number of arguments (up to the REXX limit of 16) that
  206.     you would like passed to the subproc.
  207.  
  208.     Note: RxThread will work in a Form Test by loading the SubProc
  209.     from .\SubProcs, if you change the working directory, this
  210.     function may not work as expected.
  211.  
  212.     Limitations: You can't access Form global variables or call other subprocs
  213.     from within a subproc started using RxThread
  214.  
  215.  
  216. RxKillThread Example
  217. --------------------
  218.     result = RxKillThread(ThreadID)
  219.  
  220.     where ThreadID is returned from RxThread
  221.  
  222. RxSuspendThread Example
  223. -----------------------
  224.     result = RxSuspendThread(ThreadID)
  225.  
  226.     where ThreadID is returned from RxThread
  227.  
  228. RxResumeThread Example
  229. ----------------------
  230.     result = RxKillThread(ThreadID)
  231.  
  232.     where ThreadID is returned from RxThread
  233.  
  234. RxChangeThreadPriority Example
  235. ------------------------------
  236.  
  237.     result = RxChangeThreadPriority(threadId, delta)
  238.     
  239.     where threadId is returned from RxThread and
  240.           delta is a number from -31 to +31 or one of the strings 
  241.           'MAXIMUM' or 'MINIMUM'
  242.  
  243. RxSetThreadClass Example
  244. ------------------------
  245.     result = RxSetThreadClass(threadId, class)
  246.  
  247.     where threadId is returned from RxThread and
  248.           class    is one of 'idle', 'regular', 'timecritical' or 'foregroundserver'
  249.           only the first letter is significant
  250.           
  251. RxSetIcon Example
  252. -----------------
  253.     Call RxSetIcon RxQueryWindow(RxQueryWindow(window, 'parent'), 'parent'), value
  254.                         or
  255.     Call RxSetIcon RxQueryWindow(RxQueryWindow(window, 'parent'), 'parent'),  DLLName, ResourceNumber
  256.  
  257.     Where window is passed to all VisPro/REXX events.
  258.     
  259.     The first form of the function gets the icon 'value' from VpLoadPicture,
  260.    which is available on the 'Add' menu of the event coding area.
  261.         
  262.     The second form loads an icon from a DLL. This can be handy for packaging many
  263.     icons, or reusing someone elses icons.
  264.     
  265.     DLLName is either the fully qualified name of a DLL (i.e. 'C:\OS2\DLL\PMWIN.DLL'), or
  266.     the name without the extension (i.e. 'PMWIN').
  267.     
  268.     ResourceNumber is the 'ID' of the bitmap when it was resource compiled into the DLL.
  269.  
  270. RxDrawBitmap Example
  271. --------------------
  272.     Call RxDrawBitmap window, id, value
  273.             or
  274.     Call RxDrawBitmap window, id, DLLName, ResourceNumber
  275.     
  276.     Where window is passed to all VisPro/REXX events,
  277.     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).
  278.     
  279.     The first form of the function gets the icon 'value' from VpLoadPicture,
  280.     which is available on the 'Add' menu of the event coding area.
  281.         
  282.     The second form loads an icon from a DLL. This can be handy for packaging many
  283.     icons, or reusing someone elses icons.
  284.     
  285.     DLLName is either the fully qualified name of a DLL (i.e. 'C:\OS2\DLL\PMWIN.DLL'), or
  286.     the name without the extension (i.e. 'PMWIN').
  287.     
  288.     ResourceNumber is the 'ID' of the bitmap when it was resource compiled into the DLL.
  289.