home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
WBRUSH.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-18
|
5KB
|
163 lines
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 1994, by WATCOM International Inc. All rights %
% reserved. No part of this software may be reproduced or %
% used in any form or by any means - graphic, electronic or %
% mechanical, including photocopying, recording, taping or %
% information storage and retrieval systems - except with the %
% written permission of WATCOM International Inc. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
/*************************************************************************
*
* WBrush -- Wrapper for the Windows 95 Brush object.
*
*************************************************************************/
#ifndef _WBRUSH_HPP_INCLUDED
#define _WBRUSH_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
#ifndef _WBITMAP_HPP_INCLUDED
# include "wbitmap.hpp"
#endif
#ifndef _WCOLOR_HPP_INCLUDED
# include "wcolor.hpp"
#endif
enum WBrushPattern {
WBPatternSolid = -1,
WBPatternHorizontal,
WBPatternVertical,
WBPatternFDiagonal,
WBPatternBDiagonal,
WBPatternCross,
WBPatternDiagCross
};
enum WBStockBrush {
WBWhiteBrush = 0,
WBLightGrayBrush = 1,
WBGrayBrush = 2,
WBDarkGrayBrush = 3,
WBBlackBrush = 4,
WBInvisibleBrush = 5
};
class WBrushReference;
class WCMCLASS WBrush : public WObject {
WDeclareSubclass( WBrush, WObject );
public:
/**********************************************************
* Constructors and Destructors
*********************************************************/
WBrush();
WBrush( WBStockBrush brush );
WBrush( const WColor & color, WBrushPattern pattern=WBPatternSolid );
WBrush( const WBitmap & bmp );
WBrush( const WBrush & brush );
WBrush( const WBrushHandle handle, WBool deleteHandle=FALSE );
~WBrush();
/**********************************************************
* Properties
*********************************************************/
// Handle
WBrushHandle GetHandle() const;
/**********************************************************
* Methods
*********************************************************/
// Clear
WBool Clear();
// Create
WBool Create( WBStockBrush brush );
WBool Create( const WColor & color, WBrushPattern p=WBPatternSolid );
WBool Create( const WBitmap & bitmap );
WBool Create( const WBrush & brush );
WBool Create( const WBrushHandle handle, WBool deleteHandle=FALSE );
/**********************************************************
* Static Methods
*********************************************************/
// IsValidHandle
//
// Returns TRUE if the given handle is valid. Can
// optionally specify whether or not a null handle
// is "valid".
static WBool IsValidHandle( WBrushHandle handle,
WBool nullValid=FALSE );
// ResetSystemBrushes
static void ResetSystemBrushes();
/**********************************************************
* Static Properties
*********************************************************/
// BlackBrush
static const WBrush & GetBlackBrush();
// InvisibleBrush
static const WBrush & GetInvisibleBrush(); // NOT the same as null brush
// NullBrush
static const WBrush & GetNullBrush();
// WhiteBrush
static const WBrush & GetWhiteBrush();
/**********************************************************
* Others
*********************************************************/
WBrush & operator=( const WBrush & b );
WBrush & operator=( WBStockBrush b );
int operator==( const WBrush &b ) const;
int operator!=( const WBrush &b ) const;
/**********************************************************
* Data Members
*********************************************************/
private:
WBrushReference * _brushRef;
};
#ifdef _DEBUG
#define W_ISBRUSHHANDLE(h) CHECKGDI(WBrush::IsValidHandle((WBrushHandle)h))
#else
#define W_ISBRUSHHANDLE(h)
#endif
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WBRUSH_HPP_INCLUDED