cartonbutn.h
来自「一个长度信息管理系统。主要包含了界面编程和对文件操作。」· C头文件 代码 · 共 78 行
H
78 行
#if !defined(AFX_CARTONBUTN_H__803B35BC_CF20_4050_8030_7F94941022A8__INCLUDED_)
#define AFX_CARTONBUTN_H__803B35BC_CF20_4050_8030_7F94941022A8__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Cartonbutn.h : header file
//
class CCartonbutngroup;
/////////////////////////////////////////////////////////////////////////////
// CCartonbutn window
enum BUTTON_STATE{ BUTTON_OFF, BUTTON_ON, BUTTON_OVER, BUTTON_GREYED};
class CCartonbutn : public CBitmapButton
{
friend class CCartonbutngroup;
// Construction
public:
CCartonbutn();
void SetToolTipText(CString s);
void RelayEvent(UINT message, WPARAM wParam, LPARAM lParam);
// Attributes
public:
BUTTON_STATE GetButtonState(void) { return(m_ButtonState);};
BUTTON_STATE SetButtonState(BUTTON_STATE nState);
void SetButtonType(long type){ m_ButtonType = type;}
private:
long m_ButtonType; // 1 : 按下状态发生变化,离开恢复
// 0 : 按下状态发生变化,离开不恢复
CToolTipCtrl m_tooltip;
BOOL m_bMouseTracking;
BUTTON_STATE m_ButtonState;
CBitmap m_bmpButtonDown;
CBitmap m_bmpButtonFocussed;
CBitmap m_bmpButtonUp;
CBitmap m_bmpButtonDisabled;
HWND m_hWndOld;
CCartonbutngroup * m_pOwnerGroup;
void SetOwner (CCartonbutngroup *pGroup) { m_pOwnerGroup = pGroup; };
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCartonbutn)
public:
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
protected:
virtual void PreSubclassWindow();
//}}AFX_VIRTUAL
private:
// Called by OnMouseMove() when entering/leaving the button
void OnMouseLeave(void);
void OnMouseEnter(void);
// Implementation
public:
virtual ~CCartonbutn();
BOOL LoadBitmaps(UINT nBitmapUp, UINT nBitmapDown, UINT nBitmapFocus, UINT nBitmapDisabled);
BOOL LoadBitmaps(LPCSTR lpszBitmapUp, LPCSTR lpszBitmapDown, LPCSTR lpszBitmapFocus, LPCSTR lpszBitmapDisabled);
// Generated message map functions
protected:
//{{AFX_MSG(CCartonbutn)
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CARTONBUTN_H__803B35BC_CF20_4050_8030_7F94941022A8__INCLUDED_)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?