📄 scconsole.cpp
字号:
// SCConsole.cpp : implementation file
//
#include "stdafx.h"
#include "SC.h"
#include "SCConsole.h"
#include "Student.h"
#include "SearchRecord.h"
#include "ADOConn.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSCConsole dialog
CSCConsole::CSCConsole(CWnd* pParent /*=NULL*/)
: CDialog(CSCConsole::IDD, pParent)
{
//{{AFX_DATA_INIT(CSCConsole)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CSCConsole::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSCConsole)
DDX_Control(pDX, IDC_FUNC_TAB, m_tabCtrl);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSCConsole, CDialog)
//{{AFX_MSG_MAP(CSCConsole)
ON_NOTIFY(TCN_SELCHANGE, IDC_FUNC_TAB, OnSelchangeFuncTab)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSCConsole message handlers
BOOL CSCConsole::OnInitDialog()
{
CDialog::OnInitDialog();
TCITEM item;
item.mask=TCIF_TEXT;
item.pszText="学生表操作";
m_tabCtrl.InsertItem (0,&item);
item.pszText="课程表操作";
m_tabCtrl.InsertItem (1,&item);
item.pszText="选课表操作";
m_tabCtrl.InsertItem (2,&item);
CRect rs;
m_tabCtrl.GetClientRect(&rs);
rs.top+=30;
rs.bottom-=2;
rs.left+=1;
rs.right-=2;
m_Student.Create(IDD_STUDENT_DIALOG,&m_tabCtrl);
m_Student.MoveWindow(&rs);
m_Student.ShowWindow(TRUE);
m_Course.Create(IDD_COURSE_DIALOG,&m_tabCtrl);
m_Course.MoveWindow(&rs);
m_Course.ShowWindow(FALSE);
m_SC.Create(IDD_SC_DIALOG1,&m_tabCtrl);
m_SC.MoveWindow(&rs);
m_SC.ShowWindow(FALSE);
//m_tabCtrl.SetCurSel(1);
//m_tabCtrl.SetCurSel(0);
return TRUE;
}
void CSCConsole::OnSelchangeFuncTab(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
CRect r;
m_tabCtrl.GetClientRect (&r);
switch(m_tabCtrl.GetCurSel())
{
case 0:
m_Student.SetWindowPos(NULL,10,30,r.right -20,r.bottom -40,SWP_SHOWWINDOW);
m_Course.SetWindowPos(NULL,10,30,r.right -20,r.bottom -40,SWP_HIDEWINDOW);
m_SC.SetWindowPos(NULL,10,30,r.right -20,r.bottom -40,SWP_HIDEWINDOW);
break;
case 1:
m_Student.SetWindowPos(NULL,10,30,r.right -20,r.bottom -40,SWP_HIDEWINDOW);
m_Course.SetWindowPos(NULL,10,30,r.right -20,r.bottom -40,SWP_SHOWWINDOW);
m_SC.SetWindowPos(NULL,10,30,r.right -20,r.bottom -40,SWP_HIDEWINDOW);
break;
case 2:
m_Student.SetWindowPos(NULL,10,30,r.right -20,r.bottom -40,SWP_HIDEWINDOW);
m_Course.SetWindowPos(NULL,10,30,r.right -20,r.bottom -40,SWP_HIDEWINDOW);
m_SC.SetWindowPos(NULL,10,30,r.right -20,r.bottom -40,SWP_SHOWWINDOW);
break;
}
*pResult = 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -