?? fg_group.cpp
字號(hào):
/*--------------------------------------------------------------------------
FG_Group.cpp - 分組控件類(lèi)的實(shí)現(xiàn)文件
本程序是FishGUI軟件的一部分
版權(quán)所有 (C) 2003,2004 王詠武
http://www.contextfree.net/wangyw/
----------------------------------------------------------------------------
作者對(duì) FishGUI 軟件及其所有源代碼授權(quán)如下:
允許任何個(gè)人、組織、機(jī)構(gòu)、企業(yè)無(wú)償獲得、修改、使用、重新發(fā)布 FishGUI 軟
件及其源代碼,或按照有償或者無(wú)償?shù)姆绞桨l(fā)行基于 FishGUI 源代碼的全部或部
分內(nèi)容開(kāi)發(fā)的軟件產(chǎn)品,——但行使以上權(quán)利時(shí),須遵守以下約定:
1、重新發(fā)布 FishGUI 軟件及其源代碼時(shí),不得隱去軟件及其源代碼中原有的版
權(quán)信息和開(kāi)發(fā)者標(biāo)識(shí)。
2、發(fā)行基于 FishGUI 源代碼的全部或部分內(nèi)容開(kāi)發(fā)的軟件產(chǎn)品時(shí),必須在產(chǎn)品
的顯著位置標(biāo)明以下字樣:
【本產(chǎn)品的一部分功能是基于王詠武在 FishGUI 軟件中的工作完成的】
3、在正式出版物中引用 FishGUI 的文檔、源代碼或注釋內(nèi)容的,應(yīng)注明軟件的
原作者為王詠武。
--------------------------------------------------------------------------*/
/*! \addtogroup Framework
* @{
*/
/*! \file
* \brief 分組控件類(lèi)的實(shí)現(xiàn)文件
*/
/*! @} */
#include "FG_Group.h"
BEGIN_MESSAGE_MAP(FG_Group, FG_TextWidget)
ON_DRAW (FG_Group::OnDraw)
END_MESSAGE_MAP()
//##ModelId=3F6193A701A6
void FG_Group::OnDraw(FG_OSAdaptor * pAdaptor)
{
pAdaptor->BeginDraw(m_Rect);
FG_Widget::OnDraw(pAdaptor);
if (TextLength())
{
// 畫(huà)標(biāo)題
FG_Rect rect;
GetClientRect(rect);
WORD x;
x = pAdaptor->GetTextWidth(GetText());
// 畫(huà)邊框
FG_Point p[6];
p[0].y = p[1].y = p[4].y = p[5].y = rect.wTop + 6;
p[0].x = rect.wLeft + 16;
p[1].x = p[2].x = rect.wLeft;
p[2].y = p[3].y = rect.wBottom - 1;
p[3].x = p[4].x = rect.wRight - 1;
p[5].x = rect.wLeft + 20 + x;
pAdaptor->DrawPolyLine(6, p, COLOR_DARKGRAY);
p[0].y = p[1].y = rect.wTop + 7;
p[0].x = rect.wLeft + 16;
p[1].x = p[2].x = rect.wLeft + 1;
p[2].y = rect.wBottom - 2;
pAdaptor->DrawPolyLine(3, p, COLOR_WHITE);
p[0].y = p[1].y = rect.wBottom;
p[0].x = rect.wLeft;
p[1].x = p[2].x = rect.wRight;
p[2].y = rect.wTop + 6;
pAdaptor->DrawPolyLine(3, p, COLOR_WHITE);
pAdaptor->Line(rect.wLeft + 20 + x, rect.wTop + 7, rect.wRight - 2, rect.wTop + 7, COLOR_WHITE);
pAdaptor->DrawText(GetText(), rect.wLeft+18, rect.wTop+1, m_ForeColor);
}
pAdaptor->EndDraw();
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -