⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 childbin.cpp

📁 一个完整的编辑器的代码(很值得参考
💻 CPP
字号:
///////////////////////////////////////////////////////////////////////////
//  File:    childbin.cpp
//  Version: 1.1.0.4
//  Updated: 19-Jul-1998
//
//  Binary Child frame core
//
//  Copyright:  Ferdinand Prantl
//  E-mail:     prantl@ff.cuni.cz
//
//  You are free to use or modify this code to the following restrictions:
//  - Acknowledge me somewhere in your about box, simple "Parts of code by.."
//  will be enough. If you can't (or don't want to), contact me personally.
//  - LEAVE THIS HEADER INTACT
////////////////////////////////////////////////////////////////////////////

// childbin.cpp : implementation of the CChildFrame class
//

#include "stdafx.h"
#include "editpad.h"

#include "childbin.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CBinChildFrame

IMPLEMENT_DYNCREATE (CBinChildFrame, CMDIChildWnd)

BEGIN_MESSAGE_MAP (CBinChildFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(CBinChildFrame)
	ON_WM_SHOWWINDOW()
	ON_WM_CLOSE()
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP ()

/////////////////////////////////////////////////////////////////////////////
// CBinChildFrame construction/destruction

CBinChildFrame::CBinChildFrame () : m_bFirstShown (TRUE)
{
  // TODO: add member initialization code here

}

CBinChildFrame:: ~ CBinChildFrame ()
{
}

BOOL CBinChildFrame::
OnCreateClient (LPCREATESTRUCT /*lpcs */ ,
                CCreateContext * pContext)
{
  return m_wndSplitter.Create (this,
                               2, 2,    // TODO: adjust the number of rows, columns
                               CSize (10, 10),     // TODO: adjust the minimum pane size
                               pContext);
}

BOOL CBinChildFrame::
PreCreateWindow (CREATESTRUCT & cs)
{
  // TODO: Modify the Window class or styles here by modifying
  //  the CREATESTRUCT cs

  if (!CMDIChildWnd::PreCreateWindow (cs))
    return FALSE;

  return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CBinChildFrame diagnostics

#ifdef _DEBUG
void CBinChildFrame::
AssertValid ()
const
{
  CMDIChildWnd::AssertValid ();
}

void CBinChildFrame::Dump (CDumpContext & dc)
const
{
  CMDIChildWnd::Dump (dc);
}

#endif                          //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CBinChildFrame message handlers

void CBinChildFrame::ActivateFrame(int nCmdShow) 
{
  // Maximise MDI child if only one active
  /*if (GetMDIFrame ()->MDIGetActive ())
    CMDIChildWnd::ActivateFrame (nCmdShow);
  else
    CMDIChildWnd::ActivateFrame (SW_SHOWMAXIMIZED); // else open maximized.*/
  CMDIChildWnd::ActivateFrame (nCmdShow);
}

void CBinChildFrame::OnShowWindow(BOOL bShow, UINT nStatus) 
{
  if (m_bFirstShown && bShow)
    {
      m_bFirstShown = FALSE;
      if (theApp.m_dwFlags & EP_MAXIMIZE_CHILD_WND)
        {
          ShowWindow(SW_SHOWMAXIMIZED);
          return;
        }
    }
  CMDIChildWnd::OnShowWindow(bShow, nStatus);
}

void CBinChildFrame::OnClose() 
{
	// TODO: Add your message handler code here and/or call default
	
	CMDIChildWnd::OnClose();
}

int CBinChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
		return -1;

	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -