Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

ColorStatic Struct Reference

#include <window.h>

Inheritance diagram for ColorStatic:
Inheritance graph
[legend]
Collaboration diagram for ColorStatic:
Collaboration graph
[legend]

List of all members.

Public Types

typedef SubclassedWindow super

Public Member Functions

 ColorStatic (HWND hwnd, COLORREF textColor=RGB(255, 0, 0), HBRUSH hbrush_bkgnd=0, HFONT hfont=0)
 ColorStatic (HWND owner, int id, COLORREF textColor=RGB(255, 0, 0), HBRUSH hbrush_bkgnd=0, HFONT hfont=0)

Protected Member Functions

LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)

Protected Attributes

COLORREF _textColor
HBRUSH _hbrush_bkgnd
HFONT _hfont

Detailed Description

Definition at line 766 of file window.h.


Member Typedef Documentation

Reimplemented from SubclassedWindow.

Definition at line 768 of file window.h.


Constructor & Destructor Documentation

ColorStatic::ColorStatic ( HWND  hwnd,
COLORREF  textColor = RGB(255,0,0),
HBRUSH  hbrush_bkgnd = 0,
HFONT  hfont = 0 
) [inline]

Definition at line 770 of file window.h.

     :  super(hwnd),
        _textColor(textColor),
        _hbrush_bkgnd(hbrush_bkgnd),
        _hfont(hfont)
    {
    }
ColorStatic::ColorStatic ( HWND  owner,
int  id,
COLORREF  textColor = RGB(255,0,0),
HBRUSH  hbrush_bkgnd = 0,
HFONT  hfont = 0 
) [inline]

Definition at line 778 of file window.h.

     :  super(GetDlgItem(owner, id)),
        _textColor(textColor),
        _hbrush_bkgnd(hbrush_bkgnd),
        _hfont(hfont)
    {
    }

Member Function Documentation

LRESULT ColorStatic::WndProc ( UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
) [inline, protected, virtual]

Reimplemented from SubclassedWindow.

Definition at line 787 of file window.h.

References _hbrush_bkgnd, _hfont, _textColor, PM_DISPATCH_CTLCOLOR, and SubclassedWindow::WndProc().

    {
        if (nmsg == PM_DISPATCH_CTLCOLOR) {
            HDC hdc = (HDC) wparam;

            SetTextColor(hdc, _textColor);

            if (_hfont)
                SelectFont(hdc, _hfont);

            if (_hbrush_bkgnd)
                return (LRESULT)_hbrush_bkgnd;
            else {
                SetBkMode(hdc, TRANSPARENT);
                return (LRESULT)GetStockBrush(HOLLOW_BRUSH);
            }
        } else
            return super::WndProc(nmsg, wparam, lparam);
    }

Here is the call graph for this function:


Member Data Documentation

HBRUSH ColorStatic::_hbrush_bkgnd [protected]

Definition at line 808 of file window.h.

Referenced by WndProc().

HFONT ColorStatic::_hfont [protected]

Definition at line 809 of file window.h.

Referenced by WndProc().

COLORREF ColorStatic::_textColor [protected]

Definition at line 807 of file window.h.

Referenced by WndProc().


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

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage