HP Integrity NonStop J-Series User Manual
Page 261

This header file declares the cla ss DemoWindow. A key feature is the singly linked list called
myList, which holds the list of items that have been inserted into the window. The member
function DemoWindow::insert(RWDrawable*) allows new items to be inserted. Only objects
that inherit from class RWDrawable, to be defined later on, may be inserted.
The member function paint() may be called when it is time to repaint the window. The list
myList will be traversed and each item in it will be repainted onto the screen.
Here's a listing of the DEMOWIND.H file
#ifndef __DEMOWIND_H__
#define __DEMOWIND_H__
/*
* A Demonstration Window class --- allows items that
* inherit from the base class RWDrawable to be
* "inserted" into it.
*/
#include
#include
#include "shapes.h"
class DemoWindow {
HWND hWnd; // My window handle
HINSTANCE myInstance; // My instance's handle
int nCmdShow;
RWSlistCollectables myList; // A list of items in the window
public:
DemoWindow(HINSTANCE mom, HINSTANCE prev, int);
~DemoWindow();
void insert(RWDrawable*); // Add a new item to the window
HWND handle() {return hWnd;}
int registerClass(); // First time registration
void paint(); // Called by Windows procedure
int show() {return ShowWindow(hWnd,nCmdShow);}
void update() {UpdateWindow(hWnd);}
friend long FAR PASCAL _export
DemoWindow_Callback(HWND, UINT, WPARAM, LPARAM);
};