The Machine Perception Toolbox

[Introduction]- [News]- [Download]- [Screenshots]- [Manual (pdf)]- [Forums]- [API Reference]- [Repository ]

 

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

MainFrm.cpp

Go to the documentation of this file.
00001 // MainFrm.cpp : implementation of the CMainFrame class
00002 //
00003 
00004 #include "stdafx.h"
00005 #include "VideoDemo.h"
00006 
00007 #include "MainFrm.h"
00008 
00009 #ifdef _DEBUG
00010 #define new DEBUG_NEW
00011 #undef THIS_FILE
00012 static char THIS_FILE[] = __FILE__;
00013 #endif
00014 
00016 // CMainFrame
00017 
00018 IMPLEMENT_DYNAMIC(CMainFrame, CFrameWnd)
00019 
00020 BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
00021         //{{AFX_MSG_MAP(CMainFrame)
00022         ON_WM_CREATE()
00023         ON_WM_SETFOCUS()
00024         //}}AFX_MSG_MAP
00025 END_MESSAGE_MAP()
00026 
00028 // CMainFrame construction/destruction
00029 
00030 CMainFrame::CMainFrame()
00031 {
00032         // TODO: add member initialization code here
00033         
00034 }
00035 
00036 CMainFrame::~CMainFrame()
00037 {
00038 }
00039 
00040 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
00041 {
00042         if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
00043                 return -1;
00044         // create a view to occupy the client area of the frame
00045         if (!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
00046                 CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
00047         {
00048                 TRACE0("Failed to create view window\n");
00049                 return -1;
00050         }
00051 
00052         return 0;
00053 }
00054 
00055 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
00056 {
00057         if( !CFrameWnd::PreCreateWindow(cs) )
00058                 return FALSE;
00059         // TODO: Modify the Window class or styles here by modifying
00060         //  the CREATESTRUCT cs
00061 
00062         cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
00063         cs.lpszClass = AfxRegisterWndClass(0);
00064         return TRUE;
00065 }
00066 
00068 // CMainFrame diagnostics
00069 
00070 #ifdef _DEBUG
00071 void CMainFrame::AssertValid() const
00072 {
00073         CFrameWnd::AssertValid();
00074 }
00075 
00076 void CMainFrame::Dump(CDumpContext& dc) const
00077 {
00078         CFrameWnd::Dump(dc);
00079 }
00080 
00081 #endif //_DEBUG
00082 
00084 // CMainFrame message handlers
00085 void CMainFrame::OnSetFocus(CWnd* pOldWnd)
00086 {
00087         // forward focus to the view window
00088         m_wndView.SetFocus();
00089 }
00090 
00091 BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
00092 {
00093         // let the view have first crack at the command
00094         if (m_wndView.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
00095                 return TRUE;
00096 
00097         // otherwise, do default handling
00098         return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
00099 }
00100 
00101 
00102 void CMainFrame::setDirectShow(MPDirectShow* directShow)
00103 {
00104         m_directShow = directShow;
00105 }
00106 

Generated on Mon Nov 8 17:07:41 2004 for MPT by  doxygen 1.3.9.1