|
|||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
IntroductionWith this class you can easily give a professional look to your buttons in
few steps. No bitmap resources are needed - all bitmaps are generated at runtime.
Parts of the code come from the CxSkinButton
article.
CxShadeButton Class Members & OperationsCxShadeButton is derived from CButton. The BS_OWNERDRAW
style is added automatically, you don't need to set the "Owner draw" property
in the resource editor. You can change some styles (flat, push-like, text alignment,
group,...) using the resource editor, however not all the styles are currently
supported.If you change the aspect of the button at runtime, to avoid flicker first call the functions that don't cause invalidation (like SetShade,
SetIcon or SetFont) and than invalidate the button, for example with
SetWindowText, or directly with Invalidate.
void SetShade(UINT shadeID=0, BYTE granularity=8, BYTE highlight=10,BYTE coloring=0,COLORREF color=0);
void SetToolTipText(CString s, CString sDown="");
COLORREF SetTextColor(COLORREF new_color);
void SetIcon(UINT nIcon, UINT nIconAlign=BS_CENTER, UINT nIconDown=0,
UINT nIconHighLight=0);
bool SetFont(CString sFontName, long lSize=0, long lWeight=400, BYTE bItalic=0, BYTE bUnderline=0); bool SetFont(LOGFONT* pNewStyle); / LOGFONT* GetFont();
void SetTextAlign(UINT nTextAlign=BS_CENTER);
BS_CENTER
void SetFlat(bool bFlag);
FALSE = standard 3D border.TRUE = flat border.
Release Historyv1.00 - 12/05/2001- basic implementation and interface. v1.10 - 23/05/2001 - added text shift on button down. - fixed many CxDib bugs. - fixed SHS_HARDBUMP bug. - added icon support. - added text alignment. - added flat style. v1.20 - 23/06/2001 - fixed keyboard shortcut bug. - check box & radio button add on. - 2nd icon & 2nd tooltip add on. - memory DC for painting operations. v1.30 - 03/08/2001 - fixed SetIcon bug. - added Font support. v1.40 - 23/09/2001 - fixed memory leakage bug in DrawItem() and SetIcon(). - fixed second tooltip initialization bug. - fixed OnLButtonUp() problem with drag & drop. - added multiline tooltip support. v1.41 - 4/11/2001 - fixed memory leakage bug in SetIcon() and in the destructor. - added 3rd icon for highlighted state. CompatibilityWin95,WinNT = Yes, requires IE3.0 or higher For any questions, e-mail to: ing.davide.pizzolato@libero.it Thanks to all the Code Project developers!
|
||||||||||||||||||||||||||||||||||||