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 #17 background imageLoading...
Page #17 background image
Current Focus
All PegThing based classes support the idea of gaining and losing focus. If a PegThing
has current focus, it means all key input is sent to that object. The user typically changes
the input focus by pressing the pen on an object. When an object gets the input focus it
gets a PM_CURRENT message and its PSF_CURRENT status is set. All its parents up
the tree also become current. You can detect if an object is a member of the input focus
branch of the presentation tree at any time by testing the PSF_CURRENT system status
flag:
if (StatusIs(PSF_CURRENT))
{
// this object is in the branch of the
// display tree that has input focus.
}
Just because an object is a member of the input focus tree does not mean the object is the
end leaf of the input focus branch. You can obtain a pointer to the final input object by
calling the PegPresentationManager::GetCurrentThing() function. This function will
return a pointer to the actual default input object, or NULL if no object has been selected
to receive input events.
Setting Focus
You can override the user’s input selection and manually command
PegPresentationManager to move the input focus at any time by calling:
void MoveFocusTree(PegThing *pThing);
When focus is moved from one PegThing to another, PM_NONCURRENT messages are
sent to objects that are no longer members of the input focus branch, and PM_CURRENT
messages are sent to objects that are members of the new input focus branch. The effect
is that non-directed input messages will be sent to the newly designated input object.
When children are added to the presentation list, the newest child is always placed at the
beginning of an object’s children list. By default, the first child in a parent’s list is the
child that has focus. This means that last child added to a PegThing will always have
default focus (Add() always adds a child to the front of the sibling list). Since this may
not be the desired result, there are three functions that explicitly assign or test which child
has default focus:
virtual BOOL HasDefaultFocus(void);
virtual PegThing* GetDefaultFocus(void);
virtual void SetDefaultFocus(PegThing* pThing);
HasDefaultFocus() tests if an object has default focus. GetDefaultFocus() returns the
PegThing that has default focus. SetDefaultFocus() assigns a PegThing default focus.
17

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