zoukankan      html  css  js  c++  java
  • vc2010 学习笔记3

    VC++之框架窗体之静态切分窗口

    一、创建单文档应用程序

    二、添加变量、函数

           1、添加变量


            2、添加函数


    三、添加代码(红色部分)

          1、在“CCSDIView.cpp”内添加包含语句

    // 静态切分窗口View.h : interface of the CCSDIView class

    #include "静态切分窗口Doc.h"
    #include "静态切分窗口.h"
    #include "MainFrm.h"

           2、在“MainFrm.cpp”内添加包含语句

    // MainFrm.cpp : implementation of the CMainFrame class

    "stdafx.h"
    #include "静态切分窗口.h"

    #include "MainFrm.h"
    #include "静态切分窗口Doc.h"
    #include "静态切分窗口View.h"

          3、添加代码

    BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)

                                                                                                                          //重载该函数 
    {
    // TODO: Add your specialized code here and/or call the base class
    CRect cr;
    GetClientRect(&cr);
    CSize paneSize(cr.Width()/3,cr.Height()/3);
    m_splitter.CreateStatic(this,3,1);
    m_splitter.CreateView(0,0,RUNTIME_CLASS(CCSDIView),paneSize,pContext);
    m_splitter.CreateView(1,0,RUNTIME_CLASS(CCSDIView),paneSize,pContext);
    m_splitter.CreateView(2,0,RUNTIME_CLASS(CCSDIView),paneSize,pContext);
    //return CFrameWnd::OnCreateClient(lpcs, pContext);
    return TRUE;
    }

    四、编译

    五、运行


    六、函数说明

           1、CWnd::GetClintRect函数声明

           2、CSplitterWnd::CreateStatic函数声明

           3、CSplitterWnd::CreateView函数说明 

    注:

    两个窗口,怎么对应于一个文档呢?看这个ppt。

    http://wenku.baidu.com/view/6b29bf28bd64783e09122b89.html 

  • 相关阅读:
    jdbc连接数据库
    UUID
    Oracle 查询
    JAVA开发工具eclipse中@author怎么改
    JAVA实现多线程入门
    JAVA编程中的类和对象
    为ubuntu操作系统增加root用户
    搭建Java环境JDK,和运行环境JRE
    安装Ubuntu14.04版本的操作系统
    Eclipse连接到My sql数据库之前操作
  • 原文地址:https://www.cnblogs.com/gisbase/p/2200157.html
Copyright © 2011-2022 走看看