www.pudn.com > DVBPlayer.rar > ViewRight.cpp, change:2004-07-15,size:6647b


// ViewRight.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "app.h" 
#include "ViewRight.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CViewRight 
 
IMPLEMENT_DYNCREATE(CViewRight, CView) 
 
CViewRight::CViewRight() 
	: CView() 
{ 
	//{{AFX_DATA_INIT(CViewRight) 
		// NOTE: the ClassWizard will add member initialization here 
	//}}AFX_DATA_INIT 
} 
 
CViewRight::~CViewRight() 
{ 
} 
 
void CViewRight::DoDataExchange(CDataExchange* pDX) 
{ 
	CView::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CViewRight) 
		// NOTE: the ClassWizard will add DDX and DDV calls here 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CViewRight, CView) 
	//{{AFX_MSG_MAP(CViewRight) 
	ON_WM_ERASEBKGND() 
	ON_WM_SIZE() 
	ON_WM_CREATE() 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CViewRight diagnostics 
 
#ifdef _DEBUG 
void CViewRight::AssertValid() const 
{ 
	CView::AssertValid(); 
} 
 
void CViewRight::Dump(CDumpContext& dc) const 
{ 
	CView::Dump(dc); 
} 
#endif //_DEBUG 
 
///////////////////////////////////////////////////////////////////////////// 
// CViewRight message handlers 
 
void CViewRight::OnDraw(CDC* pDC)  
{ 
	// TODO: Add your specialized code here and/or call the base class 
	 
	 
} 
 
BOOL CViewRight::OnEraseBkgnd(CDC* pDC)  
{ 
	// TODO: Add your message handler code here and/or call default 
#if 0 
	CRect rt ;  
	GetClientRect(&rt) ;  
	pDC ->FillSolidRect( &rt, GetSysColor(COLOR_ACTIVEBORDER) ) ;  
	return TRUE ;  
#else 
	return FALSE ;  
//	return CView::OnEraseBkgnd(pDC); 
#endif 
} 
 
void CViewRight::OnInitialUpdate()  
{ 
	CView::OnInitialUpdate(); 
	 
	// TODO: Add your specialized code here and/or call the base class 
 
 
	 
} 
 
void CViewRight::OnSize(UINT nType, int cx, int cy)  
{	 
 
	CView::OnSize(nType, cx, cy); 
	 
 
	// TODO: Add your message handler code here 
	CRect rt ;  
	GetClientRect( &rt ) ;  
 
	if ( m_wnd_play .GetSafeHwnd() ) 
	{ 
		m_wnd_play .SetWindowPos( NULL, rt .left, rt .top  , rt .Width() , rt .Height() - 70, SWP_NOZORDER ) ; 
	} 
	if ( m_proess_play .GetSafeHwnd() ) 
	{ 
		m_proess_play .SetWindowPos( NULL, rt .left  , rt .bottom - 70, rt .Width() , 50, SWP_NOZORDER ) ;  
	} 
 
	if ( m_bt_play .GetSafeHwnd() ) 
	{ 
		m_bt_play .SetWindowPos( NULL, rt .left  , rt .bottom - 20, 25, 20, SWP_NOZORDER ) ;  
	} 
	if ( m_bt_pause .GetSafeHwnd() ) 
	{ 
		m_bt_pause .SetWindowPos( NULL, rt .left + 25 , rt .bottom - 20, 25, 20, SWP_NOZORDER ) ;  
	} 
	if ( m_bt_stop .GetSafeHwnd() ) 
	{ 
		m_bt_stop .SetWindowPos( NULL, rt .left + 50 , rt .bottom - 20, 25, 20, SWP_NOZORDER ) ;  
	} 
	if ( m_bt_first .GetSafeHwnd() ) 
	{ 
		m_bt_first .SetWindowPos( NULL, rt .left + 100 , rt .bottom - 20, 25, 20, SWP_NOZORDER ) ;  
	} 
	if ( m_bt_prev .GetSafeHwnd() ) 
	{ 
		m_bt_prev .SetWindowPos( NULL, rt .left + 125 , rt .bottom - 20, 25, 20, SWP_NOZORDER ) ;  
	} 
	if ( m_bt_next .GetSafeHwnd() ) 
	{ 
		m_bt_next .SetWindowPos( NULL, rt .left + 150 , rt .bottom - 20, 25, 20, SWP_NOZORDER ) ;  
	} 
	if ( m_bt_last .GetSafeHwnd() ) 
	{ 
		m_bt_last .SetWindowPos( NULL, rt .left + 175 , rt .bottom - 20, 25, 20, SWP_NOZORDER ) ;  
	} 
	if ( m_bt_timing_shift .GetSafeHwnd() ) 
	{ 
		m_bt_timing_shift .SetWindowPos( NULL, rt .right - 85, rt .bottom -20, 25, 20, SWP_NOZORDER ) ;  
	} 
	if ( m_text_timing_shift .GetSafeHwnd() ) 
	{ 
		m_text_timing_shift .SetWindowPos( NULL, rt .right - 60, rt .bottom -20, 60, 20, SWP_NOZORDER ) ;  
	} 
	 
 
 
	if ( m_pad1 .GetSafeHwnd() ) 
		m_pad1 .SetWindowPos(NULL, rt .left + 75, rt .bottom -20, 25, 20, SWP_NOZORDER) ;  
	if ( m_pad2 .GetSafeHwnd() ) 
		m_pad2 .SetWindowPos(NULL, rt .left + 200, rt .bottom -20, rt .Width() - 200 - 85, 20, SWP_NOZORDER) ;  
	 
 
	 
} 
 
int CViewRight::OnCreate(LPCREATESTRUCT lpCreateStruct)  
{ 
	if (CView::OnCreate(lpCreateStruct) == -1) 
		return -1; 
	 
	// TODO: Add your specialized creation code here 
	{ 
		m_wnd_play .Create( "", WS_CHILD | WS_VISIBLE | SS_BLACKRECT, CRect( 0,0 ,0 ,0 ), this ) ;  
	} 
	 
	{ 
		m_proess_play .Create(  
			WS_CHILD | WS_VISIBLE | TBS_TOP | WS_BORDER | WS_TABSTOP  ,  
			CRect( 0,0,0,0 ), this, -1 ) ;  
	} 
	 
	{ 
		m_bt_play .Create( "", WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, CRect ( 0,0,0,0 ), this, 0 ) ;  
		m_bt_play .LoadBitmaps(IDB_BITMAP_PLAY) ;  
		m_bt_play .SetTextAlignment(CTrackLookButton::AlignRight) ;  
	} 
	 
	 
	{ 
		m_bt_pause .Create( "", WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, CRect ( 0,0,0,0 ), this, 0 ) ;  
		m_bt_pause .LoadBitmaps(IDB_BITMAP_PAUSE) ;  
		m_bt_pause .SetTextAlignment(CTrackLookButton::AlignRight) ;  
	} 
	 
	{ 
		m_bt_stop .Create( "", WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, CRect ( 0,0,0,0 ), this, 0 ) ;  
		m_bt_stop .LoadBitmaps(IDB_BITMAP_STOP) ;  
		m_bt_stop .SetTextAlignment(CTrackLookButton::AlignRight) ;  
	} 
	 
	{ 
		m_bt_first .Create( "", WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, CRect ( 0,0,0,0 ), this, 0 ) ;  
		m_bt_first .LoadBitmaps(IDB_BITMAP_FIRST) ;  
		m_bt_first .SetTextAlignment(CTrackLookButton::AlignRight) ;  
	} 
	 
	{ 
		m_bt_prev .Create( "", WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, CRect ( 0,0,0,0 ), this, 0 ) ;  
		m_bt_prev .LoadBitmaps(IDB_BITMAP_PREV) ;  
		m_bt_prev .SetTextAlignment(CTrackLookButton::AlignRight) ;  
	} 
	 
	{ 
		m_bt_next .Create( "", WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, CRect ( 0,0,0,0 ), this, 0 ) ;  
		m_bt_next .LoadBitmaps(IDB_BITMAP_NEXT) ;  
		m_bt_next .SetTextAlignment(CTrackLookButton::AlignRight) ;  
	} 
	 
	{ 
		m_bt_last .Create( "", WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, CRect ( 0,0,0,0 ), this, 0 ) ;  
		m_bt_last .LoadBitmaps(IDB_BITMAP_LAST) ;  
		m_bt_last .SetTextAlignment(CTrackLookButton::AlignRight) ;  
	} 
	 
	{ 
		m_bt_timing_shift .Create( "", WS_CHILD | WS_VISIBLE | BS_OWNERDRAW , CRect( 0,0,0,0 ), this, 0 ) ;  
		m_bt_timing_shift .LoadBitmaps(IDB_BITMAP_TIMING_SHIFT) ;  
		m_bt_timing_shift .SetTextAlignment(CTrackLookButton::AlignRight) ; 		 
	} 
	 
	{ 
		m_text_timing_shift .Create( "00:00:00",  
			WS_CHILDWINDOW | WS_GROUP | WS_VISIBLE | WS_EX_STATICEDGE | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR | WS_EX_LEFT  , 
			CRect( 0,0,0,0 ), this ) ;  
	} 
 
 
	m_pad1 .Create("", WS_CHILD | WS_VISIBLE, CRect(0,0,0,0), this) ;  
	m_pad2 .Create("", WS_CHILD | WS_VISIBLE, CRect(0,0,0,0), this) ;  
	 
	 
	 
	return 0; 
} 
 
BOOL CViewRight::PreCreateWindow(CREATESTRUCT& cs)  
{ 
	// TODO: Add your specialized code here and/or call the base class 
	 
	return CView::PreCreateWindow(cs); 
}