EasyManuals Logo
Home>Casio>Calculator>ClassPad 300

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 #10 background imageLoading...
Page #10 background image
PegPresentationManager. Next() would return PegWindow2. Since all lists are
terminated with a NULL, Previous() would return NULL. So, if we wanted traverse all
of the children of an object, we could use the following code:
PegThing *pTest = Parent()->First(); // first child of my parent
int iSiblings = 0;
// Since all lists are NULL terminated,
// we can loop on while ptest!=NULL
while(pTest)
{
if (pTest != this)
{
iSiblings++;
}
pTest = pTest->Next();
}
Adding to and Removing from the Tree
PEG provides two functions to add PegThings to the presentation tree:
void PegThing::Add(PegThing *Who, BOOL bDraw = TRUE);
void PegThing::AddToEnd(PegThing *Who, BOOL bDraw = TRUE);
Add() always adds the child to the beginning of the linked list of children. If you would
like to add to the end, use AddToEnd().
Let’s look at some example code and see what the tree it creates will look like:
PegRect Rect(10, 10, 40, 40);
PegWindow *child_window = new PegWindow(Rect);
PegWindow *parent_window = new PegWindow(Rect + 50);
PegPrompt *prompt1 = new PegPrompt(0, 0, “Prompt1”);
PegPrompt *prompt2 = new PegPrompt(0,30, “”Prompt2”);
prent_window->Add(child_window);
child_window->Add(prompt1);
child_window->AddToEnd(prompt2);
child_window
p
rompt1
p
rompt2
p
arent_window
There are also two functions to remove an object from the tree:
10

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