📄 formcommandview.cpp
字号:
// FormCommandView.cpp : implementation file
//
#include "stdafx.h"
#include "MySDOpenGL.h"
#include "FormCommandView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFormCommandView
IMPLEMENT_DYNCREATE(CFormCommandView, CFormView)
CFormCommandView::CFormCommandView()
: CFormView(CFormCommandView::IDD)
{
//{{AFX_DATA_INIT(CFormCommandView)
// m_stat = _T("");
//}}AFX_DATA_INIT
}
CFormCommandView::~CFormCommandView()
{
}
void CFormCommandView::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CFormCommandView)
DDX_Control(pDX, IDC_TAB1, m_tab);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CFormCommandView, CFormView)
//{{AFX_MSG_MAP(CFormCommandView)
ON_NOTIFY(TCN_SELCHANGE, IDC_TAB1, OnSelchangeTab1)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFormCommandView diagnostics
#ifdef _DEBUG
void CFormCommandView::AssertValid() const
{
CFormView::AssertValid();
}
void CFormCommandView::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CFormCommandView message handlers
void CFormCommandView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
if(!m_page1.m_hWnd||!m_page2.m_hWnd)
{ m_tab.InsertItem(0," 机器人运动学 ");
m_page1.Create(IDD_PAGE1,GetDlgItem(IDC_TAB1));
m_tab.InsertItem(1," 机器人动力学 ");
m_page2.Create(IDD_PAGE2,GetDlgItem(IDC_TAB1));
//设置页面的位置在m_tab控件范围内
CRect rs;
m_tab.GetClientRect(rs);
rs.top+=24;
rs.bottom+=48;
m_page1.MoveWindow(rs);
m_page2.MoveWindow(rs);
m_page2.ShowWindow(TRUE);
m_tab.SetCurSel(1);
m_page1.pDoc=GetDocument();
m_page2.pDoc=GetDocument();
}
}
CMySDOpenGLDoc* CFormCommandView::GetDocument()
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMySDOpenGLDoc)));
return (CMySDOpenGLDoc*)m_pDocument;
}
void CFormCommandView::OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
int CurSel;
CurSel=m_tab.GetCurSel();
switch(CurSel)
{
case 0:
m_page1.ShowWindow(TRUE);
m_page2.ShowWindow(FALSE);
// m_page3.ShowWindow(FALSE);
m_page1.SetFocus();
break;
case 1:
m_page1.ShowWindow(FALSE);
m_page2.ShowWindow(TRUE);
// m_page3.ShowWindow(FALSE);
m_page2.SetFocus();
break;
default: ;
}
*pResult = 0;
}
void CFormCommandView::OnButton1()
{
// TODO: Add your control notification handler code here
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -