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 #80 background imageLoading...
Page #80 background image
PegSpinButton
Class Name Derived From Styles Signals
PegSpinButton PegThing SB_VERTICAL PSF_SIZED
PSF_FOCUS_RECEIVED
PSF_FOCUS_LOST
PSF_KEY_RECEIVED
PSF_SPIN_MORE
PSF_SPIN_LESS
PegSpinButton is a thumbwheel style control that is normally used to adjust a numeric
value displayed in an adjacent object. PegSpinButton objects can be horizontal or vertical
in orientation.
There are two forms of PegSpinButton. The first form is created when the spin button has
a 'buddy' object. A buddy object is a PegTextThing derived object that is automatically
updated as the spin button is manipulated by the end user. The second form of
PegSpinButton has no buddy object, and therefore reports spin button selection to the
parent window for application level processing.
When a spin button has a buddy object, that object should be designed to display a
numeric value. When the spin button is operated by the end user, the spin button will first
convert the buddy object string to an integer, then increment or decrement the integer
value as required, and then convert the integer value back to a string for assignment to the
buddy object.
The buddy object, if any, is required to have TT_COPY style. This is required because
the string value assigned to the buddy object is dynamically constructed. If the buddy
object does not have TT_COPY style, this style is added automatically by the spin button
object.
The following example creates a PegPrompt that is used as the buddy for the
PegSpinButton. The PegSpinButton has a min of 20 and a max of 80 with an increment
of 5.
PegRect ChildRect;
ChildRect.Set(20, 20, 100, 40);
PegPrompt *pPrompt = new PegPrompt(ChildRect, "20", 0,
FF_RECESSED|TJ_RIGHT|TT_COPY);
AddR(pPrompt);
// set the spin button position to the right of the prompt:
ChildRect.wLeft = pPrompt->mReal.wRight + 1;
ChildRect.wRight = ChildRect.wLeft + PEG_SCROLL_WIDTH;
//Create the SpinButton with pPrompt as the buddy. 20 as the min, 80
//as the max and 5 as the increment value
PegSpinButton *pSpin = new PegSpinButton(ChildRect,
pPrompt, 20, 80, 5, SB_VERTICAL);
AddR(pSpin);
80

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