Object Boundaries; Mreal, Mclient And Pegrects - Casio ClassPad 300 Programming Manual

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

Advertisement

portion of ExampleWindow will become visible. ExampleWindow must be redrawn to
display this portion. This is done by calling the parent's draw function in
OnPointerMove() in PanWindow.cpp:
Parent()->Draw();
If we did not call DrawLines() in the Draw() function then ExampleWindow would be
redrawn without the lines. You should try commenting out the call to DrawLines() in
the Draw function to see this for yourself.
If you look in PanWindow.cpp you will see that we are drawing in the functions
AddText() and OnPointerMove(), but do not call Invalidate(). In both of these
functions the Resize() method is called to either expand or move the PanWindow. The
Resize() method automatically calls Invalidate() before the window is moved or resized
and after the move or resize is complete. This eliminates the user from being responsible
for calling Invalidate() when using Resize().

Object Boundaries

mReal, mClient and PegRects

All PegThing derived classes have two rectangles associated with them: mReal and
mClient. The rectangle mReal defines the outermost limits of an object. The object and
all children of the object are prevented from drawing outside the mReal rectangle.
The mClient rectangle defines the interior boundaries of an object. The mClient rectangle
is always a sub-set of the mReal rectangle. All children of an object are clipped to the
parent's mClient rectangle, unless the children have PSF_NONCLIENT system status, in
which case they are clipped to the parent's mReal rectangle.
For simple objects such as PegButton and PegString, the mClient rectangle is smaller
than the mReal rectangle only by the width of the object border. If the object has no
border, the mClient and mReal rectangles are identical. For PegWindow and derived
classes, the mClient rectangle is further reduced by the size of the non-client decorations
such as a title bar, menu bar, status bar, and horizontal and vertical scroll bars. In other
words, non-client children are positioned in the region between the mClient rectangle
limits and the mReal rectangle limits.
The rectangle you pass to most PEG object constructors defines the outermost limits of
the object, hence this rectangle becomes the mReal member rectangle. PEG objects
initialize their mClient area by calling the PegThing member function InitClient(), which
reduces the mClient area by the object border width. PegWindow performs further
operations to reduce the mClient area as decorations are added to the window.
For example, here is what ExampleWindow's mReal and mClient look like when there
are scroll bars:
37

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents