130 lines
3.1 KiB
C++
130 lines
3.1 KiB
C++
#ifndef _BTNST2_H
|
|
#define _BTNST2_H
|
|
|
|
#if _MSC_VER >= 1000
|
|
#pragma once
|
|
#endif // _MSC_VER >= 1000
|
|
|
|
// CBtnST.h : header file
|
|
//
|
|
|
|
// Comment this if you don't want that CButtonST hilights itself
|
|
// also when the window is inactive (like happens in Internet Explorer)
|
|
#define ST_LIKEIE
|
|
|
|
// Comment this if you don't want to use CMemDC class
|
|
#define ST_USE_MEMDC
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CButtonST window
|
|
#include "TAPI.h"
|
|
|
|
class TELAPI CButtonST : public CButton
|
|
{
|
|
DECLARE_DYNAMIC(ATSButtonST)
|
|
// Construction
|
|
public:
|
|
CButtonST();
|
|
~CButtonST();
|
|
enum {ST_ALIGN_HORIZ, ST_ALIGN_VERT};
|
|
|
|
// Attributes
|
|
public:
|
|
|
|
// Operations
|
|
public:
|
|
|
|
// Overrides
|
|
// ClassWizard generated virtual function overrides
|
|
//{{AFX_VIRTUAL(CButtonST)
|
|
public:
|
|
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
|
|
protected:
|
|
virtual void PreSubclassWindow();
|
|
//}}AFX_VIRTUAL
|
|
|
|
// Implementation
|
|
public:
|
|
virtual CWnd * SetCapture();
|
|
BOOL SetBtnCursor(int nCursorId = -1);
|
|
|
|
void SetFlatFocus(BOOL bDrawFlatFocus, BOOL bRepaint = FALSE);
|
|
BOOL GetFlatFocus();
|
|
|
|
void SetDefaultActiveFgColor(BOOL bRepaint = FALSE);
|
|
void SetActiveFgColor(COLORREF crNew, BOOL bRepaint = FALSE);
|
|
const COLORREF GetActiveFgColor();
|
|
|
|
void SetDefaultActiveBgColor(BOOL bRepaint = FALSE);
|
|
void SetActiveBgColor(COLORREF crNew, BOOL bRepaint = FALSE);
|
|
const COLORREF GetActiveBgColor();
|
|
|
|
void SetDefaultInactiveFgColor(BOOL bRepaint = FALSE);
|
|
void SetInactiveFgColor(COLORREF crNew, BOOL bRepaint = FALSE);
|
|
const COLORREF GetInactiveFgColor();
|
|
|
|
void SetDefaultInactiveBgColor(BOOL bRepaint = FALSE);
|
|
void SetInactiveBgColor(COLORREF crNew, BOOL bRepaint = FALSE);
|
|
const COLORREF GetInactiveBgColor();
|
|
|
|
void SetShowText(BOOL bShow = TRUE);
|
|
BOOL GetShowText();
|
|
|
|
void SetAlign(int nAlign);
|
|
int GetAlign();
|
|
|
|
void SetFlat(BOOL bState = TRUE);
|
|
BOOL GetFlat();
|
|
|
|
void DrawBorder(BOOL bEnable = TRUE);
|
|
void SetIcon(HBITMAP hIn, HBITMAP hOut, BYTE cx, BYTE cy);
|
|
|
|
static const short GetVersionI();
|
|
static const char* GetVersionC();
|
|
// 文字对齐方式 0 左对齐 1 居中 2 右对齐
|
|
void SetTextAlign(int nAlign);
|
|
|
|
protected:
|
|
//{{AFX_MSG(CButtonST)
|
|
afx_msg void OnCaptureChanged(CWnd *pWnd);
|
|
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
|
|
afx_msg void OnKillFocus(CWnd* pNewWnd);
|
|
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
|
//}}AFX_MSG
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
protected:
|
|
void DrawTheIcon(CDC* pDC, CString* title, RECT* rcItem, CRect* captionRect, BOOL IsPressed, BOOL IsDisabled);
|
|
|
|
int m_nAlign;
|
|
BOOL m_bShowText;
|
|
BOOL m_bDrawBorder;
|
|
BOOL m_bIsFlat;
|
|
BOOL m_MouseOnButton;
|
|
BOOL m_bDrawFlatFocus;
|
|
|
|
HCURSOR m_hCursor;
|
|
|
|
HBITMAP m_hIconIn;
|
|
HBITMAP m_hIconOut;
|
|
BYTE m_cyIcon;
|
|
BYTE m_cxIcon;
|
|
|
|
COLORREF m_crInactiveBg;
|
|
COLORREF m_crInactiveFg;
|
|
COLORREF m_crActiveBg;
|
|
COLORREF m_crActiveFg;
|
|
// 文字对齐方式
|
|
int m_nTextAlignType;
|
|
};
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
//{{AFX_INSERT_LOCATION}}
|
|
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
|
|
|
#endif
|