You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mitlib.pub/MITLIB/Utility/ShadeButtonST.h

136 lines
3.9 KiB
C++

//
// Class: CShadeButtonST
//
// Compiler: Visual C++
// eMbedded Visual C++
// Tested on: Visual C++ 6.0
// Windows CE 3.0
//
// Created: 14/June/2001
// Updated: 25/November/2002
//
// Author: Davide Calabro' davide_calabro@yahoo.com
// http://www.softechsoftware.it
//
// Disclaimer
// ----------
// THIS SOFTWARE AND THE ACCOMPANYING FILES ARE DISTRIBUTED "AS IS" AND WITHOUT
// ANY WARRANTIES WHETHER EXPRESSED OR IMPLIED. NO REPONSIBILITIES FOR POSSIBLE
// DAMAGES OR EVEN FUNCTIONALITY CAN BE TAKEN. THE USER MUST ASSUME THE ENTIRE
// RISK OF USING THIS SOFTWARE.
//
// Terms of use
// ------------
// THIS SOFTWARE IS FREE FOR PERSONAL USE OR FREEWARE APPLICATIONS.
// IF YOU USE THIS SOFTWARE IN COMMERCIAL OR SHAREWARE APPLICATIONS YOU
// ARE GENTLY ASKED TO DONATE 5$ (FIVE U.S. DOLLARS) TO THE AUTHOR:
//
// Davide Calabro'
// P.O. Box 65
// 21019 Somma Lombardo (VA)
// Italy
//
#if !defined(AFX_SHADEBUTTONST_H__112CC337_38B5_43AD_A153_CD907FE4F039__INCLUDED_)
#define AFX_SHADEBUTTONST_H__112CC337_38B5_43AD_A153_CD907FE4F039__INCLUDED_
#include "BtnST.h"
#include "CeXDib.h"
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifdef BUILD_UTILITYDLL
#define UTILITYDLL __declspec(dllexport)
#else
#define UTILITYDLL __declspec(dllimport)
#endif
// ShadeButtonST.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CShadeButtonST window
class UTILITYDLL CShadeButtonST : public CButtonST
{
// Construction
public:
CShadeButtonST();
virtual ~CShadeButtonST();
enum {
SHS_NOISE = 0,
SHS_DIAGSHADE,
SHS_HSHADE,
SHS_VSHADE,
SHS_HBUMP,
SHS_VBUMP,
SHS_SOFTBUMP,
SHS_HARDBUMP,
SHS_METAL
};
void SetShade(UINT shadeID = SHS_HARDBUMP, BYTE granularity = 8, BYTE highlight = 10, BYTE coloring = 5, COLORREF color = RGB(55, 255, 55));
private:
CCeXDib m_dNormal, m_dDown, m_dDisabled, m_dOver, m_dh, m_dv;
// Gary, 20Jul09, change all customized UI to static variable to improve loading time
static bool m_bCustomizedOptionLoaded;
static bool m_bCustomizedColor;
static COLORREF m_colorBackground;
static unsigned int m_unShadeID;
static unsigned char m_ucGranularity;
static unsigned char m_ucHighlight;
static unsigned char m_ucColoring;
// Gary 1Sep10 V1.16.03, flag to indicate to use runtime set bk color
bool m_bUseRuntimeBkColor;
COLORREF m_colorRuntimeBk;
unsigned char m_ucColoringRuntimeBK;
protected:
virtual DWORD OnDrawBorder(CDC* pDC, CRect* pRect);
virtual DWORD OnDrawBackground(CDC* pDC, CRect* pRect);
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
// {{AFX_VIRTUAL(CShadeButtonST)
// }}AFX_VIRTUAL
// Implementation
public:
// Gary 1Sep10 V1.16.03, method to set different background color
void SetShade(COLORREF colorBk, unsigned char unColoringTone = 40);
// Gary 26Aug10 V1.16.03, method to set text color
void SetTextColor(COLORREF colorText, BOOL bRepaint = TRUE);
// Gary 26Aug10 V1.16.03, method to get text color
void GetTextColor(COLORREF *colorText);
// Generated message map functions
protected:
// {{AFX_MSG(CShadeButtonST)
// NOTE - the ClassWizard will add and remove member functions here.
// }}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
// {{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SHADEBUTTONST_H__112CC337_38B5_43AD_A153_CD907FE4F039__INCLUDED_)