1 // OpenFrm.cpp : implementation of the COpenFrame class
5 #include "OptionsDef.h"
6 #include "OptionsMgr.h"
7 #include "MergeFrameCommon.h"
16 IMPLEMENT_DYNCREATE(COpenFrame, CMergeFrameCommon)
18 BEGIN_MESSAGE_MAP(COpenFrame, CMergeFrameCommon)
19 //{{AFX_MSG_MAP(COpenFrame)
22 ON_WM_WINDOWPOSCHANGING()
27 // COpenFrame construction/destruction
29 COpenFrame::COpenFrame()
31 // TODO: add member initialization code here
34 COpenFrame::~COpenFrame()
39 BOOL COpenFrame::PreCreateWindow(CREATESTRUCT& cs)
41 // TODO: Modify the Window class or styles here by modifying the CREATESTRUCT cs
42 if( !CMDIChildWnd::PreCreateWindow(cs) )
44 cs.style |= WS_CLIPCHILDREN;
48 BOOL COpenFrame::OnEraseBkgnd(CDC* pDC)
52 pDC->FillSolidRect(&rect, ::GetSysColor(COLOR_APPWORKSPACE));
56 LRESULT COpenFrame::OnNcHitTest(CPoint point)
58 switch (LRESULT const ht = CMDIChildWnd::OnNcHitTest(point))
74 void COpenFrame::OnWindowPosChanging(WINDOWPOS* lpwndpos)
76 // Retain frame sizes during tile operations (tolerate overlapping)
77 if ((lpwndpos->flags & (SWP_NOSIZE | SWP_NOOWNERZORDER)) == 0 && !IsZoomed())
79 if (CScrollView *const pView = static_cast<CScrollView*>(GetActiveView()))
82 pView->GetWindowRect(&rc);
83 CalcWindowRect(&rc, CWnd::adjustOutside);
84 lpwndpos->cx = rc.Width();
85 lpwndpos->cy = rc.Height();
90 void COpenFrame::ActivateFrame(int nCmdShow)
92 CMergeFrameCommon::ActivateFrame(nCmdShow);
93 if (CView *const pView = GetActiveView())
95 WINDOWPLACEMENT wp = {};
96 wp.length = sizeof wp;
97 GetWindowPlacement(&wp);
99 pView->GetWindowRect(&rc);
100 CalcWindowRect(&rc, CWnd::adjustOutside);
101 wp.rcNormalPosition.right = wp.rcNormalPosition.left + rc.Width();
102 wp.rcNormalPosition.bottom = wp.rcNormalPosition.top + rc.Height();
103 SetWindowPlacement(&wp);
104 pView->ShowWindow(SW_SHOW);
109 * @brief Update any resources necessary after a GUI language change
111 void COpenFrame::UpdateResources()
116 * @brief Save the window's position, free related resources, and destroy the window
118 BOOL COpenFrame::DestroyWindow()
121 return CMDIChildWnd::DestroyWindow();
124 // COpenFrame message handlers