00001
00002
00003
00004 #include "stdafx.h"
00005 #include "VisageLink.h"
00006
00007 #include "MainFrm.h"
00008 #include "VisageLinkDoc.h"
00009 #include <process.h>
00010 #include "visagesapi5tts.h"
00011
00012 #ifdef _DEBUG
00013 #define new DEBUG_NEW
00014 #undef THIS_FILE
00015 static char THIS_FILE[] = __FILE__;
00016 #endif
00017
00018
00019
00020
00021 IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
00022
00023 BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
00024
00025 ON_WM_CREATE()
00026
00027 END_MESSAGE_MAP()
00028
00029 static UINT indicators[] =
00030 {
00031 ID_SEPARATOR,
00032 ID_INDICATOR_CAPS,
00033 ID_INDICATOR_NUM,
00034 ID_INDICATOR_SCRL,
00035 };
00036
00037
00038
00039
00040 CMainFrame::CMainFrame()
00041 {
00042
00043
00044 }
00045
00046 CMainFrame::~CMainFrame()
00047 {
00048 }
00049
00050 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
00051 {
00052 if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
00053 return -1;
00054
00055 if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
00056 | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
00057 !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
00058 {
00059 TRACE0("Failed to create toolbar\n");
00060 return -1;
00061 }
00062
00063 if (!m_wndStatusBar.Create(this) ||
00064 !m_wndStatusBar.SetIndicators(indicators,
00065 sizeof(indicators)/sizeof(UINT)))
00066 {
00067 TRACE0("Failed to create status bar\n");
00068 return -1;
00069 }
00070
00071
00072
00073 m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
00074 EnableDocking(CBRS_ALIGN_ANY);
00075 DockControlBar(&m_wndToolBar);
00076
00077 return 0;
00078 }
00079
00080 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
00081 {
00082 if( !CFrameWnd::PreCreateWindow(cs) )
00083 return FALSE;
00084
00085
00086
00087 return TRUE;
00088 }
00089
00090
00091
00092
00093 CVisageLinkDoc* CMainFrame::GetDocument()
00094 {
00095 POSITION pos = AfxGetApp()->GetFirstDocTemplatePosition();
00096 CDocTemplate* pDocTemplate = AfxGetApp()->GetNextDocTemplate(pos);
00097 pos = pDocTemplate->GetFirstDocPosition();
00098 return (CVisageLinkDoc*)pDocTemplate->GetNextDoc(pos);
00099 }
00100
00101
00102
00103
00104 COpenGLWnd* CMainFrame::GetOpenGLWnd()
00105 {
00106 CVisageLinkDoc *pDoc = (CVisageLinkDoc*)GetDocument();
00107 POSITION pos = pDoc->GetFirstViewPosition();
00108 return (COpenGLWnd*)pDoc->GetNextView(pos);
00109 }
00110
00111
00112
00113
00114
00115
00116 #ifdef _DEBUG
00117 void CMainFrame::AssertValid() const
00118 {
00119 CFrameWnd::AssertValid();
00120 }
00121
00122 void CMainFrame::Dump(CDumpContext& dc) const
00123 {
00124 CFrameWnd::Dump(dc);
00125 }
00126
00127 #endif //_DEBUG
00128
00129
00130
00131
00132