131 lines
3.2 KiB
C++
131 lines
3.2 KiB
C++
// ChildFrm.cpp : implementation of the CChildFrame class
|
|
//
|
|
// This file is a part of the XTREME TOOLKIT PRO MFC class library.
|
|
// (c)1998-2008 Codejock Software, All Rights Reserved.
|
|
//
|
|
// THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
|
|
// RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
|
|
// CONSENT OF CODEJOCK SOFTWARE.
|
|
//
|
|
// THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
|
|
// IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO
|
|
// YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
|
|
// SINGLE COMPUTER.
|
|
//
|
|
// CONTACT INFORMATION:
|
|
// support@codejock.com
|
|
// http://www.codejock.com
|
|
//
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
#include "stdafx.h"
|
|
#include "TabbedView.h"
|
|
|
|
#include "ChildFrm.h"
|
|
#include "TabbedViewView.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CChildFrame
|
|
|
|
IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
|
|
|
|
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
|
|
//{{AFX_MSG_MAP(CChildFrame)
|
|
// NOTE - the ClassWizard will add and remove mapping macros here.
|
|
// DO NOT EDIT what you see in these blocks of generated code !
|
|
//}}AFX_MSG_MAP
|
|
ON_UPDATE_COMMAND_UI(ID_POPUP_EDIT, OnUpdatePopupEdit)
|
|
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CChildFrame construction/destruction
|
|
|
|
CChildFrame::CChildFrame()
|
|
{
|
|
// TODO: add member initialization code here
|
|
|
|
}
|
|
|
|
CChildFrame::~CChildFrame()
|
|
{
|
|
}
|
|
|
|
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
|
|
{
|
|
// TODO: Modify the Window class or styles here by modifying
|
|
// the CREATESTRUCT cs
|
|
|
|
if( !CMDIChildWnd::PreCreateWindow(cs) )
|
|
return FALSE;
|
|
|
|
cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CChildFrame diagnostics
|
|
|
|
#ifdef _DEBUG
|
|
void CChildFrame::AssertValid() const
|
|
{
|
|
CMDIChildWnd::AssertValid();
|
|
}
|
|
|
|
void CChildFrame::Dump(CDumpContext& dc) const
|
|
{
|
|
CMDIChildWnd::Dump(dc);
|
|
}
|
|
|
|
#endif //_DEBUG
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CChildFrame message handlers
|
|
void CChildFrame::OnUpdateFrameTitle(BOOL bAddToTitle)
|
|
{
|
|
// update our parent window first
|
|
GetMDIFrame()->OnUpdateFrameTitle(bAddToTitle);
|
|
|
|
if ((GetStyle() & FWS_ADDTOTITLE) == 0)
|
|
return; // leave child window alone!
|
|
|
|
CDocument* pDocument = GetActiveDocument();
|
|
if (bAddToTitle)
|
|
{
|
|
CString strWindowText;
|
|
if (pDocument == NULL)
|
|
strWindowText = m_strTitle;
|
|
else
|
|
strWindowText = pDocument->GetTitle();
|
|
|
|
|
|
CTabbedViewView* pView = (CTabbedViewView*)GetDlgItem(AFX_IDW_PANE_FIRST);
|
|
if (pView)
|
|
{
|
|
CString strCaption = pView->m_wndTabControl.GetSelectedItem()->GetCaption();
|
|
strWindowText += _T(" - ") + strCaption;
|
|
}
|
|
|
|
// set title if changed, but don't remove completely
|
|
AfxSetWindowText(m_hWnd, strWindowText);
|
|
}
|
|
}
|
|
|
|
void CChildFrame::OnUpdatePopupEdit(CCmdUI* pCmdUI)
|
|
{
|
|
CXTPControl* pControl = CXTPControl::FromUI(pCmdUI);
|
|
|
|
BOOL bVisible = DYNAMIC_DOWNCAST(CEditView, GetActiveView()) != 0;
|
|
|
|
pCmdUI->Enable();
|
|
pControl->SetVisible(bVisible);
|
|
}
|