📄 leftview.cpp
字号:
// LeftView.cpp : implementation file
//
#include "stdafx.h"
#include "LeftView.h"
#include "ChildFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// LeftView
IMPLEMENT_DYNCREATE(LeftView, CFormView)
LeftView::LeftView()
: CFormView(LeftView::IDD)
{
//{{AFX_DATA_INIT(LeftView)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
EditView =NULL;
}
LeftView::~LeftView()
{
}
void LeftView::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(LeftView)
DDX_Control(pDX, IDC_HIDE, m_hide);
DDX_Control(pDX, IDC_FUNCTION, m_function);
DDX_Control(pDX, IDC_ACTION, m_action);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(LeftView, CFormView)
//{{AFX_MSG_MAP(LeftView)
ON_WM_SIZE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// LeftView diagnostics
#ifdef _DEBUG
void LeftView::AssertValid() const
{
CFormView::AssertValid();
}
void LeftView::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// LeftView message handlers
void LeftView::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
ShowScrollBar(SB_BOTH,FALSE);
AdjustSize();
}
void LeftView::AdjustSize()
{
CRect rect,functionRect,ActionRect,HideRect,EditRect;
GetClientRect(rect);
functionRect.left =rect.left-1;
functionRect.right =rect.left+rect.Width()/2-17;
functionRect.top =rect.top-2;
functionRect.bottom =rect.top +16;
ActionRect.left =rect.left+rect.Width()/2-15;
ActionRect.right =rect.right-16;
ActionRect.top =rect.top-2;
ActionRect.bottom =rect.top +16;
HideRect.left =ActionRect.right;
HideRect.right =rect.right+1;
HideRect.top =rect.top-1;
HideRect.bottom =rect.top +17;
EditRect.top =rect.top +18;
EditRect.bottom =rect.bottom;
EditRect.right =rect.right+2;
EditRect.left =rect.left-2;
m_function.MoveWindow(functionRect);
m_action.MoveWindow(ActionRect);
m_action.UpdateWindow();
m_hide.MoveWindow(HideRect);
if(EditView->GetSafeHwnd())
EditView->MoveWindow(EditRect);
}
void LeftView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
CCreateContext ctx1;
// SubclassWindow(GetDlgItem(IDC_PICT_FRAM)->GetSafeHwnd());
// CFrameWnd *pFram =(CFrameWnd *)GetDlgItem(IDC_PICT_FRAM)->GetParent();
// CChildFrame *pMain=(CChildFrame *)GetParentFrame();
// CChildFrame *pMain=(CChildFrame *)GetParentFrame();
ctx1.m_pCurrentDoc = GetDocument();
ctx1.m_pCurrentFrame = NULL;
ctx1.m_pLastView = NULL;
ctx1.m_pNewDocTemplate = GetDocument()->GetDocTemplate();;
ctx1.m_pNewViewClass = RUNTIME_CLASS(CSCView);
EditView = (CSCView*)((CFrameWnd *)this)->CreateView(&ctx1);
EditView->SetFocus();
m_function.SetCurSel(0);
m_action.SetCurSel(0);
AdjustSize();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -