// MainFrm.cpp : implementation of the CMainFrame class // #include "stdafx.h" #include "math.h" #include "MainFrm.h" #include "mathDoc.h" #include "mathView.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CMainFrame IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd) BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) //{{AFX_MSG_MAP(CMainFrame) ON_WM_SIZE() //}}AFX_MSG_MAP // Global help commands END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CMainFrame construction/destruction CMainFrame::CMainFrame() { } CMainFrame::~CMainFrame() { } BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { BOOL temp = TRUE; if( !CFrameWnd::PreCreateWindow(cs) ) temp = FALSE; // This "greys out" the Maximize Box cs.style ^= WS_MAXIMIZEBOX; // This stops users from re-sizing the input window cs.style ^= WS_THICKFRAME; // this (and it's buddy in mathview.cpp) kill the sunken window effect cs.dwExStyle ^= WS_EX_CLIENTEDGE; return temp; } ///////////////////////////////////////////////////////////////////////////// // CMainFrame diagnostics #ifdef _DEBUG void CMainFrame::AssertValid() const { CFrameWnd::AssertValid(); } void CMainFrame::Dump(CDumpContext& dc) const { CFrameWnd::Dump(dc); } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // CMainFrame message handlers void CMainFrame::OnSize(UINT nType, int cx, int cy) { CMathView* pMainView; CFrameWnd::OnSize(nType, cx, cy); pMainView = (CMathView*) this->GetActiveView(); if (nType == SIZE_MINIMIZED) { // Minimize the Output Window pMainView->GetOutWnd()->ShowWindow(SW_MINIMIZE); } else if (nType == SIZE_RESTORED) { // Restore the Output Window if (pMainView->GetOutWnd() != NULL) { pMainView->GetOutWnd()->ShowWindow(SW_RESTORE); } // Make the main window active pMainView->ShowWindow(SW_SHOW); } }