home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
modu1096.zip
/
sample
/
pmdemo
/
README
< prev
next >
Wrap
Text File
|
1995-09-20
|
2KB
|
37 lines
GPM Sample Presentation Manager Application
-------------------------------------------
This sample code demonstrates the use of gpm-emx to create a PM application.
A makefile is provided. gpm-emx has been tested with IBM CSet2 and Borland
C++ for OS/2.
The cubes respond to double-clicks of the left and right mouse buttons. The
right button toggles the cubes' motion, the left button toggles the redrawing
of the background.
SPINCUBE.MOD implements a custom control, which it exports as the "SPINCUBE"
class. It demonstrates the use of a variety of OS/2 API, the implementation
of window procedures in Modula-2 and the use of GPM library modules in a PM
application. The code is similar to the equivalent C language program with
the main differences arising from the stricter type rules of Modula-2.
SPINTEST.MOD creates the application window and four "SPINCUBE" controls. It
responds to the WM_SIZE message by re-sizing the controls so that each takes
up a quarter of the application window, with a small border. It demonstrates
the application initialization API, message handling and the implementation
of dialog procedures in Modula-2.
The dialog procedures and menu interface is provided by a FOREIGN definition
module SPINDLG.DEF. There is of course no implementation part. The resource
compiler, RC, is used to compile these and gcc adds the compiled resources to
the executable.
There are four options on the sample's menu. The "About..." option displays
a typical static dialog box. The "Dialog..." option demonstrates the use of
the custom control in a dialog box. No extra application code is required to
implement this. The "Assert error" option causes a runtime assertion to fail,
while the "Range error" option causes a runtime range error. Future releases
of GPM will implement the draft WG-13 exception handling model. This will
allow applications to intercept all exceptions including runtime errors and
provide retrial and abort semantics.