91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 4KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2023-07-18
  • 語言: C/C++
  • 標簽: VC++??圓形按鈕??MFC??

資源簡介

CSDN上原有此類資源,但卻使用了全局函數,本人稍微修改封裝成了一個獨立的類。

資源截圖

代碼片段和文件信息

//?RoundButton.cpp?:?implementation?file
//
//?Round?Buttons!
//
//?Written?by?Chris?Maunder?(Chris.Maunder@cbr.clw.csiro.au)
//?Copyright?(c)?19971998.
//?
//?Modified:?2?Feb?1998?-?Fix?vis?problem?CRgn?resource?leak
//????????????????????????button?reposition?code?redone.?CJM.
//
//?This?code?may?be?used?in?compiled?form?in?any?way?you?desire.?This
//?file?may?be?redistributed?unmodified?by?any?means?PROVIDING?it?is?
//?not?sold?for?profit?without?the?authors?written?consent?and?
//?providing?that?this?notice?and?the?authors?name?is?included.?If?
//?the?source?code?in?this?file?is?used?in?any?commercial?application?
//?then?a?simple?email?would?be?nice.
//
//?This?file?is?provided?“as?is“?with?no?expressed?or?implied?warranty.
//?The?author?accepts?no?liability?if?it?causes?any?damage?to?your
//?computer?causes?your?pet?cat?to?fall?ill?increases?baldness?or
//?makes?you?car?start?emitting?strange?noises?when?you?start?it?up.
//
//?Expect?bugs.
//?
//?Please?use?and?enjoy.?Please?let?me?know?of?any?bugs/mods/improvements?
//?that?you?have?found/implemented?and?I?will?fix/incorporate?them?into?this
//?file.?
//
/////////////////////////////////////////////////////////////////////////////

#include?“stdafx.h“
#include?
#include?“RoundButton.h“

#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
//?CRoundButton

CRoundButton::CRoundButton()
{
m_bDrawDashedFocusCircle?=?TRUE;
}

CRoundButton::~CRoundButton()
{
m_rgn.Deleteobject();
}

BEGIN_MESSAGE_MAP(CRoundButton?CButton)
//{{AFX_MSG_MAP(CRoundButton)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
//?CRoundButton?message?handlers

void?CRoundButton::PreSubclassWindow()?
{
CButton::PreSubclassWindow();

Modifystyle(0?BS_OWNERDRAW);

CRect?rect;
GetClientRect(rect);

//?Resize?the?window?to?make?it?square
rect.bottom?=?rect.right?=?min(rect.bottomrect.right);

//?Get?the?vital?statistics?of?the?window
m_ptCentre?=?rect.CenterPoint();
m_nRadius??=?rect.bottom/2-1;

//?Set?the?window?region?so?mouse?clicks?only?activate?the?round?section?
//?of?the?button
m_rgn.Deleteobject();?
SetWindowRgn(NULL?FALSE);
m_rgn.CreateEllipticRgnIndirect(rect);
SetWindowRgn(m_rgn?TRUE);

//?Convert?client?coords?to?the?parents?client?coords
ClientToScreen(rect);
CWnd*?pParent?=?GetParent();
if?(pParent)?pParent->ScreenToClient(rect);

//?Resize?the?window
MoveWindow(rect.left?rect.top?rect.Width()?rect.Height()?TRUE);
}

void?CRoundButton::DrawItem(LPDRAWITEMSTRUCT?lpDrawItemStruct)?
{
ASSERT(lpDrawItemStruct?!=?NULL);

CDC*?pDC???=?CDC::FromHandle(lpDrawItemStruct->hDC);
CRect?rect?=?lpDrawItemStruct->rcItem;
UINT?state?=?lpDrawItemStruct->itemState;
UINT?nstyle?=?Getstyle();
int?

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????9310??2009-12-13?21:35??RoundButtons\RoundButton.cpp

?????文件???????2620??2009-12-13?21:30??RoundButtons\RoundButton.h

?????目錄??????????0??2009-12-13?20:04??RoundButtons

-----------?---------??----------?-----??----

????????????????11930????????????????????3


評論

共有 條評論