// WndEx.cpp : implementation file
//
#include "stdafx.h"
#include "Nec.h"
#include "WndEx.h"
#include "NecDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CWndEx
int g_nCtrlID = 105;
// ********* CTreeWnd ********** //
BEGIN_MESSAGE_MAP(CTreeWnd, CTreeCtrl)
ON_WM_PAINT()
ON_WM_ERASEBKGND()
END_MESSAGE_MAP()
void CTreeWnd::OnPaint()
{
CPaintDC dc(this);
// CDC dcMem;
dc.SetBkMode(TRANSPARENT);
CWnd::DefWindowProc(WM_PAINT, (WPARAM)dc.m_hDC, 0);
}
BOOL CTreeWnd::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
CRect rc;
CDC *pMemDC=((CNecDlg*)AfxGetMainWnd())->GetBackGroupDC();
int x,y,cx,cy;
ASSERT( pMemDC != NULL && pMemDC->GetSafeHdc() );
GetClientRect(rc);
x = m_rcBitmap.left;
y = m_rcBitmap.top;
cx = 24;
cy = 16;
pDC->SetStretchBltMode(COLORONCOLOR);
pDC->StretchBlt(rc.left,rc.top,rc.Width(),rc.Height(),pMemDC,x,y,cx,cy,SRCCOPY);
return TRUE;
return CTreeCtrl::OnEraseBkgnd(pDC);
}
// ******* CWndEx ********* //
CWndEx::CWndEx()
{
m_bLButtonDown = FALSE;
m_bSetCapture = FALSE;
m_hCursor = NULL;
m_nMouseType = MOUSE_OUT;
m_bTrack = FALSE;
m_rcBitmap = CRect(0,0,0,0);
m_ftFont.CreateFont(-MulDiv(9,-100,72),
0,0,0,FW_NORMAL,0,0,0,
GB2312_CHARSET,OUT_CHARACTER_PRECIS,
CLIP_CHARACTER_PRECIS,
DEFAULT_QUALITY,
VARIABLE_PITCH|FF_SWISS,
"宋体");
}
CWndEx::~CWndEx()
{
}
BEGIN_MESSAGE_MAP(CWndEx, CWnd)
//{{AFX_MSG_MAP(CWndEx)
ON_WM_ACTIVATE()
ON_WM_TIMER()
ON_WM_VSCROLL()
ON_WM_SIZE()
ON_WM_SETCURSOR()
ON_WM_RBUTTONUP()
ON_WM_RBUTTONDOWN()
ON_WM_PAINT()
ON_WM_MOUSEMOVE()
ON_WM_LBUTTONUP()
ON_WM_LBUTTONDOWN()
ON_WM_HSCROLL()
//}}AFX_MSG_MAP
ON_MESSAGE(WM_MSG_PROGRESS,OnMsgProgress)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CWndEx message handlers
void CWndEx::MoveWindow(int x,int y,int nWidth,int nHeight,BOOL bRepaint)
{
CRect rc;
CWnd *pWnd=GetParent();
GetWindowRect(rc);
pWnd->ScreenToClient(rc);
if( rc == CRect(x,y,x+nWidth,y+nHeight) )
return;
CWnd::MoveWindow(x,y,nWidth,nHeight,bRepaint);
}
void CWndEx::MoveWindow(LPCRECT lpRect,BOOL bRepaint)
{
CRect rc;
CWnd *pWnd=GetParent();
GetWindowRect(rc);
pWnd->ScreenToClient(rc);
if( rc == CRect(lpRect) )
return;
CWnd::MoveWindow(lpRect,bRepaint);
}
BOOL CWndEx::Create(CWnd *pParent, UINT nID,const CRect &rect,DWORD dwStyle)
{
CString className = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW,AfxGetApp()->LoadStandardCursor(IDC_ARROW));
BOOL bRet = CWnd::Create(className,"",dwStyle,rect,pParent,nID);
if( !bRet )
return FALSE;
return OnCreate();
}
BOOL CWndEx::OnCommand(WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
CWnd::OnCommand(wParam, lParam);
OnCmd(wParam,lParam);
return TRUE;
}
void CWndEx::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
{
CWnd::OnActivate(nState, pWndOther, bMinimized);
// TODO: Add your message handler code here
OnActivate();
}
void CWndEx::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
CWnd::OnTimer(nIDEvent);
OnTime(nIDEvent);
}
void CWndEx::OnMsgProgress(WPARAM wParam,LPARAM lParam)
{
OnProgress(wParam,lParam);
}
void CWndEx::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
CWnd::OnVScroll(nSBCode, nPos, pScrollBar);
OnVScroll();
}
void CWndEx::OnSize(UINT nType, int cx, int cy)
{
CWnd::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
OnSize();
}
void CWndEx::DrawRect(CDC *pDC,const CRect &rc)
{
pDC->MoveTo(rc.left,rc.top);
pDC->LineTo(rc.right,rc.top);
pDC->LineTo(rc.right,rc.bottom);
pDC->LineTo(rc.left,rc.bottom);
pDC->LineTo(rc.left,rc.top);
}
BOOL CWndEx::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// TODO: Add your message handler code here and/or call default
if( m_hCursor != NULL )
{
SetCursor(m_hCursor);
return TRUE;
}
else
{
return CWnd::OnSetCursor(pWnd, nHitTest, message);
}
}
void CWndEx::OnRButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CWnd::OnRButtonUp(nFlags, point);
OnRButtonUp();
}
void CWndEx::OnRButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CWnd::OnRButtonDown(nFlags, point);
OnRButtonDown();
}
void CWndEx::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
CRect rc;
dc.GetClipBox(rc);
OnPaint(&dc,rc);
}
void CWndEx::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CWnd::OnMouseMove(nFlags, point);
AfxGetMainWnd()->PostMessage(WM_COMMAND,IDM_MOUSE_INCLIENT,0);
OnMouseMove();
}
void CWndEx::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CWnd::OnLButtonUp(nFlags, point);
OnLButtonUp();
}
void CWndEx::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CWnd::OnLButtonDown(nFlags, point);
OnLButtonDown();
}
void CWndEx::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
CWnd::OnHScroll(nSBCode, nPos, pScrollBar);
OnHScroll();
}
// *********** CStateWnd ********************* //
void CStateWnd::SetText(int nIndex,const CString &str)
{
if( nIndex == 0 )
m_strText1=str;
else
m_strText2=str;
if( GetSafeHwnd() )
{
CRect rc;
CClientDC dc(this);
GetTextRect(rc,nIndex);
OnPaint(&dc,rc);
}
}
void CStateWnd::GetTextRect(CRect &rc,int nIndex)
{
GetClientRect(rc);
rc.right -= 45;
rc.left = rc.right - 100;
if( nIndex == 0 )// text1
{
rc.right = rc.left;
rc.left = 3;
}
else // text2
{
rc.left += 3;
}
}
void CStateWnd::OnSize()
{
CRect rc;
GetClientRect(rc);
rc.right -= 2;
rc.left = rc.right - 19;
if( m_wndOpen.GetSafeHwnd() )
{
m_wndOpen.MoveWindow(rc);
}
rc.OffsetRect(-rc.Width()-2,0);
if( m_wndVideo.GetSafeHwnd() )
{
m_wndVideo.MoveWindow(rc);
}
}
BOOL CStateWnd::OnCreate()
{
CRect rc(0,0,0,0);
if( !m_wndOpen.Create(this,g_nCtrlID++,rc) )
return FALSE;
if( !m_wndVideo.Create(this,g_nCtrlID++,rc) )
return FALSE;
rc.top = 384;
m_wndVideo.SetBitmapRect(rc);
rc.left = 128;
m_wndOpen.SetBitmapRect(rc);
return TRUE;
}
void CStateWnd::OnPaint(CDC *pDC,const CRect &rcClip)
{
CRect rc;
CBitmap bitmap;
CDC dcMem;
GetClientRect(rc);
if( !dcMem.CreateCompatibleDC(NULL) )
return;
if( !bitmap.CreateCompatibleBitmap(pDC,rc.right,rc.bottom) )
{
dcMem.DeleteDC();
return;
}
dcMem.SelectObject(&bitmap);
dcMem.SelectObject(&m_ftFont);
dcMem.SetBkMode(TRANSPARENT);
dcMem.FillRect(rc,&CBrush(RGB(0,0,0)));
/* CRect rect=rc;
rc.right -= 45;
rc.left = rc.right - 130;
GetTextRect(rc,1);
dcMem.SetTextColor(RGB(200,200,255));
dcMem.DrawText(m_strText2,rc,DT_LEFT|DT_VCENTER|DT_SINGLELINE);
rc.OffsetRect(-rc.Width(),0);
rc.left = rect.left + 3;
*/
dcMem.SetTextColor(RGB(200,200,255));
GetTextRect(rc,1);
dcMem.DrawText(m_strText2,rc,DT_LEFT|DT_VCENTER|DT_SINGLELINE);
GetTextRect(rc,0);
dcMem.DrawText(m_strText1,rc,DT_LEFT|DT_VCENTER|DT_SINGLELINE);
pDC->BitBlt(rcClip.left,rcClip.top,rcClip.Width(),rcClip.Height(),&dcMem,rcClip.left,rcClip.top,SRCCOPY);
dcMem.DeleteDC();
bitmap.Del
没有合适的资源?快使用搜索试试~ 我知道了~
一个好看的多媒体对话框播放界面
共49个文件
bmp:8个
h:8个
cpp:7个
4星 · 超过85%的资源 需积分: 10 16 下载量 140 浏览量
2008-10-17
23:48:43
上传
评论
收藏 2.37MB RAR 举报
温馨提示
这是一个好看的播放界面,由一个重庆大学软件学院软件工程2002级一个学生写的,呵呵不是我啊
资源推荐
资源详情
资源评论
收起资源包目录
.rar (49个子文件)
好看
StdAfx.cpp 205B
resource.h 2KB
Menu
MenuXP.cpp 16KB
Draw.cpp 22KB
Tools.cpp 3KB
Draw.h 5KB
Tools.h 2KB
MenuXP.h 4KB
Nec.opt 77KB
Nec.plg 2KB
WndEx.cpp 40KB
Nec.h 1KB
Nec.ncb 273KB
WndEx.h 7KB
NecDlg.cpp 23KB
Debug
Nec.pdb 633KB
Tools.obj 7KB
Draw.obj 48KB
vc60.pdb 380KB
Nec.obj 26KB
vc60.idb 225KB
MenuXP.obj 92KB
Nec.pch 5.37MB
StdAfx.obj 104KB
WndEx.obj 130KB
Nec.exe 720KB
Nec.ilk 547KB
Nec.res 425KB
NecDlg.obj 122KB
Nec.aps 444KB
StdAfx.h 1KB
Nec.dsp 6KB
res
Next_In.bmp 1KB
复件 背景.bmp 422KB
cursor_e.cur 326B
背景.bmp 422KB
Play_Out.bmp 1KB
Nec.ico 1KB
Audio_Normal.bmp 1KB
toolbar1.bmp 598B
Play_Down.bmp 1KB
Audio_Up.bmp 1KB
Nec.rc2 395B
Nec.cpp 2KB
NecDlg.h 3KB
Nec.dsw 531B
Nec.clw 1KB
Nec.rc 6KB
下载说明.htm 5KB
共 49 条
- 1
资源评论
- JK-Cool2012-12-18不错 还比较实用
bojiazu
- 粉丝: 2
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功