hMemButton.h

 #include <windows.h>
#include <math.h>
#include "hCommonFunctions.h"
#include <string>

using namespace std;
class cMemButton

{


public:

~cMemButton();
HDC CreateMemSurface(HWND hWndParent, string sCaption, int iWidth, int iHeight);
string SetCaption(string sCaption);
string GetCaption();
SIZE SetSize(int iWidth, int iHeight);
SIZE GetSize();
bool SetAutoRedraw(bool bAutoRedraw);
bool GetAutoRedraw();
bool SetEnabled(bool bEnabled);
bool IsEnabled();
bool SetPictureShadow(bool bShadowed);
bool IsPictureShadow();
bool SetPictureSmooth(bool bSmooth);
bool IsPictureSmooth();
COLORREF SetBackColour1(COLORREF crColour);
COLORREF GetBackColour1();
COLORREF SetBackColour2(COLORREF crColour);
COLORREF GetBackColour2();
int SetGradientType(GRADIENTTYPE gt);
int GetGradientType();
HBITMAP SetBackPicture(HBITMAP newpic);
HBITMAP GetBackPicture();
COLORREF SetBackPicMaskColour(COLORREF crColour);
COLORREF GetBackPicMaskColour();
bool SetBackPicTiled(bool bIsTiled);
bool IsBackPicTiled();
HBITMAP SetPicture(HBITMAP newpic);
HBITMAP GetPicture();
COLORREF SetPictureMaskColour(COLORREF crColour);
COLORREF GetPictureMaskColour();
SIZE SetPictureSize(SIZE newsize);
SIZE GetPictureSize();
POINT SetPictureOffset(POINT newoffset);
POINT GetPictureOffset();

int SetVPictureAlign(V_ALIGN iNewAlign);
int GetVPictureAlign();
int SetHPictureAlign(H_ALIGN iNewAlign);
int GetHPictureAlign();

int SetBackStyle(BACKSTYLE bkstyle);
int GetBackStyle();
int SetBorderStyle(BORDERSTYLE style);
int GetBorderStyle();
COLORREF SetBorderColour(COLORREF crColour);
COLORREF GetBorderColour();
int SetBorderWidth(int iWidth);
int GetBorderWidth();
COLORREF SetTextColour(COLORREF crColour);
COLORREF GetTextColour();
POINT SetTextOffset(POINT newoffset);
POINT GetTextOffset();
HFONT SetFont(string sFontname, int iSize, bool bItalic,bool bBold,bool bUnderline,bool bStrikeOut, int iAngle);
int SetVTextAlign(V_ALIGN iNewAlign);
int GetVTextAlign();
int SetHTextAlign(H_ALIGN iNewAlign);
int GetHTextAlign();
void SetMultiline(bool bMultiline);
bool GetMultiline();
void Redraw();
HDC GetSurfaceDC();
bool Show(HDC hDCDest, int X, int Y, bool bAlphaBlend, int iTransparency);

protected:
void DrawResizePicture(HDC &hDCDest);
void DrawSurfaceCaption();
void DrawBackgroundPicture();
void DrawTopPicture();
HWND parenthandle;
HDC memdc, alphamemdc;
HRGN picrgn;
HBITMAP mybmp, backpic, toppic;
bool autoredraw, backpictiled, multiline, enabled, shadowpic, smoothpic;
int borderstyle, backstyle, borderwidth, gradienttype;
int vtalign, htalign, vpalign, hpalign;
POINT picoffset,textoffset;
SIZE picsize;
COLORREF backcolour1, backcolour2, bordercolour, textcolour;
COLORREF backpicmaskcolour, toppicmaskcolour;
HFONT font;
int width, height;
string caption;
};

Project Homepage: