OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::THatch8x8Brush Class Reference

Derived from TBrush, THatch8x8Brush defines a small, 8x8, monochrome, configurable hatch brush. More...

#include <owl/gdiobjec.h>

Inheritance diagram for owl::THatch8x8Brush:
owl::TBrush owl::TGdiObject owl::TGdiBase

Public Member Functions

 THatch8x8Brush (const uint8 hatch[], const TColor &fgColor=TColor::White, const TColor &bgColor=TColor::Black)
 Constructs a THatchBrush object with the specified hatched pattern and colors.
 
void Reconstruct (const uint8 hatch[], const TColor &fgColor, const TColor &bgColor)
 Reconstructs the hatched brush with a new pattern or new set of colors.
 
- Public Member Functions inherited from owl::TBrush
 TBrush (HBRUSH handle, TAutoDelete autoDelete=NoAutoDelete)
 TBrush encapsulates an HBRUSH.
 
 TBrush (const TColor &color, bool useCache=true)
 Creates a solid TBrush object with the given color.
 
 TBrush (const TColor &color, int style)
 Creates a hatched TBrush object with the given style and color.
 
 TBrush (const LOGBRUSH &logBrush)
 Creates a TBrush object with values from the given LOGBRUSH.
 
 TBrush (const TBitmap &pattern)
 Creates a patterned TBrush object with the given pattern.
 
 TBrush (const TDib &pattern)
 Creates a patterned TBrush object with the given DIB pattern.
 
 TBrush (const TBrush &src)
 Constructs a copy of an existing brush.
 
 ~TBrush ()
 
HBRUSH GetHandle () const
 Returns the handle of the brush with type HBRUSH.
 
 operator HBRUSH () const
 Typecasting operator.
 
LOGBRUSH GetObject () const
 Retrieves information about this brush object and places it in the given LOGBRUSH structure.
 
- Public Member Functions inherited from owl::TGdiObject
 ~TGdiObject ()
 Decrement the reference count on this object.
 
HGDIOBJ GetGdiHandle () const
 Returns the handle of the GDI object.
 
 operator HGDIOBJ () const
 Typecasting operator that converts this GDI object handle to type HGDIOBJ.
 
int GetObject (int count, void *object) const
 Retrieve the object's attributes into a buffer.
 
bool operator== (const TGdiObject &other) const
 Returns true if the handles are equal. This is a binary compare.
 
bool operator< (const TGdiObject &other) const
 not implemented just to make happy STL
 
bool IsGDIObject () const
 Returns true if this represents a real GDI object.
 
uint32 GetObjectType () const
 Returns the type of the GDI object.
 
auto IsHandleOwner () const -> bool
 Returns true if handle lifetime is managed.
 

Static Public Attributes

static const uint8 Hatch22F1 [8]
 The static array Hatch22F1[8] holds a monochrome hatched brush pattern of two pixels on and two off in forward diagonal hatch marks, offset one per row as the following pattern illustrates:
 
static const uint8 Hatch13F1 [8]
 The static array Hatch13F1[8] holds a hatched brush pattern of one pixel on and three pixels off in forward diagonal hatch marks, offset one per row as the following pattern illustrates:
 
static const uint8 Hatch11F1 [8]
 The static array Hatch11F1[8] holds the logical hatched brush pattern of one pixel on and one pixel off in monochrome, offset one per row as the following pattern illustrates:
 
static const uint8 Hatch22B1 [8]
 The static array Hatch22B1[8] holds a hatched brush pattern of two pixels on and two off in backward diagonal hatch marks, offset one per row as the following pattern illustrates:
 
static const uint8 Hatch13B1 [8]
 The static array Hatch13B1[8] holds a hatched brush pattern of one pixel on and three pixels off in backward diagonal hatch marks, offset one per row as the following pattern illustrates:
 

Additional Inherited Members

- Public Types inherited from owl::TBrush
typedef HBRUSH THandle
 
- Public Types inherited from owl::TGdiObject
enum  TType { None , Pen , Brush , Font , Palette , Bitmap , TextBrush }
 This enumeration is used to store the object type in the struct TObjInfo. More...
 
typedef HGDIOBJ THandle
 TGdiObject encapsulates an HGDIOBJ.
 
- Static Public Member Functions inherited from owl::TGdiObject
static TObjInfo * RefFind (HANDLE object)
 Searches for the given object handle.
 
static void RefAdd (HANDLE handle, TType type)
 RefAdd adds a reference entry for the object with the given handle and type.
 
static void RefRemove (HANDLE handle)
 Removes the reference entry to the object with the given handle.
 
static void RefInc (HANDLE handle)
 Increments by 1 the reference count of the object associated with the given handle.
 
static void RefDec (HANDLE handle, bool wantDelete)
 Decrements this object's reference count by 1 and deletes the object when the reference count reaches zero.
 
static int RefCount (HANDLE handle)
 Returns this object's current reference count or -1 if the object is not found.
 
- Protected Member Functions inherited from owl::TGdiObject
 TGdiObject ()
 This default constructor sets Handle to 0 and ShouldDelete to true.
 
 TGdiObject (HANDLE handle, TAutoDelete autoDelete=NoAutoDelete)
 Create a wrapper for a given GDI object.
 
void CheckValid (uint resId=IDS_GDIFAILURE)
 
- Static Protected Member Functions inherited from owl::TGdiObject
static void _CheckValid (HANDLE handle, uint resId=IDS_GDIFAILURE)
 
- Protected Attributes inherited from owl::TGdiObject
HANDLE Handle
 GDI handle of this object.
 
bool ShouldDelete
 Should object delete GDI handle in dtor?
 

Detailed Description

Derived from TBrush, THatch8x8Brush defines a small, 8x8, monochrome, configurable hatch brush.

Because the hatch brush is a logical brush created from device-independent bitmaps (DIBs), it can be passed to any device context (DC), which then renders the brush into the appropriate form for the device.

Although the default brush color is a white foreground and a black background, you can vary the colors of the hatched brush. The colors can be any one of the TColor object encapsulated colors, namely the standard RGB values.

THatch8x8Brush contains static arrays that define common hatched brush patterns. The hatched brush patterns you can select are

Standard

Forward diagonal 1

Forward diagonal 2

Backward diagonal 1

Backward diagonal 2

You can use THatch8x8Brush to design a variety of hatched brush border patterns around a simple rectangle or an OLE container. You can also use THatch8x8Brush in conjunction with TUIHandle.

Definition at line 250 of file gdiobjec.h.

Constructor & Destructor Documentation

◆ THatch8x8Brush()

owl::THatch8x8Brush::THatch8x8Brush ( const uint8 hatch[],
const TColor & fgColor = TColor::White,
const TColor & bgColor = TColor::Black )

Constructs a THatchBrush object with the specified hatched pattern and colors.

Although the hatched brush is, by default, white on a black background, you can control the displayed colors by passing different colors in the constructor, where fgColor represents the foreground color and bgColor represents the background color of a TColor object type.

Note that colors can be specified in either palette mode (a reference to a corresponding color palette entry in the currently realized palette) or RGB mode (an actual red, green, or blue color value).

Definition at line 453 of file brush.cpp.

Member Function Documentation

◆ Reconstruct()

void owl::THatch8x8Brush::Reconstruct ( const uint8 hatch[],
const TColor & fgColor,
const TColor & bgColor )

Reconstructs the hatched brush with a new pattern or new set of colors.

Definition at line 463 of file brush.cpp.

References owl::TGdiObject::Brush, owl::TGdiObject::Handle, owl::TGdiObject::RefAdd(), and owl::TGdiObject::RefDec().

Member Data Documentation

◆ Hatch11F1

const uint8 owl::THatch8x8Brush::Hatch11F1
static
Initial value:
= {
0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55
}

The static array Hatch11F1[8] holds the logical hatched brush pattern of one pixel on and one pixel off in monochrome, offset one per row as the following pattern illustrates:

Definition at line 272 of file gdiobjec.h.

◆ Hatch13B1

const uint8 owl::THatch8x8Brush::Hatch13B1
static
Initial value:
= {
0x44, 0x22, 0x11, 0x88, 0x44, 0x22, 0x11, 0x88
}

The static array Hatch13B1[8] holds a hatched brush pattern of one pixel on and three pixels off in backward diagonal hatch marks, offset one per row as the following pattern illustrates:

Definition at line 284 of file gdiobjec.h.

◆ Hatch13F1

const uint8 owl::THatch8x8Brush::Hatch13F1
static
Initial value:
= {
0x88, 0x11, 0x22, 0x44, 0x88, 0x11, 0x22, 0x44
}

The static array Hatch13F1[8] holds a hatched brush pattern of one pixel on and three pixels off in forward diagonal hatch marks, offset one per row as the following pattern illustrates:

Definition at line 266 of file gdiobjec.h.

◆ Hatch22B1

const uint8 owl::THatch8x8Brush::Hatch22B1
static
Initial value:
= {
0xCC, 0x66, 0x33, 0x99, 0xCC, 0x66, 0x33, 0x99
}

The static array Hatch22B1[8] holds a hatched brush pattern of two pixels on and two off in backward diagonal hatch marks, offset one per row as the following pattern illustrates:

Definition at line 278 of file gdiobjec.h.

◆ Hatch22F1

const uint8 owl::THatch8x8Brush::Hatch22F1
static
Initial value:
= {
0x99, 0x33, 0x66, 0xCC, 0x99, 0x33, 0x66, 0xCC
}

The static array Hatch22F1[8] holds a monochrome hatched brush pattern of two pixels on and two off in forward diagonal hatch marks, offset one per row as the following pattern illustrates:

Definition at line 260 of file gdiobjec.h.


The documentation for this class was generated from the following files: