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 #42 background imageLoading...
Page #42 background image
ExampleWindow::ExampleWindow(PegRect rect, CPMainFrame
*frame) :CPModuleWindow(rect,0,0,frame)
{
HasLines = false;
SetScrollMode(WSM_AUTOSCROLL);
PegRect r = mClient;
r -= 20; // make the pan window a bit smaller
m_panWin = new PanWindow(r);
Add(m_panWin);
}
Scrolling is now set up to work in ExampleWindow.
When you run WindowsExample, you’ll notice that PanWindow is smaller than
ExampleWindow and there are no scrollbars on startup. However, if you bring up the
soft keyboard, you will see that scrollbars automatically appear thanks to the automatic
scroll mode.
ExamlpeWindow on startup with no scrollbars, and ExampleWindow with automatic scrollbars after
bringing up the soft keyboard.
In both AddText() and OnPointerMove(), PanWindow can change so that scrollbars
might be required. In AddText() the height of PanWindow can grow larger than the
height of ExampleWindow. In OnPointerMove(), PanWindow can be moved outside of
ExampleWindow’s mClient. In both cases we can force ExampleWindow to check its
scrollbars by calling Resize() and passing in its mReal. The following code is used in
both functions:
// Calling Resize with the same size is used as a "trick" to force the
// parent to check for and add or remove scrollbars
Parent()->Resize(Parent()->mReal);
Parent()->Draw();
As the comments say, this is a bit of a “trick” to cause ExampleWindow to realize that it
needs scrollbars to completely hold PanWindow. Try commenting out the Resize() and
42

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