www.pudn.com > DVBPlayer.rar > appView.cpp, change:2004-07-08,size:5066b


// appView.cpp : implementation of the CAppView class 
// 
 
#include "stdafx.h" 
#include "app.h" 
 
#include "appDoc.h" 
#include "appView.h" 
 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CAppView 
 
IMPLEMENT_DYNCREATE(CAppView, CView) 
 
BEGIN_MESSAGE_MAP(CAppView, CView) 
	//{{AFX_MSG_MAP(CAppView) 
	ON_WM_SIZE() 
	ON_WM_CTLCOLOR() 
	ON_WM_ERASEBKGND() 
	ON_WM_CREATE() 
	//}}AFX_MSG_MAP 
	// Standard printing commands 
	ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint) 
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint) 
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview) 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CAppView construction/destruction 
 
CAppView::CAppView() 
//	: CView(CAppView::IDD) 
	:CView()  
{ 
	//{{AFX_DATA_INIT(CAppView) 
		// NOTE: the ClassWizard will add member initialization here 
	//}}AFX_DATA_INIT 
	// TODO: add construction code here 
 
} 
 
CAppView::~CAppView() 
{ 
} 
 
void CAppView::DoDataExchange(CDataExchange* pDX) 
{ 
	CView::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CAppView) 
		// NOTE: the ClassWizard will add DDX and DDV calls here 
	//}}AFX_DATA_MAP 
} 
 
BOOL CAppView::PreCreateWindow(CREATESTRUCT& cs) 
{ 
	// TODO: Modify the Window class or styles here by modifying 
	//  the CREATESTRUCT cs 
 
	return CView::PreCreateWindow(cs); 
} 
 
void CAppView::OnInitialUpdate() 
{ 
	CView::OnInitialUpdate(); 
//	GetParentFrame()->RecalcLayout(); 
//	ResizeParentToFit(); 
 
 
 
 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CAppView printing 
 
BOOL CAppView::OnPreparePrinting(CPrintInfo* pInfo) 
{ 
	// default preparation 
	return DoPreparePrinting(pInfo); 
} 
 
void CAppView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) 
{ 
	// TODO: add extra initialization before printing 
} 
 
void CAppView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) 
{ 
	// TODO: add cleanup after printing 
} 
 
void CAppView::OnPrint(CDC* pDC, CPrintInfo* /*pInfo*/) 
{ 
	// TODO: add customized printing code here 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CAppView diagnostics 
 
#ifdef _DEBUG 
void CAppView::AssertValid() const 
{ 
	CView::AssertValid(); 
} 
 
void CAppView::Dump(CDumpContext& dc) const 
{ 
	CView::Dump(dc); 
} 
 
#if 0 
CAppDoc* CAppView::GetDocument() // non-debug version is inline 
{ 
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CAppDoc))); 
	return (CAppDoc*)m_pDocument; 
} 
#endif 
#endif //_DEBUG 
 
///////////////////////////////////////////////////////////////////////////// 
// CAppView message handlers 
 
void CAppView::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_tab .GetSafeHwnd() ) 
		m_tab .SetWindowPos( NULL, rt .left, rt .top, rt .Width(), rt .Height()-40, SWP_NOZORDER ) ;  
 
	if ( m_vol .GetSafeHwnd() ) 
		m_vol .SetWindowPos( NULL, rt .left, rt .bottom - 40, rt .Width()-35, 30, SWP_NOZORDER ) ;  
 
	if ( m_bt_vol ) 
		m_bt_vol .SetWindowPos( NULL, rt .right -35, rt .bottom - 40, 25, 30, SWP_NOZORDER ) ; 
	 
	if ( m_pad1 .GetSafeHwnd() ) 
		m_pad1 .SetWindowPos(NULL, rt .right -10, rt .bottom -40, 10, 30, SWP_NOZORDER) ;  
	if ( m_pad2 .GetSafeHwnd() ) 
		m_pad2 .SetWindowPos(NULL, rt .left, rt .bottom -10, rt .Width(), 10, SWP_NOZORDER) ;  
	 
} 
 
void CAppView::OnDraw(CDC* pDC)  
{ 
	// TODO: Add your specialized code here and/or call the base class 
	 
	 
} 
 
HBRUSH CAppView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)  
{ 
	HBRUSH hbr = CView::OnCtlColor(pDC, pWnd, nCtlColor); 
	 
	// TODO: Change any attributes of the DC here 
//	CBrush br ;  
//	br .CreateSolidBrush() ;  
	 
	// TODO: Return a different brush if the default is not desired 
	return hbr; 
} 
 
BOOL CAppView::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 CView::OnEraseBkgnd(pDC); 
	return FALSE ;  
#endif 
} 
 
int CAppView::OnCreate(LPCREATESTRUCT lpCreateStruct)  
{ 
	if (CView::OnCreate(lpCreateStruct) == -1) 
		return -1; 
	 
	// TODO: Add your specialized creation code here 
		m_tab.Create(TCXS_DOWN | WS_THICKFRAME |WS_CHILD | WS_VISIBLE, CRect(10,5,60,100), this, 0) ;  
	 
		m_vol .Create( WS_CHILD | WS_VISIBLE, CRect( 30, 5, 100, 2 ), this, 0 ) ;  
	 
	 
	 
		m_bt_vol .Create( "", WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, CRect ( 0,0,0,0 ), this, 0 ) ;  
		m_bt_vol .LoadBitmaps(IDB_BITMAP_VOL_ENABLE) ; 
		m_bt_vol .SetTextAlignment(CTrackLookButton::AlignRight) ;  
 
		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; 
}