- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
RoundRect.cpp
资源名称:视频会议系统.rar [点击查看]
上传用户:popouu88
上传日期:2013-02-11
资源大小:2894k
文件大小:1k
源码类别:
IP电话/视频会议
开发平台:
Visual C++
- // RoundRect.cpp: implementation of the CRoundRect class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "RoundRect.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[]=__FILE__;
- #define new DEBUG_NEW
- #endif
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CRoundRect::CRoundRect( CDrawView * view ) : CDraw( view )
- {
- this->type = ROUNDRECT;
- }
- CRoundRect::~CRoundRect()
- {
- }
- void CRoundRect::MouseMove( UINT nFlags , CPoint point )
- {
- if( MK_LBUTTON & nFlags )
- {
- this->end = point;
- if( MK_SHIFT & nFlags )
- { //计算最小的边
- int min = min( abs( this->end.x - this->start.x ) , abs( this->end.y - this->start.y ) );
- //计算最小的矩形
- this->end.x = this->start.x + ( this->end.x > this->start.x ? 1 : -1 ) * min;
- this->end.y = this->start.y + ( this->end.y > this->start.y ? 1 : -1 ) * min;
- }
- }
- CDraw::MouseMove( nFlags , point );
- }
- CDC * CRoundRect::Draw( CDC * pDC )
- {
- pDC = CDraw::Draw( pDC );
- if( pDC )
- {
- CRect rc( this->start , this->end );
- rc.NormalizeRect( );
- pDC->RoundRect( rc , CPoint( 15 , 15 ) );
- }
- return pDC;
- }