EasyManuals Logo

Casio ClassPad 300 Programming Guide

Casio ClassPad 300
125 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #34 background imageLoading...
Page #34 background image
Fig1. AddR a prompt at 0,0 Fig2. Add a prompt at 0,0
However, while the prompt may be at (0,0) in your PegWindow’s coordinates, it is not at
(0,0) according to the CPMainFrame coordinates. Placing the prompt at absolute (0,0)
would create it outside of your window – somewhere underneath the menu bar, and
therefore it would not get drawn (Fig2).
To fix this problem the ClassPad 300 SDK includes the CPWindow. CPWindow and all
objects that are derived from CPWindow, support a function called AddR(). AddR()
does the same thing as Add() – adds a PegThing to “this”. However, AddR() allows you
to add objects to coordinates relative to the window that called AddR(). Therefore the
following code would produce the screenshot in Fig1:
text = new PegPrompt(0,0, (PEGCHAR*)"Prompt at 0,0");
AddR(text);
It is not required that you use AddR() with a CPWindow, but if you are dealing with
windows that are being moved and resized it is easier than trying keep up with absolute
coordinates.
Drawing on the ClassPad
Overriding the Draw() Function
The virtual function Draw() is called by PegPresentationManager when an object
initially needs to draw itself, or by the application software when an object has been
modified. This is one of the most commonly overridden functions in custom classes
created by PEG users, because by overriding this function you can define a new object
with a custom appearance.
Usually when you override the Draw() function you will allow the base-class Draw()
function to execute at some point in your routine. A common question is “When do I call
the base-class Draw() function?”. This depends on whether you want your custom
drawing to appear on-top or below the default operation. If you want your customizations
34

Table of Contents

Other manuals for Casio ClassPad 300

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Casio ClassPad 300 and is the answer not in the manual?

Casio ClassPad 300 Specifications

General IconGeneral
BrandCasio
ModelClassPad 300
CategoryCalculator
LanguageEnglish

Related product manuals