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 #12 background imageLoading...
Page #12 background image
PegThing Type and Attributes
PegThing Type
All PEG objects have a member variable called muType, which is a logical type
indicator. You can retrieve or set an object’s muType value by calling the Type()
functions:
UCHAR Type(void) { return muType; }
void Type(UCHAR uSet) {muType = uSet;}
Type() called with no arguments will return that PegThing’s type, whereas Type() called
with a UCHAR will set the object’s type.
This can be useful when you are searching your child object list for objects of a certain
type. This value is also useful when debugging since at times you may have a pointer to a
PegThing and wish to know exactly what type of PegThing the pointer points to. After
checking the muType member of a PegThing, you can safely upcast a PegThing pointer
to a pointer to a specific PEG object type. The possible return values of the Type()
function are defined in the header file pegtypes.hpp. The following code fragment
illustrates one possible method of locating the status bar attached to a window:
PegThing *pTest = First(); // get pointer to first child object
while(pTest) // search to the end of list if necessary
{
if (pTest->Type() == TYPE_STATUS_BAR)
{
PegStatusBar *pStatBar = (PegStatusBar *) pTest;
//use pStatBar to call member functions or change attributes
break; // found the status bar, exit the loop
}
pTest = pTest->Next(); // continue down the list of children
}
PegThing Object IDs
Another way to find a specific PegThing is with its Object ID. You can assign each
PegThing a unique object ID value that can then be used to identify the object. When an
object sends a notification signal to a parent window, the object ID is contained in the
iData member of the notification message. If you do not give an object ID to a PegThing,
then that PegThing will not send notification signals.
To get and set an object’s ID, use the following functions:
WORD Id(void) {return mwId;}
void Id(WORD wId) {mwId = wId;}
12

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