📄 sdssbmdlg.cpp
字号:
// sdssbmdlg.cpp : implementation file
//
#include "stdafx.h"
#include "xxgl.h"
#include "sdssbmdlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// Csdssbmdlg dialog
extern char g_yszmcx_xzssbm_name[100];
extern char g_bmsz_name[200][100];
extern int g_end_bmsz;
switch_to_english_mode(CWnd *wnd);
switch_to_chinese_mode(CWnd *wnd);
Set_to_item_end(CWnd *wd,int id);
Csdssbmdlg::Csdssbmdlg(CWnd* pParent /*=NULL*/)
: CDialog(Csdssbmdlg::IDD, pParent)
{
//{{AFX_DATA_INIT(Csdssbmdlg)
//}}AFX_DATA_INIT
}
void Csdssbmdlg::DoDataExchange(CDataExchange* pDX)
{
FILE *fpe;
int i,ret;
char buf[100];
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(Csdssbmdlg)
DDX_Control(pDX, IDC_ssbm, m_ssbm);
//}}AFX_DATA_MAP
fpe = fopen("c:\\xxsbgl\\bmsz.txt","rb");
g_end_bmsz = 0;
if (fpe != NULL){
ret = fscanf(fpe,"%s\n",buf);
while (ret > 0){
if (strlen(buf) != 0){
strcpy(g_bmsz_name[g_end_bmsz],buf);
g_end_bmsz ++;
}
ret = fscanf(fpe,"%s\n",buf);
}
fclose(fpe);
}
for (i=0;i<g_end_bmsz;i++){
m_ssbm.AddString(g_bmsz_name[i]);
}
}
BEGIN_MESSAGE_MAP(Csdssbmdlg, CDialog)
//{{AFX_MSG_MAP(Csdssbmdlg)
ON_CBN_EDITCHANGE(IDC_ssbm, OnEditchangessbm)
ON_CBN_SETFOCUS(IDC_ssbm, OnSetfocusssbm)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Csdssbmdlg message handlers
void Csdssbmdlg::OnOK()
{
// TODO: Add extra validation here
char buf[100];
int n;
CString str;
GetDlgItemText(IDC_ssbm,buf,20);
if (buf[0] == 0){
MessageBox("对不起,您没有选择所属部门.",MB_OK);
return;
}
n = m_ssbm.GetCurSel();
if (n > 0){
m_ssbm.GetLBText(n,str);
strcpy(buf,str.GetBuffer(100));
}
strcpy(g_yszmcx_xzssbm_name,buf);
CDialog::OnOK();
}
void Csdssbmdlg::OnEditchangessbm()
{
// TODO: Add your control notification handler code here
char buf[40];
GetDlgItemText(IDC_ssbm,buf,40);
if (buf[0] != 0){
if (m_ssbm.SelectString(0,buf) == CB_ERR){
SetDlgItemText(IDC_ssbm,"");
}
}
}
void Csdssbmdlg::OnSetfocusssbm()
{
// TODO: Add your control notification handler code here
CWnd *wnd;
wnd = GetDlgItem(IDC_ssbm);
switch_to_chinese_mode(wnd);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -