Portable Embedded Gui - Peg; Static Peg Objects; The Pegpresentationmanager; The Pegmessagequeue - Casio ClassPad 300 Programming Manual

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

Advertisement

Portable Embedded GUI – PEG
The ClassPad's user interface classes are all based on the Portable Embedded GUI
system, or PEG. In this section we will give a broad overview of PEG. This will include
a detailed look at the PegThing, the class on which all viewable objects are based. We
will also look at how PEG uses the PegPresentationManager to store these viewable
components in memory. Finally, we will go over some fundamental data types that are
used in PEG, but not based on the PegThing.

Static PEG Objects

There are three global static objects in PEG that are very important in understanding how
all of PEG is connected. These three objects are:
static PegThing::PegPresentationManager *Presentation();
static PegThing::PegMessageQueue *MessageQueue();
static PegThing::PegScreen *Screen();
We discuss each of these objects in more detail below.

The PegPresentationManager

The PegPresentationManager keeps track of all of the windows and sub-objects present
on the display device. In addition, PegPresentationManager keeps track of which object
has the input focus (i.e. which object should receive user input such as keyboard input),
and which objects are 'on top' of other objects. Since there is no limit to the number of
windows, controls or other objects that may be present on the screen at one time, you can
probably imagine that this quickly becomes a complex task.

The PegMessageQueue

When a control such as a button or menu is pressed, it creates an event that places a
message in the PegMessageQueue. The PegMessageQueue is a simple encapsulated
FIFO message queue with member functions for queue management. The messages
placed in PegMessageQueue are the driving force behind the graphical interface. These
messages 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. The PegMessageQueue is discussed in detail in the Messages portion of this
document.

The PegScreen

PegScreen is the PEG class that provides the drawing primitives used by the individual
PEG objects to draw themselves on the display device. PEG windows and controls never
directly manipulate video memory, but instead use the PegScreen member functions to
draw lines, text, bitmaps, etc. Most importantly, PegScreen provides a layer of isolation
7

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents