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 #32 background imageLoading...
Page #32 background image
First we will look at the creation of the CPMainFrame in PegAppInitialize. The
mainframe is created by passing in a peg rectangle that is the size of the mainframe.
void PegAppInitialize(PegPresentationManager *pPresentation)
{
PegRect Rect;
Rect.Set(MAINFRAME_LEFT,MAINFRAME_TOP,
MAINFRAME_RIGHT,MAINFRAME_BOTTOM);
CPMainFrame *mw = new CPMainFrame(Rect);
Next, we want to add an ExampleWindow to the mainframe. Remember that only
CPModuleWindows can be added to a CPMainFrame. Therefore, ExampleWindow must
be, and in fact is, derived from a CPModuleWindow. Here is the code that creates an
instance of ExampleWindow that is the size of a full screen application in the mainframe:
PegRect ChildRect = mw->FullAppRectangle();
ExampleWindow *ex_win = new ExampleWindow(ChildRect,mw);
Now let’s jump out of PegAppInitialize for a moment, to see what ExampleWindow’s
constructor does.
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);
}
You can see that ExampleWindow has a reference to a PanWindow. PanWindow is
based on the CPWindow class. The constructor creates a new PanWindow and adds it to
ExampleWindow.
Finally if we jump back to PegAppInitialize we see that the ExampleWindow gets added
to the CPMainFrame, and the CPMainFrame gets added to the PegPresentationManager.
mw->SetTopWindow(ex_win);
mw->SetMainWindow(ex_win);
pPresentation->Add(mw);
};
32

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