Messages And Message Handling; Pegmessages; Definition - Casio ClassPad 300 Programming Manual

Sdk programming guide
Hide thumbs Also See for ClassPad 300:
Table of Contents

Advertisement

Messages and Message Handling

The driving force behind the graphical interface on the ClassPad comes from events from
the input devices and other PEG objects. All of these events all sent as messages in the
PegMessageQueue. The PegMessageQueue is an encapsulated FIFO message queue
with member functions for queue management. It also performs timer maintenance and
miscellaneous housekeeping.
The messages placed in the queue contain notifications and commands that cause the
graphical elements to redraw themselves, remove themselves from the screen, resize
themselves, or perform any number of various other tasks. Messages can also be user-
defined, allowing you to send and receive a nearly unlimited number of messages whose
meaning is defined by you. This section will discuss these messages' structure, as well as
how the messages are handled and used.

PegMessages

Definition

Messages are defined by PEG as simple structures containing fields indicating the source,
target, and content of the message. The definition of this data structure, called
PegMessage, is shown below:
struct PegMessage
{
PegMessage() {Next = NULL; pTarget = NULL;}
PegMessage(WORD wVal) {Next = NULL; pTarget = NULL; wType =
wVal;}
WORD wType;
SIGNED iData;
PegThing *pTarget;
PegThing *pSource;
PegMessage *Next;
union
{
void *pData;
LONG lData;
PegRect Rect;
PegPoint Point;
LONG lUserData[2];
DWORD dUserData[2];
SIGNED iUserData[4];
WORD wUserData[4];
UCHAR uUserData[8];
};
};
Messages are identified by the member field wType. This is a 16-bit unsigned integer
value, which allows 65,535 unique message types to be defined. Currently PEG reserves
the first 5000 message wType values for internal messages, which leaves message values
5000 through 65,535 available for user definition. The number of messages reserved for
23

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents