home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
VSCPPv8.zip
/
VACPP
/
IBMCPP
/
samples
/
IOC
/
2D-BMAP
/
2D-BMAP.HPP
< prev
next >
Wrap
Text File
|
1995-04-07
|
5KB
|
130 lines
#ifndef BITMAP_HPP
#define BITMAP_HPP
/******************************************************************************/
/* 2D-GRAPHICS BITMAP SAMPLE PROGRAM - Class Header (2d-bmap.hpp) */
/* */
/* COPYRIGHT: Copyright (C) International Business Machines Corp., 1992,1995. */
/* */
/* DISCLAIMER OF WARRANTIES: */
/* The following [enclosed] code is sample code created by IBM */
/* Corporation. This sample code is not part of any standard IBM product */
/* and is provided to you solely for the purpose of assisting you in the */
/* development of your applications. The code is provided "AS IS", */
/* without warranty of any kind. IBM shall not be liable for any damages */
/* arising out of your use of the sample code, even if they have been */
/* advised of the possibility of such damages. */
/******************************************************************************/
#include <iframe.hpp> //Include IFrameWindow Class Header
#include <icmdhdr.hpp>
#include <idrawcv.hpp>
#include <ivport.hpp>
#include <ipainhdr.hpp>
#include <igbitmap.hpp>
#include "2d-bmap.h"
//**************************************************************************
// Class: DrawingAreaPaintHandler *
// *
// Purpose: Draw the bitmap. *
// *
//**************************************************************************
class DrawingAreaPaintHandler : public IPaintHandler
{
typedef IPaintHandler
Inherited;
protected:
virtual Boolean
paintWindow( IPaintEvent& event );
};
//**************************************************************************
// Class: MainCommandHandler *
// *
// Purpose: Handle command events for the bitmap sample program. *
// *
//**************************************************************************
class MainCommandHandler : public ICommandHandler
{
typedef ICommandHandler
Inherited;
protected:
virtual Boolean
command( ICommandEvent& event );
};
class DrawingArea : public IDrawingCanvas
{
typedef IDrawingCanvas
Inherited;
public:
DrawingArea( unsigned long id, IWindow* parent, IWindow* owner );
virtual
~DrawingArea();
DrawingArea
&loadBitmap( const IString& imageFile );
IGBitmap*
bitmap() const;
DrawingArea
&setClipStyle ( unsigned long style ) { fStyle = style; return *this; }
unsigned long
clipStyle( ) const { return fStyle; }
protected:
virtual ISize
calcMinimumSize ( ) const;
private:
DrawingAreaPaintHandler
drawingAreaPaintHandler;
IGBitmap*
fBitmap;
unsigned long
fStyle;
};
//**************************************************************************
// Class: MainWindow *
// *
// Purpose: Main Window for C++ Hello World sample application *
// It is a subclass of IFrameWindow *
// *
//**************************************************************************
class MainWindow : public IFrameWindow
{
typedef IFrameWindow
Inherited;
public: //Define the Public Information
MainWindow(unsigned long windowId); //Constructor for this class
virtual
~MainWindow();
virtual MainWindow
&loadImageFile( const IString& imageFile );
virtual MainWindow
&modifyBitmap( unsigned long eventId );
DrawingArea
&drawingArea( ) { return fDrawingArea; }
private: //Define Private Information
IViewPort fViewPort;
DrawingArea fDrawingArea;
MainCommandHandler fMainCommandHandler;
};
#endif