home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
mnrexx10.zip
/
MNRexx.INF
(
.txt
)
< prev
next >
Wrap
OS/2 Help File
|
1994-09-12
|
66KB
|
3,439 lines
ΓòÉΓòÉΓòÉ 1. Copyright ΓòÉΓòÉΓòÉ
Copyright
Copyright (C) 1994 Makoto Nagata.
All rights reserved.
This software is shareware. You may use and test this software for 14
days, then you have to either register or remove it from your system.
Distribution
The evaluation package may be freely distributed as long as the original
package (MNRexx10.zip) is unmodified. You may not charge more than USD
$5.00 (including shipping and handling) for the distribution of this
package.
Disclaimer
IN NO EVENT SHALL THE AUTHOR (MAKOTO NAGATA) BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHOR
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE AUTHOR (MAKOTO NAGATA) SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
ON AN "AS IS" BASIS, AND THE AUTHOR (MAKOTO NAGATA) HAS NO OBLIGATION TO
PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS (I
will, though).
ΓòÉΓòÉΓòÉ 2. Introduction ΓòÉΓòÉΓòÉ
MNRexx version 1.0
MNRexx is a WPS class that gives you access to WPS objects in Rexx language.
With MNRexx, you can create specialized WPS objects in Rexx. Also an MNRexx
object on the desktop can act as an agent to allow access to WPS objects from
outside of the WPS process.
MNRexx has a general SOM interface with which you can directly call any SOM
method in Rexx (including undocumented WPS methods).
This is version 1.0 release.
This program is tested on OS/2 2.11.
MNRexx is released as shareware (so that I can find out how many people are
out there who care about this kind of product). For registration information,
see Registration.
Any suggestions or bug reports are very welcome. Please contact the author at
the following address:
Makoto Nagata
P.O. Box 26228
San Francisco, CA 94126-6228
U.S.A.
Internet: MNAGATA@CRL.COM
See Also
Registration
Plans
ΓòÉΓòÉΓòÉ 3. Prerequisites ΓòÉΓòÉΓòÉ
To write an MNRexx script, you must be sufficiently fluent in Rexx language
(MNRexx does not teach you how to program in Rexx).
Also, some knowledge of WPS programming is very helpful.
You MUST backup your desktop and your harddisk before developing an MNRexx
script.
Note that your MNRexx script executes in the WPS shell process (and mostly in
the PM thread). As such, MNRexx script should never enter an infinite loop or
wait for an event that never happens (e.g., standard input).
Use an MNRexx object as an agent to access WPS if your script is complex
and/or lengthy (See External Access).
ΓòÉΓòÉΓòÉ 4. LONG Rexx String ΓòÉΓòÉΓòÉ
MNRexx extensibly uses LONG strings - a LONG string is a 4-byte Rexx string
that holds a long integer.
MNRexx provides two data conversion functions:
L2D : converts a LONG string to a decimal integer Rexx string
D2L : converts a decimal integer Rexx string to a LONG string
Some SOM/WPS methods return memory addresses. MNRexx provides a conversion
function that converts a memory address into a Rexx string:
P2R : converts the memory content at a memory address into a Rexx string
Notes
In standard Rexx, you can declare a LONG variable as follows:
a_long = "12345678"x
However, note that the byte order is important - on an Intel machine, this
means hexadecimal 0x78563412, not 0x12345678.
ΓòÉΓòÉΓòÉ 5. Initialization ΓòÉΓòÉΓòÉ
To initialize MNRexx functions, call:
RxFuncAdd 'RxmnInit', 'MNRexx', 'RxmnInit'
call RxmnInit
RxmnInit routine declares all MNRexx functions and constants (you can also
declare function only, constants only, or neither (with minimal
initialization)).
To uninitialize MNRexx functions, call:
call RxmnUnInit
You can register MNRexx functions individually using RxFuncAdd function, but
it is recommended to call RxmnInit function at least with minimal
initialization.
See Also
Direct Method Calls
ΓòÉΓòÉΓòÉ 6. Constants ΓòÉΓòÉΓòÉ
The following constants are declared by RxmnInit function:
NULL = D2L(0)
OBJSTYLE_NOMOVE = D2L(2)
OBJSTYLE_NOLINK = D2L(4)
OBJSTYLE_NOCOPY = D2L(8)
OBJSTYLE_NOTDEFAULTICON = D2L(16)
OBJSTYLE_TEMPLATE = D2L(32)
OBJSTYLE_NODELETE = D2L(64)
OBJSTYLE_NOPRINT = D2L(128)
OBJSTYLE_NODRAG = D2L(256)
OBJSTYLE_NOTVISIBLE = D2L(512)
OBJSTYLE_NOSETTINGS = D2L(1024)
OBJSTYLE_NORENAME = D2L(2048)
CONFIRM_DELETE = D2L(1)
CONFIRM_DELETEFOLDER = D2L(2)
NO_DELETE = D2L(2)
CANCEL_DELETE = D2L(3)
OK_DELETE = D2L(1)
OPEN_DEFAULT = D2L(-28672)
OPEN_TREE = D2L(-28571)
OPEN_DETAILS = D2L(-28570)
OPEN_CONTENTS = D2L(-28671)
OPEN_SETTINGS = D2L(-28670)
OPEN_HELP = D2L(-28669)
OPEN_RUNNING = D2L(-28668)
OPEN_USER = D2L(-2816)
OPEN_PALETTE = D2L(-28551)
CV_ICON = D2L(4)
CV_NAME = D2L(2)
CV_TEXT = D2L(1)
CV_TREE = D2L(64)
CV_DETAIL = D2L(8)
CV_MINI = D2L(32)
CV_FLOW = D2L(16)
FOI_POPULATEDWITHALL = D2L(1)
FOI_POPULATEDWITHFOLDERS = D2L(2)
FOI_WORKAREA = D2L(4)
PROG_DEFAULT = D2L(0)
PROG_PM = D2L(3)
PROG_WINDOWABLEVIO = D2L(2)
PROG_FULLSCREEN = D2L(1)
PROG_WINDOWEDVDM = D2L(7)
PROG_VDM = D2L(4)
PROG_REAL = D2L(4)
PROG_31_STDSEAMLESSVDM = D2L(15)
PROG_31_STDSEAMLESSCOMMON = D2L(16)
PROG_31_ENHSEAMLESSVDM = D2L(17)
PROG_31_ENHSEAMLESSCOMMON = D2L(18)
PROG_31_ENH = D2L(19)
PROG_31_STD = D2L(20)
SHE_VISIBLE = D2L(0)
SHE_INVISIBLE = D2L(1)
SHE_UNPROTECTED = D2L(0)
SHE_PROTECTED = D2L(2)
ICON_FILE = D2L(1)
ICON_RESOURCE = D2L(2)
ICON_DATA = D2L(3)
ICON_CLEAR = D2L(4)
PROGDETAIL_CATEGORY = D2L(1)
PROGDETAIL_VISIBLE = D2L(2)
PROGDETAIL_TITLE = D2L(3)
PROGDETAIL_EXECUTABLE = D2L(4)
PROGDETAIL_PARAMETERS = D2L(5)
PROGDETAIL_STARTUPDIR = D2L(6)
PROGDETAIL_ICON = D2L(7)
PROGDETAIL_ENVIRONMENT = D2L(8)
PROGDETAIL_SWPINITIAL = D2L(9)
WPMENUID_USER = D2L(-2816)
WPMENUID_PRIMARY = D2L(-28672)
WPMENUID_OPEN = D2L(-28671)
WPMENUID_HELP = D2L(-28670)
WPMENUID_PRINT = D2L(-28669)
WPMENUID_SELECT = D2L(-28668)
WPMENUID_SORT = D2L(-28667)
CO_FAILIFEXISTS = D2L(0)
CO_REPLACEIFEXISTS = D2L(1)
CO_UPDATEIFEXISTS = D2L(2)
For better performance, you can declare those constants you need individually.
Notes
WPMENUID_* and OPEN_* identifiers are internally converted to the C/C++
equivalents as follows:
C/C++ ID = MNRexx ID + 0x7000
This conversion is made so that MNRexx ID 0 corresponds to 0x7000 (which
is above C/C++ WPMENUID_USER).
ΓòÉΓòÉΓòÉ 7. Object Handles ΓòÉΓòÉΓòÉ
In MNRexx functions, objects are identified by their handles ('HOBJECT' in
C/C++) which are LONG Rexx strings.
For a file object, use RxmnGetRealName to convert its handle to the filename.
Advanced users can also directly manipulate object pointers (see Direct Method
Calls).
See Also
Direct Method Calls
ΓòÉΓòÉΓòÉ 8. MNRexx Object ΓòÉΓòÉΓòÉ
An MNRexx object is a text file that contains Rexx script to be executed on
various events (e.g., when some objects are dropped on it). When the script
is executed, the first two arguments always contain the following information:
arg(1) : context string which indicates the event that caused this script
to be executed
arg(2) : the handle of the MNRexx object itself
The first word of the context string specifies the event name - version 1.0
supports the following events:
DROP : when objects are dropped on the MNRexx object
In this case, arg(3), arg(4), ..., arg(arg()) contain the handles of
the dropped objects.
SETUP : when the setup string of the MNRexx object is changed (e.g., when
SysSetObjectData function is called by some other process)
In this case, arg(3) contains the new setup string. Use
RxmnGetSetupString to parse the setup string.
MODIFYMENU : when the user opens up the context menu of the MNRexx object
In this case, arg(3) contains the menu handle (a LONG string) of the
popup menu.
You can add your own menu items to the popup menu on this event (see
RxmnInsertMenuItem).
MENUSELECT : when the user selects an user-added menu item
In this case, arg(3) contains the identifier (a LONG string) of the
selected menu item.
You can perform some action according to the selected item.
The rest of the context string is reserved for future enhancements.
When a new MNRexx object is created, a code template is automatically
generated.
An MNRexx object can hold its own persistent instance data to be freely used
by the user (e.g., to keep how many times it is activated). Use
RxmnGetInstanceData and RxmnSetInstanceData functions to get/set the instance
data.
ΓòÉΓòÉΓòÉ 9. Console Window ΓòÉΓòÉΓòÉ
Each MNRexx object has a console window which displays usual Rexx output
(e.g., syntax error information). The console window is automatically opened
when necessary.
To manually open the console window, open the 'open' menu of the MNRexx object
and select 'Console'.
MNRexx supports Rexx 'say' command - the following statement opens up the
console window and displays the message 'hello':
say 'Hello'
The console window behaves like the MNRexx icon itself - i.e.,
- the context menu pops up when you click the right mouse button on the
console window
- dropping objects on the console window is the same as dropping objects
on the icon
- dragging from the console window is the same as dragging the icon (e.g.,
to the shredder)
The console window is editable, and supports standard copy/cut/paste keys.
You can clear the console window from your MNRexx script by using the
following command:
call RxmnClearConsole
See Also
RxmnClearConsole
ΓòÉΓòÉΓòÉ 10. Setup String ΓòÉΓòÉΓòÉ
MNRexx supports the following setup keywords:
MNREXXFILE=filename
this takes the text of the given filename as the MNRexx script
MNREXXDATA=data
this sets up the persistent instance data of the MNRexx object
ΓòÉΓòÉΓòÉ 11. Notes ΓòÉΓòÉΓòÉ
Miscellaneous Notes
Multiple Drag/Drop
When you drag/drop multiple objects on MNRexx, the object from which
you start dragging becomes the first object (i.e., arg(3)).
For example, if you have selected objects A and B, and drag from A
onto an MNRexx object,
arg(3) = object A
arg(4) = object B
and if you start dragging from B,
arg(3) = object B
arg(4) = object A
Starting Executables
You can start a PM program from MNRexx by using 'start' builtin
command. You can also start a non-PM program with 'start', but for
non-PM programs you cannot use startup options like '/MIN'. For
non-PM programs, use PMRexx program (either builtin-one or the one
supplied with this package).
Deleting MNRexx Objects
MNRexx objects are ordinary files, so you can delete them by using
'delete' command.
ΓòÉΓòÉΓòÉ 12. MNRexx Functions by Category ΓòÉΓòÉΓòÉ
Categorized list of MNRexx functions.
ΓòÉΓòÉΓòÉ 12.1. Object Identification ΓòÉΓòÉΓòÉ
To find an object from its object ID or filename:
RxmnQueryObject
To get the filename of a given file object:
RxmnGetRealName
To get the object ID of an object:
RxmnGetObjectID
To set the object ID of an object:
RxmnSetObjectID
To check if an object is an instance of a given class:
RxmnIsA
RxmnIsInstanceOf
To get the class name of an object:
RxmnGetClassName
To find out the parent class of a given class:
RxmnGetParent
ΓòÉΓòÉΓòÉ 12.2. Objects ΓòÉΓòÉΓòÉ
To create a new object:
RxmnCreateObject
To delete an object:
RxmnDelete
To get the title of an object:
RxmnGetTitle
To set the title of an object:
RxmnSetTitle
To move an object:
RxmnMoveObject
To copy an object:
RxmnCopyObject
To make a shadow of an object:
RxmnCreateShadowObject
To open a view of an object:
RxmnOpenView
To close a view of an object:
RxmnCloseView
To get the icon of an object:
RxmnGetIcon
RxmnGetIconData
RxmnGetIconDataType
To set the icon of an object:
RxmnSetIcon
RxmnSetIconData
To get the style of an object:
RxmnGetStyle
To set the style of an object:
RxmnSetStyle
To get the default view of an object:
RxmnGetDefaultView
To set the default view of an object:
RxmnSetDefaultView
ΓòÉΓòÉΓòÉ 12.3. Shadows ΓòÉΓòÉΓòÉ
To check if an object is a shadow or not:
RxmnIsA(object, "WPShadow")
To get the original object of a shadow object:
RxmnGetShadowedObject
To get the list of all shadows of an object:
RxmnGetShadows
To set the title of a shadow object:
RxmnSetShadowTitle
ΓòÉΓòÉΓòÉ 12.4. Folders ΓòÉΓòÉΓòÉ
To check if a given object is a folder or not:
RxmnIsA(object, "WPFolder")
To get the content of a folder:
RxmnGetContents
To delete the contents of a folder:
RxmnDeleteContents
To get the font of a folder view:
RxmnGetFldrFont
To set the font of a folder view:
RxmnSetFldrFont
To get the attribute of a folder view (flowed, mini-icon, etc.):
RxmnGetFldrAttr
To set the attribute of a folder view (flowed, mini-icon, etc.):
RxmnSetFldrAttr
To get the details class of a folder:
RxmnGetFldrDetailsClass
To set the details class of a folder:
RxmnSetFldrDetailsClass
ΓòÉΓòÉΓòÉ 12.5. Program Objects ΓòÉΓòÉΓòÉ
To obtain program object information (e.g., working directory):
RxmnGetProgDetail
To set program object information:
RxmnSetProgDetail
To get association filters and types:
RxmnGetAssociationFilter
RxmnGetAssociationType
To set association filters and types:
RxmnSetAssociationFilter
RxmnSetAssociationType
ΓòÉΓòÉΓòÉ 12.6. MNRexx Object ΓòÉΓòÉΓòÉ
To insert a menu item:
RxmnInsertMenuItem
To parse a setup string:
RxmnGetSetupString
To get instance persistent data:
RxmnGetInstanceData
To set instance persistent data:
RxmnSetInstanceData
To convert an itemID (in DRAGITEM structure) to object handle:
RxmnObjectFromItemID
ΓòÉΓòÉΓòÉ 13. MNRexx Functions by Name ΓòÉΓòÉΓòÉ
This section lists all MNRexx functions.
ΓòÉΓòÉΓòÉ 13.1. L2D ΓòÉΓòÉΓòÉ
Syntax
decimal = L2D(long)
Synopsis
converts a LONG string to decimal
Parameters
long
LONG string
Returns
decimal
decimal string
See Also
LONG Rexx String
D2L
ΓòÉΓòÉΓòÉ 13.2. D2L ΓòÉΓòÉΓòÉ
Syntax
long = L2D(decimal)
Synopsis
converts a decimal string to LONG string
Parameters
decimal
decimal string (e.g., "1")
Returns
long
LONG string
See Also
LONG Rexx String
L2D
ΓòÉΓòÉΓòÉ 13.3. P2R ΓòÉΓòÉΓòÉ
Syntax
image = P2R(pointer, size)
Synopsis
Makes a Rexx string which is a copy of the given memory block
Parameters
pointer
LONG string containing a memory address
size
memory block size in decimal
Returns
image
Rexx string of the given size which is a copy of the memory content
starting at the given pointer address
Notes
If the pointer is known to be the address of a null-terminated string, the
size argument can be omitted. In this case the returned image is a copy
of the null-terminated string.
ΓòÉΓòÉΓòÉ 13.4. RxmnCallMethod ΓòÉΓòÉΓòÉ
Syntax
result = RxmnCallmethod(methodname, interface, arg1, arg2, ...)
Synopsis
calls a method on an object by name
Parameters
methodname
name of the method to be called
interface
method interface definition (see Notes)
arg1, arg2, ...
method arguments
Returns
result
return value defined by the interface definition string (see Notes)
Notes
Interface strings is structured as follows (one character each):
<return type><first argument type><second argument type>...
The following return type characters are supported:
S
string (the result of the method call is assumed to be a
null-terminated string and converted into a Rexx string)
H
WPS object handle (the result is assumed to be a WPS object
pointer and is converted to its handle)
B
Boolean value ("1" or "0"; the result is assumed to be an integer
and any non-zero value is converted to "1")
L, O
4-byte integer (the result is converted into a LONG Rexx string)
And the following argument type characters are supported:
S
string (the Rexx string argument is converted into a
null-terminated string on calling the method)
H
WPS object handle (the argument is converted to a WPS object
pointer on calling the method)
L, O
LONG Rexx string (the argument is converted into a 4-byte integer
on calling the method)
I
SOM ID (the argument Rexx string is converted to SOM ID on calling
the method)
The first argument must be an object (S or H or O) always.
ΓòÉΓòÉΓòÉ 13.5. RxmnClearConsole ΓòÉΓòÉΓòÉ
Syntax
call RxmnClearConsole
Synopsis
clears the console window
See Also
Console Window
ΓòÉΓòÉΓòÉ 13.6. RxmnCloseView ΓòÉΓòÉΓòÉ
Syntax
result = RxmnCloseView(object [, viewID])
Synopsis
closes a view of an object
Parameters
object
object handle
viewID (optional)
view identifier which is one of the following constants:
OPEN_CONTENTS : Open content view for folders only
OPEN_DEFAULT : Open default view (same as double-click)
OPEN_DETAILS : Open details view
OPEN_HELP : Display HelpPanel
OPEN_RUNNING : Execute object
OPEN_SETTINGS : Open settings notebook
OPEN_TREE : Open tree view for folders only
or any user-defined view identifier (see RxmnInsertMenuItem)
if viewID is omitted, all open views are closed.
Returns
result
1 if successful, 0 otherwise
See Also
RxmnOpenView
RxmnGetOpenViews
RxmnInsertMenuItem
ΓòÉΓòÉΓòÉ 13.7. RxmnCopyObject ΓòÉΓòÉΓòÉ
Syntax
copy = RxmnCopyObject(object, folder)
Synopsis
Copies an object into a folder
Parameters
object
the handle of the object to be copied
folder
the handle of the folder into which the object is to be copied
Returns
copy
the handle of the newly created copy, or NULL if unsuccesful (LONG
string)
Notes
Use RxmnQueryObject to obtain the folder handle from an object ID or
pathname
Example
/*** Copys an object into the information folder ***/
folder = RxmnQueryObject("<WP_INFO>")
copy = RxmnCopyObject(object, folder)
See Also
RxmnMoveObject
RxmnCreateShadowObject
RxmnQueryObject
ΓòÉΓòÉΓòÉ 13.8. RxmnCreateObject ΓòÉΓòÉΓòÉ
Syntax
handle = RxmnCreateObject(className, title, setupString, location,
creationFlag)
Synopsis
creates an object
Parameters
className
name of the class (e.g., 'WPDataFile')
title
title of the object to be created
setupString
setup string for the object to be created (e.g.,
'ICONFILE=C:\test.ico')
location
object ID or pathname of a folder in which the object is to be created
(e.g., '<WP_Desktop>')
creationFlags
one of the following constants (LONG string):
CO_FAILIFEXISTS : fails if an object with the same ID already
exists
CO_REPLACEIFEXISTS : if an object with the same ID exists,
replaces it
CO_UPDATEIFEXISTS : if an object with the same ID exists, updates
it (using the given setup string)
Returns
handle
the handle of the newly created (or updated) object, or NULL
Notes
this is equivalent to WinCreateObject API call.
See Also
RxmnDelete
ΓòÉΓòÉΓòÉ 13.9. RxmnCreateShadowObject ΓòÉΓòÉΓòÉ
Syntax
shadow = RxmnCreateShadowObject(object, folder)
Synopsis
Create a shadow of an object in a folder
Parameters
object
the handle of the object to be shadowed
folder
the handle of the folder in which the shadow is to be placed
Returns
shadow
the handle of the newly created shadow object, or NULL if unsuccessful
Notes
Use RxmnQueryObject to obtain the folder handle from an object ID or
pathname
Example
/*** Creates a shadow of the given object in the information folder ***/
folder = RxmnQueryObject("<WP_INFO>")
result = RxmnCreateShadowObject(object, folder)
See Also
RxmnCopyObject
RxmnMoveObject
RxmnQueryObject
ΓòÉΓòÉΓòÉ 13.10. RxmnDelete ΓòÉΓòÉΓòÉ
Syntax
result = RxmnDelete(object, confirmation)
Synopsis
deletes an object
Parameters
object
the handle of the object to be deleted
confirmation
one of the following constants (LONG string):
CONFIRM_DELETE : prompt for confirmation for all objects
CONFIRM_DELETEFOLDER : prompt for confirmation for just folders
NULL : no confirmation
Returns
result
one of the following constants (LONG string):
NO_DELETE : error has occurred and the object was not deleted
CANCEL_DELETE : cancelled by the user
OK_DELETE : the object is successfully deleted
ΓòÉΓòÉΓòÉ 13.11. RxmnDeleteContents ΓòÉΓòÉΓòÉ
Syntax
result = RxmnDeleteContents(folder, confirmations)
Synopsis
deletes the contents of a folder
Parameters
folder
the handle of a folder
confirmations
one of the following constants (LONG string):
CONFIRM_DELETE : Prompt for confirmation for all objects
CONFIRM_DELETEFOLDER : Prompt for confirmation for just folder
objects
NULL : No confirmations
Returns
result
one of the following constants (LONG string):
OK_DELETE : All objects were deleted
NO_DELETE : Error occurred (At least one object was not deleted)
CANCEL_DELETE : User canceled operation
Notes
This function is equivalent to the following call:
result = RxmnCallMethod("wpDeleteContents", "LHL", folder,
confirmations)
ΓòÉΓòÉΓòÉ 13.12. RxmnGetAssociationFilter ΓòÉΓòÉΓòÉ
Syntax
filterList = RxmnGetAssociationFilter(programObject [, stem])
Synopsis
returns the comma-separated list of assocation filters for a program
object (WPProgram or WPProgramFile)
Parameters
programObject
the handle of a program object (WPProgram or WPProgramFile)
stem (optional)
the name of a variable stem to receive association filters
Returns
filterlist
comma-separated list of association filters (e.g., "*.TXT,*.DOC")
stem.0
number of association filters
stem.1, stem.2, ...
association filters
See Also
RxmnGetAssociationType
RxmnSetAssociationFilter
RxmnSetAssociationType
ΓòÉΓòÉΓòÉ 13.13. RxmnGetAssociationType ΓòÉΓòÉΓòÉ
Syntax
typeList = RxmnGetAssociationType(programObject [, stem])
Synopsis
returns the comma-separated list of assocation types for a program object
(WPProgram or WPProgramFile)
Parameters
programObject
the handle of a program object (WPProgram or WPProgramFile)
stem (optional)
the name of a variable stem to receive association types
Returns
typelist
comma-separated list of association types (e.g., "Plain Text,C Code")
stem.0
number of association types
stem.1, stem.2, ...
association types
See Also
RxmnGetAssociationFilter
RxmnSetAssociationFilter
RxmnSetAssociationType
ΓòÉΓòÉΓòÉ 13.14. RxmnGetClassName ΓòÉΓòÉΓòÉ
Syntax
className = RxmnGetClassName(object)
Synopsis
returns the class name of a given object
Parameters
object
the handle of an object
Returns
className
the object's class name, or "" if unsuccessful
See Also
RxmnIsA
RxmnIsInstanceOf
RxmnGetParent
ΓòÉΓòÉΓòÉ 13.15. RxmnGetContents ΓòÉΓòÉΓòÉ
Syntax
result = RxmnGetContents(folder, stemname)
Synopsis
retrieves the contents of a given folder object
Parameters
folder
The handle of a folder
stemname
the name of a Rexx variable that receives the contents of the given
folder
Returns
result
1 if successful, 0 otherwise
stemname.0
the number of members of the given folder
stemname.1, stemname.2, ...
the handles of the objects contained in the given folder
Example
/*** shows the titles of all members of a folder ***/
result = RxmnGetContents(folder, "content")
do i = 1 to content.0
say RxwpQueryTitle(content.i)
end
See Also
RxmnDeleteContents
ΓòÉΓòÉΓòÉ 13.16. RxmnGetDefaultView ΓòÉΓòÉΓòÉ
Syntax
viewID = RxmnGetDefaultView(object)
Synopsis
returns the view ID of the default view of an object
Parameters
object
the handle of an object
Returns
viewID
the default view ID, which may be one of the following constants (LONG
string):
OPEN_CONTENTS : Open content view for folders only
OPEN_DEFAULT : Open default view (same as double-click)
OPEN_DETAILS : Open details view
OPEN_HELP : Display HelpPanel
OPEN_RUNNING : Execute object
OPEN_SETTINGS : Open settings notebook
OPEN_TREE : Open tree view for folders only
Notes
this function is equivalent to the following call:
viewID = RxmnCallMethod("wpQueryDefaultView", "LH", object)
See Also
RxmnSetDefaultView
ΓòÉΓòÉΓòÉ 13.17. RxmnGetFldrAttr ΓòÉΓòÉΓòÉ
Syntax
viewAttributes = RxmnGetFldrAttr(folderObject, viewID)
Synopsis
returns the current container view attributes
Parameters
folderObject
the handle of a folder object (WPFolder)
viewID
folder view identifier, one of the following constants (LONG string):
OPEN_CONTENTS : icon view
OPEN_DETAILS : details view
OPEN_TREE : tree view
Returns
viewAttributes
a LONG string which is a bitwise combination of the following
constants:
CV_ICON : the view is an icon view with text beneath the icons
(Non-Grid)
CV_NAME : the view is an icon view with text to the right of the
icons (Non-Flowed)
CV_TEXT : the view is an icon view with no icons (Invisible Icon)
CV_TREE : the view is a tree view
CV_DETAIL : the view is a details view
CV_MINI : mini-icons are used (Small size Icon)
CV_FLOW : the view is flowed
Notes
this function is equivalent to the following call:
viewAttributes = RxmnCallMethod("wpQueryFldrAttr", "LHL",
folderObject, viewID)
See Also
RxmnSetFldrAttr
ΓòÉΓòÉΓòÉ 13.18. RxmnGetFldrDetailsClass ΓòÉΓòÉΓòÉ
Syntax
className = RxmnGetFldrDetailsClass(folderObject)
Synopsis
returns the class for which details in the folder are displayed
Parameters
folderObject
the handle of a folder object (WPFolder)
Returns
className
name of a WPS class (e.g., "WPDataFile") for which detail data are
displayed
See Also
RxmnSetFldrDetailsClass
ΓòÉΓòÉΓòÉ 13.19. RxmnGetFldrFlags ΓòÉΓòÉΓòÉ
Syntax
flags = RxmnGetFldrFlags(folderObject)
Synopsis
returns the current folder status flags
Parameters
folderObject
object handle of a folder
Returns
flags
bitwise-combination of the following constants:
FOI_POPULATEDWITHALL : the folder is populated with all its
contents
FOI_POPULATEDWITHFOLDERS : the folder is populated with subfolders
FOI_WORKAREA : the folder is a workarea
Notes
this function is equivalent to the following call:
flags = RxmnCallMethod("wpQueryFldrFlags", "LH", folderObject)
See Also
RxmnSetFldrFlags
ΓòÉΓòÉΓòÉ 13.20. RxmnGetFldrFont ΓòÉΓòÉΓòÉ
Syntax
fontName = RxmnGetFldrFont(folderObject, viewID)
Synopsis
returns the name of the font used in a view of a folder
Parameters
folderObject
the handle of a folder object (WPFolder)
viewID
one of the following constants (LONG string):
OPEN_CONTENTS : icon view
OPEN_DETAILS : details view
OPEN_TREE : tree view
Returns
fontName
point size and font name in the following format:
<point size>.<font name> (e.g., "10.Helv")
Notes
this function is equivalent to the following call:
fontName = RxmnCallmethod("wpQueryFldrFont", "SHL", folderObject,
viewID)
See Also
RxmnSetFldrFont
ΓòÉΓòÉΓòÉ 13.21. RxmnGetFolder ΓòÉΓòÉΓòÉ
Syntax
folder = RxmnGetFolder(object)
Synopsis
gets the folder that contains the given object
Parameters
object
the handle of an object
Returns
folder
the handle of the folder that contains the given object
ΓòÉΓòÉΓòÉ 13.22. RxmnGetIcon ΓòÉΓòÉΓòÉ
Syntax
iconHandle = RxmnGetIcon(object)
Synopsis
returns the icon handle of an object
Paramters
object
the handle of an object
Returns
iconHandle
icon handle in LONG format
Notes
This function is equivalent to the following call:
iconHandle = RxmnCallMethod("wpQueryIcon", "LH", object)
In order to get permanent icon information, use RxmnGetIconDataType and
RxmnGetIconData.
See Also
RxmnSetIcon
RxmnSetIconData
RxmnGetIconData
RxmnGetIconDataType
ΓòÉΓòÉΓòÉ 13.23. RxmnGetIconData ΓòÉΓòÉΓòÉ
Syntax
result = RxmnGetIconData(object)
Synopsis
returns the permanent icon data of an object
Parameters
object
the handle of an object
Returns
result
icon data (the format varies according to the type of the permanent
icon data)
Notes
The permanent icon data type is obtained by RxmnGetIconDataType function.
Accoring to the type of the permanent icon data, the result is:
- a filename if the type is ICON_FILE
- 8-byte Rexx string if the type is ICON_RESOURCE, where the first 4
bytes are the module handle in LONG format, and the last 4 bytes are
the resource ID in LONG format
- icon data (of variable length) if the type is ICON_DATA
See Also
RxmnGetIconDataType
RxmnSetIconData
ΓòÉΓòÉΓòÉ 13.24. RxmnGetIconDataType ΓòÉΓòÉΓòÉ
Syntax
iconDataType = RxmnGetIconDataType(object)
Synopsis
returns the type of the permanent icon of the given object
Parameters
object
the handle of an object
Returns
iconDataType
one of the following constants (LONG string):
ICON_FILE if the icon is taken from a file
ICON_RESOURCE if the icon is taken from a resouce
ICON_DATA if the icon is stored as a bitmap data
Notes
the icon data is retrieved with RxmnGetIconData
See Also
RxmnGetIconData
RxmnSetIconData
ΓòÉΓòÉΓòÉ 13.25. RxmnGetInstanceData ΓòÉΓòÉΓòÉ
Syntax
data = RxmnGetInstanceData(mnrexxObject)
Synopsis
returns the persistent data of an MNRexx object
Parameters
mnrexxObject
the handle of an MNRexx object
Returns
data
persistent data Rexx string
See Also
RxmnSetInstanceData
ΓòÉΓòÉΓòÉ 13.26. RxmnGetObjectID ΓòÉΓòÉΓòÉ
Syntax
objectID = RxmnGetObjectID(object)
Synopsis
returns the object ID of an object
Parameters
object
the handle of an object
Returns
objectID
the object ID (e.g., "<WP_INFO>") of the given object, or "" if no ID
is given
See Also
RxmnSetObjectID
ΓòÉΓòÉΓòÉ 13.27. RxmnGetOpenViews ΓòÉΓòÉΓòÉ
Syntax
result = RxmnGetOpenViews(object, stem)
Synopsis
returns the list of all current open view IDs
{Parameters
object
the handle of an object
stem
stem variable name to return the list of open view IDs
Returns
result
1 if successful, 0 otherwise
stem.0
number of current open views
stem.1, stem.2, ...
view IDs of open views, one of the following constants (LONG string):
OPEN_CONTENTS : Open content view for folders only
OPEN_DEFAULT : Open default view (same as double-click)
OPEN_DETAILS : Open details view
OPEN_HELP : Display HelpPanel
OPEN_RUNNING : Execute object
OPEN_SETTINGS : Open settings notebook
OPEN_TREE : Open tree view for folders only
Notes
if the object supports concurrent views, the returned list may contain
duplicates
See Also
RxmnOpenView
RxmnCloseView
ΓòÉΓòÉΓòÉ 13.28. RxmnGetParent ΓòÉΓòÉΓòÉ
Syntax
parentClassName = RxmnGetParent(className)
Synopsis
returns the name of the parent class of a given class
Parameters
className
class name
Returns
parentClassName
the name of the parent class, or "" if no parent class is available
Example
/*** prints the class hierarchy ***/
className = "WPIcon"
do while className \= ""
say className
className = RxmnGetParent(className)
end
See Also
RxmnIsA
RxmnIsInstanceOf
RxmnGetClassName
ΓòÉΓòÉΓòÉ 13.29. RxmnGetProgDetail ΓòÉΓòÉΓòÉ
Syntax
result = RxmnGetProgDetail(program, item)
Synopsis
retrieves information from a program object (either WPProgram or
WPProgramFile)
Parameters
program
the handle of a program object (WPProgam or WPProgramFile)
item
item code (See Notes)
Returns
result
program object item (See Notes)
Notes
The item code can be one of the following constants (LONG string):
PROGDETAIL_CATEGORY : program category
result is one of the following constants:
PROG_DEFAULT : application default
PROG_PM : OS/2 PM
PROG_WINDOWABLEVIO : OS/2 window
PROG_FULLSCREEN : OS/2 full screen
PROG_WINDOWDVDM : DOS window
PROG_VDM : DOS full screen
PROG_REAL : DOS full screen
PROG_31_STDSEAMLESSVDM : Windows 3.1 seamless separate session
PROG_31_STDSEAMLESSCOMMON : Windows 3.1 seamless common
session
PROG_31_ENHSEAMLESSVDM : Window 3.1 Enhanced seamless separate
session
PROG_31_ENHSEAMLESSCOMMON : Window 3.1 Enhanced seamless
common session
PROG_31_ENH : Windows 3.1 enhanced fullscreen
PROG_31_STD : Windows 3.1 standard full screen
PROGDETAIL_VISIBLE : program visibility
result is a LONG Rexx string which is a bitwise combination of the
following constants:
SHE_VISIBLE or SHE_INVISIBLE : visible or not
SHE_UNPROTECTED or SHE_PROTECTED : protected or not
PROGDETAIL_TITLE : program title
PROGDETAIL_EXECUTABLE : executable name
PROGDETAIL_PARAMETERS : parameters list
PROGDETAIL_STARTUPDIR : startup directory
PROGDETAIL_ICON : program icon filename
PROGDETAIL_ENVIRONMENT : environment string
for these item codes, the result is a Rexx string
PROGDETAIL_SWPINITIAL : initial window position structure
the result is a 36-byte Rexx string (9 LONG strings)
See Also
RxmnSetProgDetail
ΓòÉΓòÉΓòÉ 13.30. RxmnGetRealName ΓòÉΓòÉΓòÉ
Syntax
realName = RxmnGetRealName(fileObject)
Synopsis
returns the file system name of a WPFileSystem object (files and
directories)
Parameters
fileObject
the handle of a WPFileSystem object
Returns
realName
the real name of the given WPFileSystem object (e.g., "C:\Desktop")
ΓòÉΓòÉΓòÉ 13.31. RxmnGetSetupString ΓòÉΓòÉΓòÉ
Syntax
value = RxmnGetSetupString(object, setupString, key)
Synopsis
parses a given setup string and returns the value corresponding to the
given key
Parameters
object
the handle of an object
setupString
object setup string (e.g., "OBJECTID=<Hello>;ICONFILE=C:\JUNK.ICO;")
key
key string (e.g., "ICONFILE")
Returns
value
The key value (e.g., "C:\JUNK.ICO") or empty string ("") if the key is
not found
Notes
This is mainly used on the event SETUP
See Also
MNRexx Script
ΓòÉΓòÉΓòÉ 13.32. RxmnGetShadowedObject ΓòÉΓòÉΓòÉ
Syntax
originalObject = RxmnGetShadowedObject(shadowObject)
Synopsis
returns the original object of a shadow
Parameters
shadowObject
the handle of a shadow object (WPShadow)
Returns
originalObject
the handle of the the original object or NULL if unsuccessful (LONG
string)
Notes
This function is equivalent to the following call:
originalObject = RxmnCallMethod("wpQueryShadowedObject", "HH",
shadowObject)
See Also
RxmnGetShadows
RxmnSetShadowTitle
ΓòÉΓòÉΓòÉ 13.33. RxmnGetShadows ΓòÉΓòÉΓòÉ
Syntax
result = RxmnGetShadows(object, stem)
Synopsis
enumerates all shadow objects of a given object
Parameters
object
the handle of an object
stem
variable name to receive the list of shadow objects
Returns
result
1 if successful, 0 otherwise
stem.0
number of shadow objects
stem.1, stem.2, ...
handles of shadow objects
Example
/*** lists all shadows ***/
result = RxmnGetShadows(object, "shadow")
do i = 1 to shadow.0
say shadow.i
end
See Also
RxmnGetShadowedObject
RxmnSetShadowTitle
ΓòÉΓòÉΓòÉ 13.34. RxmnGetStyle ΓòÉΓòÉΓòÉ
Syntax
style = RxmnGetStyle(object)
Synopsis
returns the style flags of an object
Parameters
object
the handle of an object
Returns
style
style flags in LONG format (See Notes)
Notes
The returned style is a bitwise combination of the following constants:
OBJSTYLE_NOCOPY : Cannot be copied
OBJSTYLE_NODELETE : Cannot be deleted
OBJSTYLE_NODRAG : Cannot be dragged
OBJSTYLE_NOSHADOW : Cannot have shadow created
OBJSTYLE_NOMOVE : Cannot move
OBJSTYLE_NOPRINT : Cannot be printed
OBJSTYLE_NOTDEFAULTICON : Destroy icon when object goes dormant
OBJSTYLE_TEMPLATE : This object is a template
OBJSTYLE_NOTVISIBLE : The object is hidden
OBJSTYLE_NORENAME : Cannot be renamed
00.
This function is equivalent to the following call:
style = RxmnCallMethod("wpQueryStyle", "LH", object)
Example
/*** checks if an object is deletable ***/
style = RxmnGetStyle(object)
if bitand(style, OBJSTYLE_NODELETE) \= NULL then
do
say "object is not deletable"
end
else
do
say "object is deletable"
end
See Also
RxmnSetStyle
ΓòÉΓòÉΓòÉ 13.35. RxmnGetTitle ΓòÉΓòÉΓòÉ
Syntax
title = RxmnGetTitle(object)
Synopsis
returns the title of an object
Parameters
object
the handle of an object
Returns
title
object's title
See Also
RxmnSetTitle
ΓòÉΓòÉΓòÉ 13.36. RxmnGetType ΓòÉΓòÉΓòÉ
Syntax
typeList = RxmnGetType(fileObject [, stem])
Synopsis
returns the list of file types
Parameters
fileObject
the handle of a data file object (WPDataFile)
stem (optional)
stem variable to receive the list of file types
Returns
typeList
newline-delimited list of file types
stem.0 (optional)
number of file types
stem.1, stem.2, ...
file types
Example
/*** list file types ***/
typeList = RxmnGetType(object, "filetype")
do i = 1 to filetype.0
say filetype.i
end
See Also
RxmnSetType
ΓòÉΓòÉΓòÉ 13.37. RxmnInit ΓòÉΓòÉΓòÉ
Syntax
call RxmnInit [option]
Synopsis
initializes MNRexx
Parameters
option (optional)
optional string to control the initialization:
"F" : declare functions, not constants
"C" : declare constants, not functions
"N" : declare neither functions nor constants
if no option is given, both functions and constants are declared.
Notes
This routine declares all MNRexx functions and constants.
A variable SOMClassMgrObject (a LONG string) is always declared. This
variable can be used to access SOM/WPS methods directly (see Direct Method
Calls).
Also a variable _WPObject (a LONG string) is always declared. This
variable can be used to access WPS class methods directly (see Direct
Method Calls).
A variable MNRexx contains the list of all declared constants
(space-separated).
You can use this variable to expose all constants to a procedure as
follows:
foo: procedure expose (MNRexx)
See Also
RxmnUninit
Direct Method Calls
ΓòÉΓòÉΓòÉ 13.38. RxmnInsertMenuItem ΓòÉΓòÉΓòÉ
Syntax
result = RxmnInsertMenuItem(menuHandle, parentID, itemID, itemAttribute,
itemText [, xsize, ysize])
Synopsis
inserts an item to the context menu of an MNRexx object
Parameters
menuHandle
context menu handle (LONG string)
parentID
parent submenu ID, either your own or one of the following constants
(LONG string):
WPMENUID_PRIMARY : primary level (i.e., the same level as 'open'
or 'delete')
WPMENUID_OPEN : under 'OPEN' submenu
WPMENUID_HELP : under 'Help' submenu
WPMENUID_PRINT : under 'Print' submenu
itemID
the ID of this item (LONG string).
the ID can be any non-negative LONG integer (i.e., L2D(0), L2D(1),
L2D(2), ...).
itemAttribute
the attribute of this menu item, a string which is a combination of
the following characters:
_ (underscore) : break (this item starts a new menu row or column)
| (bar) : break separator (same as break, except that it draws a
separator between rows and columns)
. (period) : static (information only, not selectable)
> (greater than) : checked
! (exclamation) : hilited
0 (zero) : disabled
# (pound) : framed (a frame is drawn around the item)
& (and) : no dismiss (the containing submenu doesn't close when
this item is selected)
itemText
the text of this item
when this string starts with a '#' (pound) symbol, special kinds of
items are inserted:
#- (pound minus) : a separator (dividing line)
#* (pound star) : submenu
#+ (pound plus) : conditional-cascade submenu
#I <pound i) : icon item, followed immediately by the filename or
object ID from which the icon is taken (e.g., #IC:\OS2\CLIPOS2.EXE
or #I<WP_INFO>)
xsize (optional)
for icon items, this decimal string sets the horizontal size of the
icon bitmap.
the default is the standard system icon size.
ysize (optional)
for icon items, this decimal string sets the vertical size of the icon
bitmap.
If only xsize is given, ysize is assumed to be the same as the given
xsize.
Returns
<result
inserted position (LONG string)
Notes
This is mainly used on the event MODIFYMENU.
Example
/*** define LONG item identifiers ***/
textitem1 = D2L(0)
submenu1 = D2L(1)
textitem2 = D2L(2)
iconitem = D2L(3)
/*** add textitem1 in "OPEN" submenu ***/
rc = RxmnInsertMenuItem(menu, WPMENUID_OPEN, textitem1, , "Hello World")
/*** no attribute ***/
/*** add a submenu1 at the primary level ***/
rc = RxmnInsertMenuItem(menu, WPMENUID_PRIMARY, submenu1, , "#*Submenu")
/*** add a checked text item2 in submenu1 ***/
rc = RxmnInsertMenuItem(menu, submenu1, textitem2, ">", "checked");
/*** add an icon of the clipboard viewer in submenu1 ***/
rc = RxmnInsertMenuItem(menu, submenu1, iconitem, ,
"#IC:\OS2\CLIPOS2.EXE")
See Also
MNRexx Script
ΓòÉΓòÉΓòÉ 13.39. RxmnIsA ΓòÉΓòÉΓòÉ
Syntax
result = RxmnIsA(object, className)
Synopsis
checks if an object is an instance of (any descendent class of) the given
class
Parameters
object
the handle of an object
className
the name of a class (e.g., "WPFileSystem")
Returns
result
1 if the object is an instance of some descendent class of the given
class, 0 otherwise
Example
/*** checks if an object is a file system object ***/
if RxmnIsA(object, "WPFileSystem") then
do
say "this is a file"
end
else
do
say "this is not a file"
end
See Also
RxmnIsInstanceOf
RxmnGetClassName
ΓòÉΓòÉΓòÉ 13.40. RxmnIsInstanceOf ΓòÉΓòÉΓòÉ
Syntax
result = RxmnIsInstanceOf(object, className)
Synopsis
checks if an object is an instance of the given class (and not of a
descendent class)
Parameters
object
the handle of an object
className
the name of a class (e.g., "WPIcon")
Returns
result
1 if the object is an instance of the given class, 0 otherwise
Example
/*** checks if an object is an instance of WPFolder class ***/
if RxmnIsInstanceOf(object, "WPFolder") then
do
say "this is a WPFolder"
end
else
do
say "this is not a WPFolder"
end
Notes
To find out whether an object is an instance of any descendent class of a
given class, use RxmnIsA.
See Also
RxmnIsA
RxmnGetClassName
ΓòÉΓòÉΓòÉ 13.41. RxmnMoveObject ΓòÉΓòÉΓòÉ
Syntax
result = RxmnMoveObject(object, folder)
Synopsis
moves an object into a folder
Parameters
object
the handle of an object to be moved
folder
the handle of the folder into which the object is to be moved
Returns
result
1 if successful, 0 otherwise
Notes
Use RxmnQueryObject to obtain the folder handle from an object ID or
pathname.
Example
/*** moves an object into the information folder ***/
folder = RxmnQueryObject("<WP_INFO>")
result = RxmnMoveObject(object, folder)
See Also
RxmnCopyObject
RxmnCreateShadowObject
RxmnQueryObject
ΓòÉΓòÉΓòÉ 13.42. RxmnObjectFromItemID ΓòÉΓòÉΓòÉ
[This is for advanced users only]
Syntax
handle = RxmnObjectFromItemID(itemID)
Synopsis
returns the object handle corresponding to the itemID in the DRAGITEM
structure
Parameters
itemID
the itemID in the DRAGITEM structure (LONG string).
Returns
handle
the handle of the corresponding object
Notes
This is to support a PM program that needs to accept drag/drop of WPS
objects.
When a DRAGITEM is a WPS object (i.e., when DrgVerifyRMF(pdrgItem,
"DRM_OBJECT", "DRF_OBJECT") is TRUE), the itemID field of the DRAGITEM
contains an identifier for the dragged/dropped object (actually the
MINIRECORDCORE pointer to the shared container record). By sending the
itemID to an MNRexx object via SysSetObjectData or WinSetObjectData, you
can access the object.
Warning: Sending an invalid itemID to this routine causes system crash.
See Also
External Access
ΓòÉΓòÉΓòÉ 13.43. RxmnOpenView ΓòÉΓòÉΓòÉ
Syntax
viewHandle = RxmnOpenView(object [, viewID])
Synopsis
opens a view of an object
Parameters
object
the handle of an object
viewID (optional)
view identifier which may be one of the following constants (LONG
string):
OPEN_CONTENTS : Open content view for folders only
OPEN_DEFAULT : Open default view (same as double-click)
OPEN_DETAILS : Open details view
OPEN_HELP : Display HelpPanel
OPEN_RUNNING : Execute object
OPEN_SETTINGS : Open settings notebook
OPEN_TREE : Open tree view for folders only
if viewID is omitted, the default view is opened.
Returns
viewHandle
the opened window handle (HWND) in LONG format, or NULL if
unsuccessful
See Also
RxmnCloseView
RxmnGetOpenViews
ΓòÉΓòÉΓòÉ 13.44. RxmnQueryObject ΓòÉΓòÉΓòÉ
Syntax
object = RxmnQueryObject(objectID)
Synopsis
finds the persistent object handle fo the object with given objectID or
filename
Parameters
objectID
object identifier (e.g., "<WP_DESKTOP>") or filename (e.g.,
"C:\Desktop")
Returns
object
the handle of the object or NULL if the object is not found (LONG
string)
ΓòÉΓòÉΓòÉ 13.45. RxmnSetAssociationFilter ΓòÉΓòÉΓòÉ
Syntax
result = RxmnSetAssociationFilter(programObject, filterList)
Synopsis
sets the assocition filter list of a program object (WPProgram or
WPProgramFile)
Parameters
programObject
the handle of a program object (WPProgram or WPProgramFile)
typeList
comma-separated list of associated filters
Returns
result
1 if successful, 0 otherwise
See Also
RxmnGetAssociationFilter
RxmnSetAssociationType
RxmnGetAssociationType
ΓòÉΓòÉΓòÉ 13.46. RxmnSetAssociationType ΓòÉΓòÉΓòÉ
Syntax
result = RxmnSetAssociationType(programObject, typeList)
Synopsis
sets the assocition type list of a program object (WPProgram or
WPProgramFile)
Parameters
programObject
the handle of a program object (WPProgram or WPProgramFile)
typeList
comma-separated list of associated types
Returns
result
1 if successful, 0 otherwise
See Also
RxmnGetAssociationType
RxmnSetAssociationFilter
RxmnGetAssociationFilter
ΓòÉΓòÉΓòÉ 13.47. RxmnSetDefaultView ΓòÉΓòÉΓòÉ
Syntax
result = RxmnSetDefaultView(object, viewID)
Synopsis
sets the default view of an object
Parameters
object
the handle of an object
viewID
view ID, which may be one of the following constants (LONG string):
OPEN_CONTENTS : Open content view for folders only
OPEN_DEFAULT : Open default view (same as double-click)
OPEN_DETAILS : Open details view
OPEN_HELP : Display HelpPanel
OPEN_RUNNING : Execute object
OPEN_SETTINGS : Open settings notebook
OPEN_TREE : Open tree view for folders only
Returns
result
1 if successful, 0 otherwise
See Also
RxmnGetDefaultView
ΓòÉΓòÉΓòÉ 13.48. RxmnSetFldrAttr ΓòÉΓòÉΓòÉ
Syntax
result = RxmnSetFldrAttr(folderObject, viewAttributes, viewID)
Synopsis
returns the current container view attributes
Parameters
folderObject
the handle of a folder object (WPFolder)
viewAttributes
a LONG string which is a bitwise combination of the following
constants:
CV_ICON : the view is an icon view with text beneath the icons
(Non-Grid)
CV_NAME : the view is an icon view with text to the right of the
icons (Non-Flowed)
CV_TEXT : the view is an icon view with no icons (Invisible Icon)
CV_TREE : the view is a tree view
CV_DETAIL : the view is a details view
CV_MINI : mini-icons are used (Small size Icon)
CV_FLOW : the view is flowed
viewID
folder view identifier, one of the following constants (LONG string):
OPEN_CONTENTS : icon view
OPEN_DETAILS : details view
OPEN_TREE : tree view
Returns
result
1 if successful, 0 otherwise
Notes
this function is equivalent to the following call:
result = RxmnCallMethod("wpSetFldrAttr", "LHLL", folderObject,
viewAttributes, viewID)
See Also
RxmnGetFldrAttr
ΓòÉΓòÉΓòÉ 13.49. RxmnSetFldrDetailsClass ΓòÉΓòÉΓòÉ
Syntax
result = RxmnSetFldrDetailsClass(folderObject, className)
Synopsis
sets the class for which details in the folder will be displayed
Parameters
folderObject
the handle of a folder object (WPFolder)
className
name of a WPS class (e.g., "WPDataFile")
Returns
result
1 if successful, 0 otherwise
See Also
RxmnGetFldrDetailsClass
ΓòÉΓòÉΓòÉ 13.50. RxmnSetFldrFlags ΓòÉΓòÉΓòÉ
Syntax
result = RxmnSetFldrFlags(folderObject, flags)
Synopsis
sets the folder flags
Parameters
folderObject
the handle of a folder
flags
bitwise-combination of the following constants:
FOI_POPULATEDWITHALL : the folder is populated with all its
contents
FOI_POPULATEDWITHFOLDERS : the folder is populated with subfolders
FOI_WORKAREA : the folder is a workarea
Returns
result
1 if successful, 0 otherwise
Notes
this function is equivalent to the following call:
result = RxmnCallMethod("wpSetFldrFlags", "BHL", folderObject, flags)
See Also
RxmnGetFldrFlags
ΓòÉΓòÉΓòÉ 13.51. RxmnSetFldrFont ΓòÉΓòÉΓòÉ
Syntax
result = RxmnSetFldrFont(folderObject, fontName, viewID)
Synopsis
sets the font to be used in a view of a folder
Parameters
folderObject
the handle of a folder object (WPFolder)
fontName
point size and font name in the following format:
<point size>.<font name> (e.g., "10.Helv")
viewID
one of the following constants (LONG string):
OPEN_CONTENTS : icon view
OPEN_DETAILS : details view
OPEN_TREE : tree view
Returns
result
1 if successful, 0 otherwise
Notes
this function is equivalent to the following call:
result = RxmnCallmethod("wpSetFldrFont", "BHSL", folderObject,
fontName, viewID)
See Also
RxmnGetFldrFont
ΓòÉΓòÉΓòÉ 13.52. RxmnSetIcon ΓòÉΓòÉΓòÉ
Syntax
result = RxmnSetIcon(object, iconHandle)
Synopsis
sets an object's icon
Parameters
object
the handle of an object
iconHandle
icon handle in LONG format
Returns
result
1 if successful, 0 otherwise
Notes
This call changes the visible icon only.
In order to change the icon permanently, use RxmnSetIconData.
This function is equivalent to the following call:
result = RxmnCallMethod("wpSetIcon", "BHL", object, iconHandle)
See Also
RxmnGetIcon
RxmnSetIconData
RxmnGetIconData
RxmnGetIconDataType
ΓòÉΓòÉΓòÉ 13.53. RxmnSetIconData ΓòÉΓòÉΓòÉ
Syntax
result = RxmnSetIconData(object, type, value)
Synopsis
sets the object's permanent icon
Parameters
object
the handle of an object
type
permanent icon data type (see Notes)
value
permanent icon data (see Notes)
Returns
result
1 if successful, 0 otherwise
Notes
the icon data type is obtained with RxmnGetIconDataType.
the value type varies according to the type.
Example
/*** changes object B's icon to object A's permanently ***/
type = RxmnGetIconDataType(A)
value = RxmnGetIconData(A)
result = RxmnSetIconData(type, value)
See Also
RxmnGetIconDataType
RxmnGetIconData
ΓòÉΓòÉΓòÉ 13.54. RxmnSetInstanceData ΓòÉΓòÉΓòÉ
Syntax
result = RxmnSetInstanceData(mnrexxObject, data)
Synopsis
sets the persistent data of an MNRexx object
Parameters
mnrexxObject
the handle of an MNRexx object
data
new persistent data Rexx string
Returns
result
1 if successful, 0 otherwise
See Also
RxmnGetInstanceData
ΓòÉΓòÉΓòÉ 13.55. RxmnSetObjectID ΓòÉΓòÉΓòÉ
Syntax
result = RxmnSetObjectID(object, ID)
Synopsis
sets the object ID of an object
Parameters
object
the handle of an object
ID
a string
Returns
result
1 if successful, 0 otherwise
See Also
RxmnGetObjectID
ΓòÉΓòÉΓòÉ 13.56. RxmnSetProgDetail ΓòÉΓòÉΓòÉ
Syntax
result = RxmnSetProgDetail(program, item, value)
Synopsis
sets information of a program object (either WPProgram or WPProgramFile)
Parameters
program
the handle of a program object (WPProgram or WPProgramFile)
item
item code (See Notes)
value
item value (See Notes)
Returns
result
1 if successful, 0 otherwise
Notes
The item code can be one of the following constants:
PROGDETAIL_CATEGORY : program category
value is one of the following constants:
PROG_DEFAULT : application default
PROG_PM : OS/2 PM
PROG_WINDOWABLEVIO : OS/2 window
PROG_FULLSCREEN : OS/2 full screen
PROG_WINDOWDVDM : DOS window
PROG_VDM : DOS full screen
PROG_REAL : DOS full screen
PROG_31_STDSEAMLESSVDM : Windows 3.1 seamless separate session
PROG_31_STDSEAMLESSCOMMON : Windows 3.1 seamless common
session
PROG_31_ENHSEAMLESSVDM : Window 3.1 Enhanced seamless separate
session
PROG_31_ENHSEAMLESSCOMMON : Window 3.1 Enhanced seamless
common session
PROG_31_ENH : Windows 3.1 enhanced fullscreen
PROG_31_STD : Windows 3.1 standard full screen
PROGDETAIL_VISIBLE : program visibility
value is a LONG Rexx string which is a bitwise combination of the
following constants:
SHE_VISIBLE or SHE_INVISIBLE : visible or not
SHE_UNPROTECTED or SHE_PROTECTED : protected or not
PROGDETAIL_TITLE : program title
PROGDETAIL_EXECUTABLE : executable name
PROGDETAIL_PARAMETERS : parameters list
PROGDETAIL_STARTUPDIR : startup directory
PROGDETAIL_ICON : program icon filename
PROGDETAIL_ENVIRONMENT : environment string
for these item codes, the value is a Rexx string
PROGDETAIL_SWPINITIAL : initial window position structure
the value is a 36-byte Rexx string (9 LONG strings)
See Also
RxmnGetProgDetail
ΓòÉΓòÉΓòÉ 13.57. RxmnSetShadowTitle ΓòÉΓòÉΓòÉ
Syntax
result = RxmnSetShadowTitle(object, title)
Synopsis
sets the title of a shadow object (which is usually the title of the
shadowed object)
Parameters
object
the handle of an object
title
new title string
Returns
result
1 if successful, 0 otherwise
See Also
RxmnGetShadowedObject
RxmnGetShadows
ΓòÉΓòÉΓòÉ 13.58. RxmnSetStyle ΓòÉΓòÉΓòÉ
Syntax
result = RxmnSetStyle(object, style)
Synopsis
sets the style flags of an object
Parameters
object
the handle of an object
style
style flags in LONG format (see Notes)
Returns
result
1 if successful, 0 otherwise
Notes
The style is a bitwise combination of the following constants:
OBJSTYLE_NOCOPY : Cannot be copied
OBJSTYLE_NODELETE : Cannot be deleted
OBJSTYLE_NODRAG : Cannot be dragged
OBJSTYLE_NOSHADOW : Cannot have shadow created
OBJSTYLE_NOMOVE : Cannot move
OBJSTYLE_NOPRINT : Cannot be printed
OBJSTYLE_NOTDEFAULTICON : Destroy icon when object goes dormant
OBJSTYLE_TEMPLATE : This object is a template
OBJSTYLE_NOTVISIBLE : The object is hidden
OBJSTYLE_NORENAME : Cannot be renamed
This function is equivalent to the following call:
result = RxmnCallMethod("wpSetStyle", "BHL", object, style)
See Also
RxmnGetStyle
ΓòÉΓòÉΓòÉ 13.59. RxmnSetTitle ΓòÉΓòÉΓòÉ
Syntax
result = RxmnSetTitle(object, title)
Synopsis
sets the title of an object
Parameters
object
the handle of an object
title
new title
Returns
result
1 if successful, 0 otherwise
Notes
This function is equivalent to the following call:
result = RxmnCallMethod("wpSetTitle", "BHS", object, title)
See Also
RxmnGetTitle
ΓòÉΓòÉΓòÉ 13.60. RxmnSetType ΓòÉΓòÉΓòÉ
Syntax
result = RxmnSetType(fileObject, typeList)
Synopsis
sets the file type of a file object
Parameters
fileObject
the handle of a data file object (WPDataFile)
typeList
newline ("0a"x) delimited list of file types
Returns
result
1 if successful, 0 otherwise
Example
/*** sets the type of a file ***/
rc = RxmnSetType(object, "C Code" || "0a"x || "Ami Pro Document")
/*** sets the type of a file from a stem list ***/
filetype.0 = 2
filetype.1 = "C Code"
filetype.2 = "Ami Pro Document"
typeList = ""
do i = 1 to filetype.0
typeList = typeList || filetype.i || "0a"x
end
rc = RxmnSetType(object, typeList)
Notes
this function is equivalent to the following call:
result = RxmnCallMethod("wpSetType", "BHS", fileObject, typeList)
See Also
RxmnGetType
ΓòÉΓòÉΓòÉ 13.61. RxmnUninit ΓòÉΓòÉΓòÉ
Syntax
call RxmnUninit
Synopsis
uninitializes MNRexx library
Notes
this undeclares all MNRexx functions
See Also
RxmnInit
ΓòÉΓòÉΓòÉ 14. Advanced Topics ΓòÉΓòÉΓòÉ
This section discusses advanced topics.
ΓòÉΓòÉΓòÉ 14.1. Direct Method Calls ΓòÉΓòÉΓòÉ
[This is for advanced users with access to the developers toolkit]
With RxmnCallMethod function, you can directly invoke SOM/WPS methods on an
object.
In order to convert MNRexx object handle to its object pointer, you can use
_WPObject
constant as follows:
pointer = RxmnCallMethod("wpclsQueryObject", "OOL", _WPObject,
objectHandle)
Here the handle is passed as a long integer, and the returned value is the
pointer (in LONG format) to the object identified by the given object handle.
To call a method on an object pointer, you can use 'O' as the first argument
type:
style = RxmnCallMethod("wpQueryStyle", "LO", pointer)
Note that you need to 'unlock' the object later by the following call:
result = RxmnCallMethod("wpUnlockObject", "BO", pointer)
Also, you are responsible for serializing access to WPS objects.
If you need memory pointers, you can call 'wpAllocMem' and 'wpFreeMem' as
follows:
memoryPointer = RxmnCallMethod("wpAllocMem", "LHDL", objectHandle, size,
NULL)
result = RxmnCallmethod("wpFreeMem", "BHL", objectHandle, memoryPointer)
To convert a memory address to a Rexx string, use P2R function.
ΓòÉΓòÉΓòÉ 14.2. Class Objects ΓòÉΓòÉΓòÉ
[This is for advanced users with access to the developers toolkit]
On initialization, MNRexx defines the following class object variables:
SOMClassMgrObject: (LONG) the unique instance of the SOM class manager
object in the WPS process
_WPObject: (LONG) WPS object class object
Using these constants with RxmnCallMethod function, you can obtain class
objects as follows:
_WPIcon = RxmnCallmethod("somFindClass", "OOIDD", SOMClassMgrObject,
"WPIcon", 0, 0)
You can invoke a class method on a class object as follows:
className = RxmnCallMethod("somGetName", "SO", _WPIcon)
See Also
RxmnCallmethod
ΓòÉΓòÉΓòÉ 14.3. External Access to WPS ΓòÉΓòÉΓòÉ
To access WPS objects from an external Rexx command script:
1) call SysSetObjectData utility function to send the command to be
executed in the WPS process to an MNRexx object; this causes a SETUP event
(i.e., the MNRexx script is called with 'SETUP' context string) (see
MNRexx Object);
2) if you need to receive the result from the MNRexx object (e.g., the
title of an object), use RxQueue function in your MNRexx script to push
the result to some queue;
3) use RxQueue function in your external script to pull the result from
the queue.
To access WPS objects from an external C/C++ program:
1) use WinSetObjectData instead of SysSetObjectData to send some command
to an MNRexx object;
2) if you need to receive the result from the MNRexx object, either use
RxQueue APIs or use some other form of inter-process communication. Dave
Boll's famous Ydbautil package supports various IPC mechanisms in Rexx.
If your program receives drag/drop of WPS objects, send the itemID in the
DRAGITEM structure to an MNRexx object and use RxmnObjectFromItemID to convert
it to the corresponding object handle.
ΓòÉΓòÉΓòÉ 15. Registration ΓòÉΓòÉΓòÉ
To register MNRexx, send USD $15.00 (check or money order) with:
- the name of the product (MNRexx 1.0)
- your name
- your company or school name
- your postal mailing address
- your daytime phone number
- your email address (optional)
to:
Makoto Nagata
P.O. Box 26228
San Francisco, CA 94126-6228
U.S.A.
A text file (register.frm) is included in the package for you convenience.
Registered users will receive all future upgrades and technical support on
internet for free.
ΓòÉΓòÉΓòÉ 16. Plans ΓòÉΓòÉΓòÉ
Future Plans
- 'pull' command support
- more events to be handled
- Rexx GUI tools (e.g., Vispro/Rexx or VX-REXX) integration (views and
settings pages)
- performance enhancements
- more samples
- integration with folder objects
- 'icon and text' menu items
Please note that all these depend on your support.
Your suggestions are very welcome. Please contact the author (see
Introduction).