PictureButton Struct Reference

Subclass button controls to paint pictures left to the labels. More...

#include <window.h>

Inheritance diagram for PictureButton:

Inheritance graph
[legend]
Collaboration diagram for PictureButton:

Collaboration graph
[legend]

Public Types

typedef OwnerdrawnButton super

Public Member Functions

 PictureButton (HWND hwnd, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
 PictureButton (HWND hparent, int id, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
 PictureButton (HWND hwnd, HBITMAP hBmp, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
 PictureButton (HWND hparent, int id, HBITMAP hBmp, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)

Protected Member Functions

virtual void DrawItem (LPDRAWITEMSTRUCT dis)

Protected Attributes

HICON _hIcon
HBITMAP _hBmp
HBRUSH _hBrush
int _cx
int _cy
bool _flat

Detailed Description

Subclass button controls to paint pictures left to the labels.

The buttons should have set the style bit BS_OWNERDRAW. The owning window should use the OwnerDrawParent template to route owner draw messages to the buttons.

Definition at line 699 of file window.h.


Member Typedef Documentation

typedef OwnerdrawnButton PictureButton::super

Reimplemented from OwnerdrawnButton.

Definition at line 701 of file window.h.


Constructor & Destructor Documentation

PictureButton::PictureButton ( HWND  hwnd,
HICON  hIcon,
HBRUSH  hbrush = GetSysColorBrush(COLOR_BTNFACE),
bool  flat = false 
) [inline]

Definition at line 703 of file window.h.

References _cx, and _cy.

00704      :  super(hwnd), _hIcon(hIcon), _hBmp(0), _hBrush(hbrush), _flat(flat)
00705     {
00706         _cx = 16;
00707         _cy = 16;
00708     }

PictureButton::PictureButton ( HWND  hparent,
int  id,
HICON  hIcon,
HBRUSH  hbrush = GetSysColorBrush(COLOR_BTNFACE),
bool  flat = false 
) [inline]

Definition at line 710 of file window.h.

References _cx, and _cy.

00711      :  super(GetDlgItem(hparent, id)), _hIcon(hIcon), _hBmp(0), _hBrush(hbrush), _flat(flat)
00712     {
00713         _cx = 16;
00714         _cy = 16;
00715     }

PictureButton::PictureButton ( HWND  hwnd,
HBITMAP  hBmp,
HBRUSH  hbrush = GetSysColorBrush(COLOR_BTNFACE),
bool  flat = false 
) [inline]

Definition at line 717 of file window.h.

References _cx, and _cy.

00718      :  super(hwnd), _hIcon(0), _hBmp(hBmp), _hBrush(hbrush), _flat(flat)
00719     {
00720         BITMAP bmp;
00721         GetObject(hBmp, sizeof(bmp), &bmp);
00722         _cx = bmp.bmWidth;
00723         _cy = bmp.bmHeight;
00724     }

PictureButton::PictureButton ( HWND  hparent,
int  id,
HBITMAP  hBmp,
HBRUSH  hbrush = GetSysColorBrush(COLOR_BTNFACE),
bool  flat = false 
) [inline]

Definition at line 726 of file window.h.

References _cx, and _cy.

00727      :  super(GetDlgItem(hparent, id)), _hIcon(0), _hBmp(hBmp), _hBrush(hbrush), _flat(flat)
00728     {
00729         BITMAP bmp;
00730         GetObject(hBmp, sizeof(bmp), &bmp);
00731         _cx = bmp.bmWidth;
00732         _cy = bmp.bmHeight;
00733     }


Member Function Documentation

virtual void PictureButton::DrawItem ( LPDRAWITEMSTRUCT  dis  )  [protected, virtual]

Implements OwnerdrawnButton.


Field Documentation

HICON PictureButton::_hIcon [protected]

Definition at line 738 of file window.h.

HBITMAP PictureButton::_hBmp [protected]

Definition at line 739 of file window.h.

HBRUSH PictureButton::_hBrush [protected]

Definition at line 740 of file window.h.

int PictureButton::_cx [protected]

Definition at line 742 of file window.h.

Referenced by PictureButton().

int PictureButton::_cy [protected]

Definition at line 743 of file window.h.

Referenced by PictureButton().

bool PictureButton::_flat [protected]

Definition at line 745 of file window.h.


The documentation for this struct was generated from the following file:
IBrowser Source Code Documentation
generated on 18.09.2008 by doxygen

Homepage