// SalarySet.cpp : implementation file // #include "stdafx.h" #include "LYFZIPManage.h" #include "SalarySet.h" #include "MyMdi.H" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // SalarySet IMPLEMENT_DYNCREATE(SalarySet, CFormView) SalarySet::SalarySet() : CFormView(SalarySet::IDD) { //{{AFX_DATA_INIT(SalarySet) m_name = _T(""); m_rate1 = _T(""); m_rate2 = _T(""); m_bz = _T(""); m_base = _T(""); //}}AFX_DATA_INIT } SalarySet::~SalarySet() { } void SalarySet::DoDataExchange(CDataExchange* pDX) { CFormView::DoDataExchange(pDX); //{{AFX_DATA_MAP(SalarySet) DDX_Control(pDX, IDC_EDITrate2, m_editnum3); DDX_Control(pDX, IDC_EDITrate1, m_editnum2); DDX_Control(pDX, IDC_EDITbase, m_editnum1); DDX_Control(pDX, IDC_LIST2, m_List1); DDX_Control(pDX, IDC_STATIC1, m_static1); DDX_Text(pDX, IDC_EDITname, m_name); DDX_Text(pDX, IDC_EDITrate1, m_rate1); DDX_Text(pDX, IDC_EDITrate2, m_rate2); DDX_Text(pDX, IDC_EDITbz, m_bz); DDX_Text(pDX, IDC_EDITbase, m_base); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(SalarySet, CFormView) //{{AFX_MSG_MAP(SalarySet) ON_BN_CLICKED(IDC_BUTsave, OnBUTsave) ON_BN_CLICKED(IDC_BUTclose, OnBUTclose) ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // SalarySet diagnostics #ifdef _DEBUG void SalarySet::AssertValid() const { CFormView::AssertValid(); } void SalarySet::Dump(CDumpContext& dc) const { CFormView::Dump(dc); } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // SalarySet message handlers void SalarySet::OnInitialUpdate() { CFormView::OnInitialUpdate(); // TODO: Add your specialized code here and/or call the base class CMyMdi Mdi; Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this); // Here we create the outbar control using the splitter as its parent // and setting its id to the first pane. CRect rc2; GetWindowRect(rc2); ::MoveWindow(m_hWnd,g_rc.left,g_rc.top,g_rc.Width(),g_rc.Height(),TRUE); EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc,0); m_static1.SetFont (&g_titlefont); m_List1.SetHeadings("姓名,100;基本工资, 100;前期点数, 100;后期点数,100;备注,100" ); m_List1.LoadColumnInfo (22); GetData(); } void SalarySet::FillGrid() { m_List1.DeleteAllItems2 (); int ii=0; m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 ); int count=0; for(ii=0; iiSendMessage(WM_CLOSE); } void SalarySet::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here ListSelChange(); *pResult = 0; } void SalarySet::ListSelChange() { POSITION pos; pos=m_List1.GetFirstSelectedItemPosition(); if(pos==NULL) { return; } int iItem=m_List1.GetNextSelectedItem(pos); m_name=m_List1.GetItemText (iItem, 0); for(int ii=0; iiProcessChatMessageRequest2(sql);if(g_bSendOK==0)return; AfxMessageBox("保存成功!", MB_ICONINFORMATION); GetData(); } void SalarySet::GetData() { g_sendhead.bsql=0; g_sendhead.code[0]=34; g_sendhead.tabcount=1; int g_nYearposTemp=g_nYearpos; g_nYearpos=-1; g_pMainWnd->ProcessChatMessageRequest2(13); g_nYearpos=g_nYearposTemp; if(g_bSendOK==0)return; DataToArray(&m_List1array); FillGrid(); } BOOL SalarySet::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class try { if(pMsg->message==WM_KEYDOWN) { switch (pMsg->wParam) { case 0x43: // copy if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) ) { GetFocus()->SendMessage(WM_COPY); return TRUE; } break; case 0x56: //Ctrl + V: if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) ) { GetFocus()->SendMessage(WM_PASTE); return TRUE; } break; case 0x58: // cut if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) ) { GetFocus()->SendMessage(WM_CUT); return TRUE; } break; case 0x5A: //undo case 0x59: //redo if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) ) { GetFocus()->SendMessage(WM_UNDO); return TRUE; } break; } } return CFormView::PreTranslateMessage(pMsg); } catch(...) { } }