Humble Framework for SkyOS


Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

HGC Class Reference
[Graphical User Interface]

#include <HGUI.h>

Inheritance diagram for HGC:

HObjNoCopy HObj

Detailed Description

A thin wrapper to simplify the creation and usage of Graphic Contexts

Definition at line 643 of file HGUI.h.

Public Member Functions

ErrCode Create (int32 nType, int32 nWidth, int32 nHeight, HANDLE hWnd)
 Creates the Graphic Context.
ErrCode Destroy (void)
 Destroys the Graphic Context.
ErrCode DrawDib (const HDib &dib, const HPoint &ptOrg, HRect const *prSrc=NULL)
 Draws the DIB within a Graphic Context (GC).
ErrCode DrawDib (const HDib &dib, const HRect &rDraw)
 Draws a DIB within the Graphic Context (GC).
ErrCode DrawLine (int32 nXFrom, int32 nYFrom, int32 nXTo, int32 nYTo) const
 Draws a line with the foreground color.
ErrCode DrawLine (const HPoint &ptFrom, const HPoint &ptTo) const
 Draws a line with the foreground color.
ErrCode DrawRect (int32 nX, int32 nY, int32 nXDim, int32 nYDim) const
 Frames a rectangle with the foreground color.
ErrCode DrawRect (const HRect &rDraw) const
 Draws a rectangle with the foreground color.
ErrCode DrawText (const HRect &rText, StringPtr pstr)
 Draws a text string in the current font.
ErrCode FillRect (int32 nX, int32 nY, int32 nXDim, int32 nYDim) const
 Fills a rectangle with the foreground color.
ErrCode FillRect (const HRect &rFill) const
 Fills a rectangle with the foreground color.
GC * Get (void) const
 Returns a ptr to the underlying GC.
int32 GetFontSize (void) const
 Gets the font size.
ErrCode SetBackColor (COLOR clrBG) const
 Sets the background color.
ErrCode SetClipRect (const HRect &rClip) const
 Sets the clip rectangle.
ErrCode SetColors (COLOR clrBG, COLOR clrFG, uint32 uTrans=~0)
 Sets the background and foreground colors simultaneously.
ErrCode SetFont (HFont &font, uint32 uSize=0, uint32 uFlags=0, uint32 uTrans=1) const
 Sets the font.
ErrCode SetFontFlags (int32 nFlags)
 Sets the font flags.
ErrCode SetFontSize (int32 nSize)
 Sets the font size.
ErrCode SetForeColor (COLOR clrFG) const
 Sets the foreground color.
bool IsValid (void) const
 Evaluates the validity of the GC.
 operator GC * () const

Protected Attributes

GC * m_pGC
 Ptr to underlying GC structure.
int32 m_nFontSize
 Font size.


Member Function Documentation

ErrCode HGC::Create int32  nType,
int32  nWidth,
int32  nHeight,
HANDLE  hWnd
 

Returns:
NO_ERROR on sucess, error code otherwise

Definition at line 671 of file HGUI.h.

ErrCode HGC::Destroy void   ) 
 

Returns:
NO_ERROR on success, error code otherwise

Definition at line 696 of file HGUI.h.

ErrCode HGC::DrawDib const HDib dib,
const HPoint ptOrg,
HRect const *  prSrc = NULL
 

This method 'draws' a DIB into the Graphic Context at a given location. An optional source rectangle can also be specified, otherwise the entire DIB is drawn.

Returns:
NO_ERROR on success, error code otherwise
Parameters:
dib Device independent bitmap (DIB)
ptOrg Location to draw into (destination)
prSrc [optional] Ptr to source rectangle

Definition at line 726 of file HGUI.h.

ErrCode HGC::DrawDib const HDib dib,
const HRect rDraw
 

This method 'draws' a DIB into the Graphic Context at a given location. An optional source rectangle can also be specified, otherwise the entire DIB is drawn.

Returns:
NO_ERROR on success, error code otherwise
Parameters:
dib Device independent bitmap (DIB)
rDraw Source and destination rectangle

Definition at line 776 of file HGUI.h.

ErrCode HGC::DrawLine int32  nXFrom,
int32  nYFrom,
int32  nXTo,
int32  nYTo
const
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
nXFrom X coordinate of origin
nYFrom Y coordinate of origin
nXTo X coordinate of destination
nYTo Y coordinate of destination

Definition at line 813 of file HGUI.h.

ErrCode HGC::DrawLine const HPoint ptFrom,
const HPoint ptTo
const
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
ptFrom Origin
ptTo Destination

Definition at line 834 of file HGUI.h.

ErrCode HGC::DrawRect int32  nX,
int32  nY,
int32  nXDim,
int32  nYDim
const
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
nX X coordinate of origin (left)
nY Y coordinate of origin (top)
nXDim Width in pixels
nYDim Height in pixels

Definition at line 847 of file HGUI.h.

ErrCode HGC::DrawRect const HRect rDraw  )  const
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
rDraw Rectangle to draw

Definition at line 867 of file HGUI.h.

ErrCode HGC::DrawText const HRect rText,
StringPtr  pstr
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
rText Desired rectangle
pstr Text string

Definition at line 878 of file HGUI.h.

ErrCode HGC::FillRect int32  nX,
int32  nY,
int32  nXDim,
int32  nYDim
const
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
nX X coordinate of origin (left)
nY Y coordinate of origin (top)
nXDim Width in pixels (must be > 0)
nYDim Height in pixels (must be > 0)

Definition at line 899 of file HGUI.h.

ErrCode HGC::FillRect const HRect rFill  )  const
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
rFill Rectangle to fill

Definition at line 921 of file HGUI.h.

GC* HGC::Get void   )  const
 

Returns:
GC ptr

Definition at line 930 of file HGUI.h.

int32 HGC::GetFontSize void   )  const
 

Returns:
Font size

Definition at line 935 of file HGUI.h.

ErrCode HGC::SetBackColor COLOR  clrBG  )  const
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
clrBG Desired background color

Definition at line 943 of file HGUI.h.

ErrCode HGC::SetClipRect const HRect rClip  )  const
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
rClip Rectangle to clip to

Definition at line 963 of file HGUI.h.

ErrCode HGC::SetColors COLOR  clrBG,
COLOR  clrFG,
uint32  uTrans = ~0
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
clrBG Background color
clrFG Foreground color
uTrans Transparency level (?)

Definition at line 986 of file HGUI.h.

ErrCode HGC::SetFont HFont font,
uint32  uSize = 0,
uint32  uFlags = 0,
uint32  uTrans = 1
const
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
font Font to set
uSize [optional] Font size in points
uFlags [optional] Font flags
uTrans [optional] Transparency level (?)

Definition at line 1005 of file HGUI.h.

ErrCode HGC::SetFontFlags int32  nFlags  ) 
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
nFlags Desired flags

Definition at line 1028 of file HGUI.h.

ErrCode HGC::SetFontSize int32  nSize  ) 
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
nSize Desired size

Definition at line 1048 of file HGUI.h.

ErrCode HGC::SetForeColor COLOR  clrFG  )  const
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
clrFG Desired foreground color

Definition at line 1070 of file HGUI.h.

bool HGC::IsValid void   )  const
 

Returns:
True if GC is valid, false otherwise

Definition at line 1090 of file HGUI.h.


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

2006.01.09-16:37