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

Assists in drawing borders of many styles. More...

#include <owl/uihelper.h>

Public Types

enum  TFlag {
  Left = 0x0001 , Top = 0x0002 , Right = 0x0004 , Bottom = 0x0008 , TopLeft = Top | Left , TopRight = Top | Right , BottomLeft = Bottom | Left , BottomRight = Bottom | Right , Rect = Top | Left | Bottom | Right , Diagonal = 0x0010 ,
  Fill = 0x0800 , Soft = 0x1000 , Adjust = 0x2000 , Flat = 0x4000 , Mono = 0x8000
}
 Constructor flags to limit or modify border. More...
 
enum  TStyle {
  None , Plain , Raised , Recessed , Embossed , Grooved , ButtonUp , ButtonDn , WndRaised , WndRecessed ,
  WellSet , ButtonUp3x , ButtonDn3x
}
 Enumeration describing hilevel border styles. More...
 
enum  TEdge { RaisedOuter = 0x01 , SunkenOuter = 0x02 , RaisedInner = 0x04 , SunkenInner = 0x08 , EdgeOuter = 0x03 , EdgeInner = 0x0C , EdgeRaised = RaisedOuter | RaisedInner , EdgeSunken = SunkenOuter | SunkenInner , EdgeEtched = SunkenOuter | RaisedInner , EdgeBump = RaisedOuter | SunkenInner }
 Enumeration describing the type of edge to be drawn. More...
 

Public Member Functions

 TUIBorder (const TRect &frame, TStyle style, uint flags=0)
 Constructs a UIBorder object given a frame and a high-level style type.
 
 TUIBorder (const TRect &frame, TEdge edge, uint flags=0)
 Constructs a UIBorder object given a frame, edge, and modifier flags.
 
void MoveTo (int x, int y)
 Moves the frame rect to (x,y).
 
void Move (int dx, int dy)
 Moves the frame rect by (dx,dy).
 
void Size (int w, int h)
 Resizes the frame rect to (w,h).
 
TRect GetBoundingRect () const
 Calculates the outside frame rectangle.
 
TRect GetClientRect () const
 Calculates the rectangle within the border.
 
void Paint (TDC &dc) const
 Paints this UIBorder object onto a given device context.
 

Static Public Member Functions

static bool DrawEdge (TDC &dc, const TRect &frame, uint edge, uint flags)
 This is a static function that performs the actual drawing of edges for a UIBorder or an external client.
 
static void PaintFrame (TDC &dc, const TRect &frame, uint flags, const TColor &tlColor, const TColor &brColor)
 Paints a 2-color single pixel-thick frame. Bevel corners get brush color.
 
static void PaintFrameC (TDC &dc, const TRect &frame, uint flags, const TColor &tlColor, const TColor &brColor, const TColor &bcColor)
 Paints a 2-color single pixel-thick frame. Bevel corners get their own color.
 

Detailed Description

Assists in drawing borders of many styles.

Uses win4.0 calls when available

Definition at line 270 of file uihelper.h.

Member Enumeration Documentation

◆ TEdge

Enumeration describing the type of edge to be drawn.

Enumerator
RaisedOuter 

Raised outer edge only.

SunkenOuter 

Sunken outer edge only.

RaisedInner 

Raised inner edge only.

SunkenInner 

Sunken inner edge only.

EdgeOuter 

Mask for outer edge bits.

EdgeInner 

Mask for inner edge bits.

EdgeRaised 

Both inner & outer raised.

EdgeSunken 

Both inner & outer sunken.

EdgeEtched 

Outer sunken, inner raised.

EdgeBump 

Outer raised, inner sunken.

Definition at line 315 of file uihelper.h.

◆ TFlag

Constructor flags to limit or modify border.

Enumerator
Left 
Top 
Right 
Bottom 
TopLeft 
TopRight 
BottomLeft 
BottomRight 
Rect 
Diagonal 

Draw diagonal edge (NotAvail intrnl)

Fill 

Fill in middle.

Soft 

Soft edge look for buttons.

Adjust 

Adjust passed rect to client (Not Applicable)

Flat 

Flat instead of 3d for use in non-3d windows.

Mono 

Monochrome.

Definition at line 274 of file uihelper.h.

◆ TStyle

Enumeration describing hilevel border styles.

Enumerator
None 

No border painted at all.

Plain 

Plain plain window frame.

Raised 

Status field style raised.

Recessed 

Status field style recessed.

Embossed 

Grouping raised emboss bead.

Grooved 

Grouping groove.

ButtonUp 

Button in up position.

ButtonDn 

Button in down position.

WndRaised 

Raised window outer+inner edge.

WndRecessed 

Input field & other window recessed.

WellSet 

Well option set (auto grows + 1) // !CQ W4 cant do.

ButtonUp3x 

Button in up position, Win 3.x style.

ButtonDn3x 

Button in down position, Win 3.x style.

Definition at line 296 of file uihelper.h.

Constructor & Destructor Documentation

◆ TUIBorder() [1/2]

owl::TUIBorder::TUIBorder ( const TRect & frame,
TUIBorder::TStyle style,
uint flags = 0 )

Constructs a UIBorder object given a frame and a high-level style type.

Calculates Edge and modifier flags internally, as needed.

Definition at line 18 of file uiborder.cpp.

References PRECONDITION, RaisedInner, RaisedOuter, Rect, Soft, SunkenInner, SunkenOuter, and WellSet.

◆ TUIBorder() [2/2]

owl::TUIBorder::TUIBorder ( const TRect & frame,
TEdge edge,
uint flags = 0 )

Constructs a UIBorder object given a frame, edge, and modifier flags.

Definition at line 50 of file uiborder.cpp.

References Rect.

Member Function Documentation

◆ DrawEdge()

bool owl::TUIBorder::DrawEdge ( TDC & dc,
const TRect & frame,
uint edge,
uint flags )
static

This is a static function that performs the actual drawing of edges for a UIBorder or an external client.

It uses the system DrawEdge if available.

Definition at line 127 of file uiborder.cpp.

References CHECK, and DrawEdge().

◆ GetBoundingRect()

TRect owl::TUIBorder::GetBoundingRect ( ) const

Calculates the outside frame rectangle.

Definition at line 92 of file uiborder.cpp.

◆ GetClientRect()

TRect owl::TUIBorder::GetClientRect ( ) const

Calculates the rectangle within the border.

Definition at line 102 of file uiborder.cpp.

References EdgeInner, EdgeOuter, and owl::TRect::InflatedBy().

◆ Move()

void owl::TUIBorder::Move ( int dx,
int dy )

Moves the frame rect by (dx,dy).

Definition at line 64 of file uiborder.cpp.

References owl::TRect::Offset().

◆ MoveTo()

void owl::TUIBorder::MoveTo ( int x,
int y )

Moves the frame rect to (x,y).

Definition at line 73 of file uiborder.cpp.

References owl::TRect::Offset().

◆ Paint()

void owl::TUIBorder::Paint ( TDC & dc) const

Paints this UIBorder object onto a given device context.

Definition at line 112 of file uiborder.cpp.

References DrawEdge().

◆ PaintFrame()

void owl::TUIBorder::PaintFrame ( TDC & dc,
const TRect & frame,
uint flags,
const TColor & tlColor,
const TColor & brColor )
static

Paints a 2-color single pixel-thick frame. Bevel corners get brush color.

Definition at line 138 of file uiborder.cpp.

References Bottom, owl::TRect::Height(), Left, owl::TDC::PatBlt(), owl::TDC::RestoreBrush(), Right, owl::TDC::SelectObject(), Top, and owl::TRect::Width().

◆ PaintFrameC()

void owl::TUIBorder::PaintFrameC ( TDC & dc,
const TRect & frame,
uint flags,
const TColor & tlColor,
const TColor & brColor,
const TColor & bcColor )
static

Paints a 2-color single pixel-thick frame. Bevel corners get their own color.

Definition at line 165 of file uiborder.cpp.

References Bottom, owl::TRect::Height(), Left, owl::TDC::PatBlt(), owl::TDC::RestoreBrush(), Right, owl::TDC::SelectObject(), owl::TDC::SetPixel(), Top, and owl::TRect::Width().

◆ Size()

void owl::TUIBorder::Size ( int w,
int h )

Resizes the frame rect to (w,h).

Definition at line 82 of file uiborder.cpp.


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