User Interfaces
We’ve discussed how to draw on the ClassPad and briefly touched on its windowing
architecture. In this section we will discuss in detail what user interfaces are available on
the ClassPad as well as visit each type of window that is supported in the SDK.
Windows on the ClassPad
In the Window and Screen Drawing section, we gave an overview of the windows that
were used in the WindowsExample add-in application. In this section we will discuss
these again as well as all of the other windows available in the SDK.
PegWindow and PegWindow Derived Windows
Class Name Derived From Styles Signals
PegWindow PegThing FF_NONE
FF_THIN
FF_THICK
PSF_SIZED
PSF_FOCUS_RECEIVED
PSF_FOCUS_LOST
PSF_KEY_RECEIVED
A PegWindow is a basic rectangular screen area supporting scrolling and clipping. Many
of the Windows in the ClassPad are based on a PegWindow. PegWindow provides the
capabilities of being re-sized by the user, having a virtual client area, having one of
several frame styles, and controlling non-client-area scroll bars.
A PegWindow with no border is useful as a container for other objects. The window can
be moved to different locations or added to different parent objects, and all of the
window's children will move with the window. A simple way to create a window with a
virtual scrolling client area is to nest a large window within the client area of a parent
window.
PegWindow and PegWindow derived classes are also by default Viewports. This means
that objects underneath PegWindow are not allowed to obscure the screen area owned by
the window. This is an important performance-enhancing feature of PEG, and also
provides improved visual appeal.
The following example will create a PegWindow and add the window to the current
object. The window will fill the client area of the current object.
void SomeObject::AddClientWindow(void)
{
PegWindow *pWin = new PegWindow(mClient);
Add(pWin);
}
44