?? titlebox.h
字號(hào):
/////////////////////////////////////////////////////////////////////////////
//CTitleBox:標(biāo)題框
//
//在Dreamweaver、Flash等軟件中的工具窗口上有一種標(biāo)題框,點(diǎn)擊后會(huì)使工具窗口
//打開或關(guān)閉,本按鈕就是仿造它的形狀做出來的。
//
//用法:
//①在對(duì)話框中放置一個(gè)按鈕控件,把大小調(diào)整合適;
//②為按鈕定義變量,類型改為CTitleBox;
//③在對(duì)話框的OnInitDialog()函數(shù)中設(shè)置標(biāo)題框顏色和初始風(fēng)格。
//
//作者:風(fēng)林
// 2004-12-18
////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_TITLEBOX_H__1A63B251_18D3_4999_BD5B_6421A9838A4D__INCLUDED_)
#define AFX_TITLEBOX_H__1A63B251_18D3_4999_BD5B_6421A9838A4D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TitleBox.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CTitleBox window
//按鈕狀態(tài)
#define BUT_STATUS_DOWN 1 //箭頭向下的標(biāo)題框
#define BUT_STATUS_RIGHT 2 //箭頭向右的標(biāo)題框
class CTitleBox : public CButton
{
// Construction
public:
CTitleBox();
private:
int m_butStatus; //按鈕狀態(tài)
COLORREF m_ForeColor; //文本顏色
COLORREF m_BkColor; //背景色
CString m_strText; //按鈕文本
BOOL b_InRect; //鼠標(biāo)進(jìn)入標(biāo)志
BOOL b_Click; //是否單擊過
CRect m_InvalRect; //有效區(qū)尺寸
// Attributes
public:
void SetForeColor(COLORREF color); //設(shè)置文本顏色
void SetBkColor(COLORREF color); //設(shè)置背景顏色
int GetButStatus(); //獲取按鈕狀態(tài)
void SetButStatus(int Status); //設(shè)置按鈕狀態(tài)
BOOL ClickBut(); //是否單擊過按鈕文字區(qū)
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTitleBox)
public:
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
protected:
virtual void PreSubclassWindow();
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CTitleBox();
// Generated message map functions
protected:
//{{AFX_MSG(CTitleBox)
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_TITLEBOX_H__1A63B251_18D3_4999_BD5B_6421A9838A4D__INCLUDED_)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -