// MainFrm.cpp : implementation of the CMainFrame class // #include "stdafx.h" #include "DicWav.h" #include "WavDoc.H" #include "WavView.h" #include "MainFrm.h" #include "LeftView.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_PALETTECHANGED() ON_WM_QUERYNEWPALETTE() ON_WM_PALETTEISCHANGING() ON_WM_SYSCOLORCHANGE() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CMainFrame construction/destruction CMainFrame::CMainFrame() { LBase::SetErrorListDepth(20); LBase::LoadLibraries(LT_ALL_LEADLIB); LDialogBase::Initialize(DLG_INIT_COLOR); WRPUNLOCKSUPPORT(); LBase::SetErrorListDepth(25); } CMainFrame::~CMainFrame() { LDialogBase::Free(); LBase::UnloadLibraries(LT_ALL_LEADLIB); } BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs cs.style = WS_OVERLAPPEDWINDOW | WS_CAPTION; cs.lpszName = "LEADTOOLS DICOM Waveforms Demo"; return TRUE; } ///////////////////////////////////////////////////////////////////////////// // 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::OnPaletteChanged(CWnd* pFocusWnd) { CFrameWnd::OnPaletteChanged(pFocusWnd); CDicWavView* pCView; pCView = (CDicWavView*) GetActiveView(); return; } BOOL CMainFrame::OnQueryNewPalette() { // TODO: Add your message handler code here and/or call default CDicWavView * pCView; pCView = (CDicWavView*) GetActiveView(); return CFrameWnd::OnQueryNewPalette(); } void CMainFrame::OnPaletteIsChanging(CWnd* pRealizeWnd) { OnPaletteChanged (pRealizeWnd); } void CMainFrame::OnSysColorChange() { OnQueryNewPalette() ; } BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { if (!m_wndSplitter.CreateStatic(this, 1, 2)) return FALSE; if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(200, 100), pContext) || !m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CDicWavView), CSize(100, 100), pContext)) { m_wndSplitter.DestroyWindow(); return FALSE; } return TRUE; } CDicWavView* CMainFrame::GetRightPane() { CWnd* pWnd = m_wndSplitter.GetPane(0, 1); return (CDicWavView*) DYNAMIC_DOWNCAST(CDicWavView, pWnd); }