Coordinates On The Classpad - Casio ClassPad 300 Programming Manual

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

Advertisement

So to sum that all up: A CPWindow got added to a CPModuleWindow that got added to a
CPMainFrame that was added to the PegPresentationManager. All applications created
for the ClassPad will follow part of this hierarchy. That is, all CPModuleWindows must
be added to a CPMainFrame, and all CPMainFrames must be added to a
PegPresentationManager. However, anything that is based on a PegThing can be added
to a CPModule Window.
The following graphic illustrates a possible parent-child hierarchy using these windows.
On the right is what the hierarchy may look like on the ClassPad. Note that the
PegPresentationManager is not actually visible on the screen.

Coordinates on the ClassPad

When designing applications with a graphical user interface on a specific platform it is
imperative that you know what type of screen coordinates the platform uses. In the
ClassPad, all coordinates sizes are based on pixels. In all PEG base classes coordinates
are absolute starting from the top left corner of the screen, which is (0,0). While this may
not seem to be a problem at first, when you start adding several windows with toolbars
and menu bars using the top left corner as a reference point can become confusing.
For example, let's say that you wanted to add a PegPrompt to (0,0) of your PegWindow
inside a CPMainFrame. Using the code:
text = new PegPrompt(0,0, (PEGCHAR*)"Prompt at 0,0");
Add(text);
you might expect a result like the screenshot on the left:
33

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents