| ¶Ô±ÈÐÂÎļþ |
| | |
| | | // PageTransferLog.cpp: å®ç°æä»¶ |
| | | // |
| | | |
| | | #include "stdafx.h" |
| | | #include "Servo.h" |
| | | #include "afxdialogex.h" |
| | | #include "PageTransferLog.h" |
| | | #include "Common.h" |
| | | |
| | | #define PAGE_SIZE 100 |
| | | #define PAGE_BACKGROUND_COLOR RGB(252, 252, 255) |
| | | |
| | | // CPageTransferLog å¯¹è¯æ¡ |
| | | |
| | | IMPLEMENT_DYNAMIC(CPageTransferLog, CDialogEx) |
| | | |
| | | CPageTransferLog::CPageTransferLog(CWnd* pParent /*=nullptr*/) |
| | | : CDialogEx(IDD_PAGE_TRANSFER_LOG, pParent) |
| | | { |
| | | m_crBkgnd = PAGE_BACKGROUND_COLOR; |
| | | m_hbrBkgnd = nullptr; |
| | | m_pObserver = nullptr; |
| | | |
| | | m_strStatus = ""; |
| | | m_strKeyword = ""; |
| | | m_nCurPage = 0; |
| | | m_nTotalPages = 0; |
| | | |
| | | memset(m_szTimeStart, 0, sizeof(m_szTimeStart)); |
| | | memset(m_szTimeEnd, 0, sizeof(m_szTimeEnd)); |
| | | m_szTimeStart[0] = '\0'; |
| | | m_szTimeEnd[0] = '\0'; |
| | | } |
| | | |
| | | CPageTransferLog::~CPageTransferLog() |
| | | { |
| | | if (m_hbrBkgnd != nullptr) { |
| | | ::DeleteObject(m_hbrBkgnd); |
| | | } |
| | | if (m_pObserver != nullptr) { |
| | | m_pObserver->unsubscribe(); |
| | | m_pObserver = nullptr; |
| | | } |
| | | } |
| | | |
| | | void CPageTransferLog::DoDataExchange(CDataExchange* pDX) |
| | | { |
| | | DDX_Control(pDX, IDC_DATETIMEPICKER_START, m_dateTimeStart); |
| | | DDX_Control(pDX, IDC_DATETIMEPICKER_END, m_dateTimeEnd); |
| | | DDX_Control(pDX, IDC_LIST_ALARM, m_listCtrl); |
| | | CDialogEx::DoDataExchange(pDX); |
| | | } |
| | | |
| | | void CPageTransferLog::InitRxWindow() |
| | | { |
| | | /* code */ |
| | | // 订é
æ°æ® |
| | | IRxWindows* pRxWindows = RX_GetRxWindows(); |
| | | pRxWindows->enableLog(5); |
| | | if (m_pObserver == NULL) { |
| | | m_pObserver = pRxWindows->allocObserver([&](IAny* pAny) -> void { |
| | | // onNext |
| | | pAny->addRef(); |
| | | int code = pAny->getCode(); |
| | | |
| | | //if (RX_CODE_ALARM_SET == code) { |
| | | // UpdatePageData(); |
| | | //} |
| | | //else if (RX_CODE_ALARM_CLEAR == code) { |
| | | // UpdatePageData(); |
| | | //} |
| | | |
| | | pAny->release(); |
| | | }, [&]() -> void { |
| | | // onComplete |
| | | }, [&](IThrowable* pThrowable) -> void { |
| | | // onErrorm |
| | | pThrowable->printf(); |
| | | }); |
| | | |
| | | theApp.m_model.getObservable()->observeOn(pRxWindows->mainThread())->subscribe(m_pObserver); |
| | | } |
| | | } |
| | | |
| | | void CPageTransferLog::Resize() |
| | | { |
| | | CRect rcClient; |
| | | GetClientRect(&rcClient); |
| | | |
| | | // ===== 常éå®ä¹ ===== |
| | | const int nLeft = 12; |
| | | const int nRight = 12; |
| | | const int nTop = 58; |
| | | const int nButtonHeight = 28; |
| | | const int nButtonMarginBottom = 12; |
| | | const int nSpacing = 8; |
| | | const int nButtonWidth = 80; |
| | | const int nLabelWidth = 100; |
| | | |
| | | // ===== å页æ§ä»¶å¸å± ===== |
| | | int yBottom = rcClient.bottom - nButtonMarginBottom - nButtonHeight; |
| | | int xRight = rcClient.Width() - nRight; |
| | | |
| | | CWnd* pBtnNext = GetDlgItem(IDC_BUTTON_NEXT_PAGE); |
| | | CWnd* pBtnPrev = GetDlgItem(IDC_BUTTON_PREV_PAGE); |
| | | CWnd* pLabelPage = GetDlgItem(IDC_LABEL_PAGE_NUMBER); |
| | | |
| | | if (pBtnNext && pBtnPrev && pLabelPage) { |
| | | // è·ååé¡µææ¬å®½åº¦ä¼°ç® |
| | | //CString strLabel; |
| | | //GetDlgItemText(IDC_LABEL_PAGE_NUMBER, strLabel); |
| | | //if (strLabel.IsEmpty()) { |
| | | // strLabel = _T("第 1 / 1 页"); |
| | | //} |
| | | //int nCharWidth = 8; |
| | | //int nLabelWidth = strLabel.GetLength() * nCharWidth + 20; |
| | | |
| | | // 设置æé®åæ ç¾ä½ç½® |
| | | pBtnNext->MoveWindow(xRight - nButtonWidth, yBottom, nButtonWidth, nButtonHeight); |
| | | xRight -= nButtonWidth + nSpacing; |
| | | |
| | | pLabelPage->MoveWindow(xRight - nLabelWidth, yBottom, nLabelWidth, nButtonHeight); |
| | | xRight -= nLabelWidth + nSpacing; |
| | | |
| | | pBtnPrev->MoveWindow(xRight - nButtonWidth, yBottom, nButtonWidth, nButtonHeight); |
| | | } |
| | | |
| | | // ===== è¡¨æ ¼åºåå¸å± ===== |
| | | if (nullptr != m_listCtrl.m_hWnd) { |
| | | int listHeight = yBottom - nTop - nSpacing; |
| | | m_listCtrl.MoveWindow(nLeft, nTop, rcClient.Width() - nLeft - nRight, listHeight); |
| | | } |
| | | } |
| | | |
| | | void CPageTransferLog::InitStatusCombo() |
| | | { |
| | | CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_STATUS_FILTER); |
| | | if (nullptr != pComboBox) { |
| | | pComboBox->ResetContent(); |
| | | pComboBox->AddString(_T("å
¨é¨")); |
| | | pComboBox->AddString(_T("Ready")); |
| | | pComboBox->AddString(_T("Running")); |
| | | pComboBox->AddString(_T("Error")); |
| | | pComboBox->AddString(_T("Abort")); |
| | | pComboBox->AddString(_T("Completed")); |
| | | pComboBox->SetCurSel(0); |
| | | } |
| | | } |
| | | |
| | | void CPageTransferLog::InitTimeRangeCombo() |
| | | { |
| | | CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_DATETIME); |
| | | if (nullptr != pComboBox) { |
| | | pComboBox->ResetContent(); |
| | | pComboBox->AddString(_T("ä¸é")); |
| | | pComboBox->AddString(_T("ä»å¤©")); |
| | | pComboBox->AddString(_T("ä¸å¤©å
")); |
| | | pComboBox->AddString(_T("æ¬æ")); |
| | | pComboBox->AddString(_T("ä»å¹´")); |
| | | pComboBox->AddString(_T("èªå®ä¹")); |
| | | pComboBox->SetCurSel(0); |
| | | } |
| | | } |
| | | |
| | | void CPageTransferLog::InitDateTimeControls() |
| | | { |
| | | if (m_dateTimeStart.m_hWnd == nullptr || m_dateTimeEnd.m_hWnd == nullptr) { |
| | | return; |
| | | } |
| | | |
| | | // ç¦ç¨åå§ç¶æ |
| | | m_dateTimeStart.EnableWindow(FALSE); |
| | | m_dateTimeEnd.EnableWindow(FALSE); |
| | | |
| | | // è®¾ç½®æ ¼å¼ï¼æ¾ç¤ºæ¥æ + æ¶é´ |
| | | //m_dateTimeStart.SetFormat(_T("yyyy/MM/dd HH:mm:ss")); |
| | | //m_dateTimeEnd.SetFormat(_T("yyyy/MM/dd HH:mm:ss")); |
| | | |
| | | // ä¿®æ¹æ ·å¼ä»¥æ¯ææ¶é´æ ¼å¼ |
| | | //DWORD dwStyleStart = m_dateTimeStart.GetStyle(); |
| | | //DWORD dwStyleEnd = m_dateTimeEnd.GetStyle(); |
| | | |
| | | //m_dateTimeStart.ModifyStyle(0, DTS_TIMEFORMAT | DTS_UPDOWN); |
| | | //m_dateTimeEnd.ModifyStyle(0, DTS_TIMEFORMAT); |
| | | } |
| | | |
| | | void CPageTransferLog::LoadTransfers() |
| | | { |
| | | m_nCurPage = 1; |
| | | UpdatePageData(); |
| | | } |
| | | |
| | | void CPageTransferLog::UpdatePageData() |
| | | { |
| | | TransferData filter; |
| | | filter.strStatus = m_strStatus; |
| | | filter.strDescription = m_strKeyword; |
| | | filter.strCreateTime = m_szTimeStart; |
| | | filter.strEndTime = m_szTimeEnd; |
| | | auto vecData = TransferManager::getInstance().getTransfers(filter, m_nCurPage, PAGE_SIZE); |
| | | FillDataToListCtrl(vecData); |
| | | |
| | | int nTotalRecords = TransferManager::getInstance().getFilteredTransferCount(filter); |
| | | m_nTotalPages = (nTotalRecords + PAGE_SIZE - 1) / PAGE_SIZE; |
| | | UpdatePageControls(); |
| | | } |
| | | |
| | | void CPageTransferLog::UpdatePageControls() |
| | | { |
| | | CString strPage; |
| | | strPage.Format(_T("第 %d / %d 页"), m_nCurPage, m_nTotalPages); |
| | | SetDlgItemText(IDC_LABEL_PAGE_NUMBER, strPage); |
| | | GetDlgItem(IDC_BUTTON_PREV_PAGE)->EnableWindow(m_nCurPage > 1); |
| | | GetDlgItem(IDC_BUTTON_NEXT_PAGE)->EnableWindow(m_nCurPage < m_nTotalPages); |
| | | |
| | | Resize(); |
| | | } |
| | | |
| | | void CPageTransferLog::UpdateDateFilter() |
| | | { |
| | | CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_DATETIME); |
| | | if (nullptr != pComboBox) { |
| | | int nIndex = pComboBox->GetCurSel(); |
| | | if (nIndex == 0) { |
| | | memset(m_szTimeStart, 0, sizeof(m_szTimeStart)); |
| | | memset(m_szTimeEnd, 0, sizeof(m_szTimeEnd)); |
| | | m_szTimeStart[0] = '\0'; |
| | | m_szTimeEnd[0] = '\0'; |
| | | } |
| | | else { |
| | | CTime time = CTime::GetCurrentTime(); |
| | | if (nIndex == 1) { |
| | | sprintf_s(m_szTimeStart, 64, "%d-%02d-%02d 00:00:00", time.GetYear(), time.GetMonth(), time.GetDay()); |
| | | sprintf_s(m_szTimeEnd, 64, "%d-%02d-%02d 23:59:59", time.GetYear(), time.GetMonth(), time.GetDay()); |
| | | } |
| | | else if (nIndex == 2) { |
| | | CTime time2 = time - CTimeSpan(7, 0, 0, 0); |
| | | sprintf_s(m_szTimeStart, 64, "%d-%02d-%02d 00:00:00", time2.GetYear(), time2.GetMonth(), time2.GetDay()); |
| | | sprintf_s(m_szTimeEnd, 64, "%d-%02d-%02d 23:59:59", time.GetYear(), time.GetMonth(), time.GetDay()); |
| | | } |
| | | else if (nIndex == 3) { |
| | | sprintf_s(m_szTimeStart, 64, "%d-%02d-01 00:00:00", time.GetYear(), time.GetMonth()); |
| | | sprintf_s(m_szTimeEnd, 64, "%d-%02d-%02d 23:59:59", time.GetYear(), time.GetMonth(), time.GetDay()); |
| | | } |
| | | else if (nIndex == 4) { |
| | | sprintf_s(m_szTimeStart, 64, "%d-01-01 00:00:00", time.GetYear()); |
| | | sprintf_s(m_szTimeEnd, 64, "%d-12-31 23:59:59", time.GetYear()); |
| | | } |
| | | else if (nIndex == 5) { |
| | | SYSTEMTIME t1, t2; |
| | | m_dateTimeStart.GetTime(&t1); |
| | | m_dateTimeEnd.GetTime(&t2); |
| | | //sprintf_s(m_szTimeStart, 64, "%d-%02d-%02d %02d:%02d:%02d", t1.wYear, t1.wMonth, t1.wDay, t1.wHour, t1.wMinute, t1.wSecond); |
| | | //sprintf_s(m_szTimeEnd, 64, "%d-%02d-%02d %02d:%02d:%02d", t2.wYear, t2.wMonth, t2.wDay, t2.wHour, t2.wMinute, t2.wSecond); |
| | | |
| | | sprintf_s(m_szTimeStart, 64, "%d-%02d-%02d 00:00:00", t1.wYear, t1.wMonth, t1.wDay); |
| | | sprintf_s(m_szTimeEnd, 64, "%d-%02d-%02d 23:59:59", t2.wYear, t2.wMonth, t2.wDay); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | void CPageTransferLog::FillDataToListCtrl(const std::vector<TransferData>& vecData) |
| | | { |
| | | if (m_listCtrl.m_hWnd == nullptr) { |
| | | return; |
| | | } |
| | | |
| | | m_listCtrl.DeleteAllItems(); |
| | | for (const auto& item : vecData) { |
| | | InsertTransferData(item); |
| | | } |
| | | } |
| | | |
| | | void CPageTransferLog::InsertTransferData(const TransferData& data) |
| | | { |
| | | if (m_listCtrl.m_hWnd == nullptr) { |
| | | return; |
| | | } |
| | | |
| | | int nItem = m_listCtrl.InsertItem(0, _T("")); |
| | | CString str; |
| | | str.Format(_T("%d"), data.nRecordId); |
| | | m_listCtrl.SetItemText(nItem, 1, str); |
| | | m_listCtrl.SetItemText(nItem, 2, CString(data.strStatus.c_str())); |
| | | m_listCtrl.SetItemText(nItem, 3, CString(data.strClassID.c_str())); |
| | | m_listCtrl.SetItemText(nItem, 4, CString(data.strCreateTime.c_str())); |
| | | m_listCtrl.SetItemText(nItem, 5, CString(data.strPickTime.c_str())); |
| | | m_listCtrl.SetItemText(nItem, 6, CString(data.strPlaceTime.c_str())); |
| | | m_listCtrl.SetItemText(nItem, 7, CString(data.strEndTime.c_str())); |
| | | m_listCtrl.SetItemText(nItem, 8, CString(data.strDescription.c_str())); |
| | | } |
| | | |
| | | BEGIN_MESSAGE_MAP(CPageTransferLog, CDialogEx) |
| | | ON_WM_CTLCOLOR() |
| | | ON_WM_DESTROY() |
| | | ON_WM_SIZE() |
| | | ON_WM_TIMER() |
| | | ON_CBN_SELCHANGE(IDC_COMBO_DATETIME, &CPageTransferLog::OnCbnSelchangeComboDatetime) |
| | | ON_CBN_SELCHANGE(IDC_COMBO_STATUS_FILTER, &CPageTransferLog::OnCbnSelchangeComboStatusFilter) |
| | | ON_BN_CLICKED(IDC_BUTTON_SEARCH, &CPageTransferLog::OnBnClickedButtonSearch) |
| | | ON_BN_CLICKED(IDC_BUTTON_EXPORT, &CPageTransferLog::OnBnClickedButtonExport) |
| | | ON_BN_CLICKED(IDC_BUTTON_PREV_PAGE, &CPageTransferLog::OnBnClickedButtonPrevPage) |
| | | ON_BN_CLICKED(IDC_BUTTON_NEXT_PAGE, &CPageTransferLog::OnBnClickedButtonNextPage) |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | | // CPageTransferLog æ¶æ¯å¤çç¨åº |
| | | |
| | | BOOL CPageTransferLog::OnInitDialog() |
| | | { |
| | | CDialogEx::OnInitDialog(); |
| | | |
| | | // TODO: 卿¤æ·»å é¢å¤çåå§å |
| | | SetTimer(1, 3000, nullptr); |
| | | |
| | | // ä¸ææ¡æ§ä»¶ |
| | | InitStatusCombo(); |
| | | InitTimeRangeCombo(); |
| | | |
| | | // æ¥ææ§ä»¶ |
| | | InitDateTimeControls(); |
| | | |
| | | // æ¥è¡¨æ§ä»¶ |
| | | DWORD dwStyle = m_listCtrl.GetExtendedStyle(); |
| | | dwStyle |= LVS_EX_FULLROWSELECT; |
| | | dwStyle |= LVS_EX_GRIDLINES; |
| | | m_listCtrl.SetExtendedStyle(dwStyle); |
| | | |
| | | HIMAGELIST imageList = ImageList_Create(24, 24, ILC_COLOR24, 1, 1); |
| | | ListView_SetImageList(m_listCtrl.GetSafeHwnd(), imageList, LVSIL_SMALL); |
| | | |
| | | CString headers[] = { _T(""), _T("ä»»å¡ID"), _T("ç¶æ"), _T("ClassID"), _T("å建æ¶é´"), _T("åçæ¶é´"), _T("æ¾çæ¶é´"), _T("ç»ææ¶é´"), _T("æè¿°") }; |
| | | int widths[] = { 0, 80, 80, 100, 120, 120, 120, 120, 200 }; |
| | | for (int i = 0; i < 9; ++i) { |
| | | m_listCtrl.InsertColumn(i, headers[i], LVCFMT_LEFT, widths[i]); |
| | | } |
| | | m_listCtrl.SetColumnWidth(8, LVSCW_AUTOSIZE_USEHEADER); |
| | | |
| | | // 读åºå宽 |
| | | CString strIniFile, strItem; |
| | | strIniFile.Format(_T("%s\\configuration.ini"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir); |
| | | int width[8] = { 0, 80, 180, 80, 80, 100, 80, 180 }; |
| | | for (int i = 0; i < 8; i++) { |
| | | strItem.Format(_T("Col_%d_Width"), i); |
| | | width[i] = GetPrivateProfileInt("TransferListCtrl", strItem, width[i], strIniFile); |
| | | } |
| | | |
| | | // è®¡ç®æ»é¡µæ° |
| | | int nTotalRecords = TransferManager::getInstance().getTotalTransferCountAll(); |
| | | m_nTotalPages = (nTotalRecords + PAGE_SIZE - 1) / PAGE_SIZE; |
| | | m_nCurPage = 1; |
| | | |
| | | Resize(); |
| | | LoadTransfers(); |
| | | |
| | | return TRUE; // return TRUE unless you set the focus to a control |
| | | // å¼å¸¸: OCX 屿§é¡µåºè¿å FALSE |
| | | } |
| | | |
| | | HBRUSH CPageTransferLog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) |
| | | { |
| | | if (nCtlColor == CTLCOLOR_STATIC) { |
| | | pDC->SetBkColor(m_crBkgnd); |
| | | } |
| | | |
| | | if (m_hbrBkgnd == nullptr) { |
| | | m_hbrBkgnd = CreateSolidBrush(m_crBkgnd); |
| | | } |
| | | |
| | | return m_hbrBkgnd; |
| | | } |
| | | |
| | | void CPageTransferLog::OnDestroy() |
| | | { |
| | | CDialogEx::OnDestroy(); |
| | | if (m_hbrBkgnd != nullptr) { |
| | | ::DeleteObject(m_hbrBkgnd); |
| | | m_hbrBkgnd = nullptr; |
| | | } |
| | | if (m_pObserver != nullptr) { |
| | | m_pObserver->unsubscribe(); |
| | | m_pObserver = nullptr; |
| | | } |
| | | |
| | | // ä¿åå宽 |
| | | CString strIniFile, strItem, strTemp; |
| | | strIniFile.Format(_T("%s\\configuration.ini"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir); |
| | | CHeaderCtrl* pHeader = m_listCtrl.GetHeaderCtrl(); |
| | | for (int i = 0; i < pHeader->GetItemCount(); i++) { |
| | | RECT rect; |
| | | pHeader->GetItemRect(i, &rect); |
| | | strItem.Format(_T("Col_%d_Width"), i); |
| | | strTemp.Format(_T("%d"), rect.right - rect.left); |
| | | WritePrivateProfileString("TransferListCtrl", strItem, strTemp, strIniFile); |
| | | } |
| | | } |
| | | |
| | | void CPageTransferLog::OnSize(UINT nType, int cx, int cy) |
| | | { |
| | | CDialogEx::OnSize(nType, cx, cy); |
| | | Resize(); |
| | | } |
| | | |
| | | void CPageTransferLog::OnTimer(UINT_PTR nIDEvent) |
| | | { |
| | | if (nIDEvent == 1) { |
| | | KillTimer(1); |
| | | InitRxWindow(); |
| | | } |
| | | CDialogEx::OnTimer(nIDEvent); |
| | | } |
| | | |
| | | void CPageTransferLog::OnCbnSelchangeComboDatetime() |
| | | { |
| | | CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_DATETIME); |
| | | int nIndex = pComboBox->GetCurSel(); |
| | | int nCount = pComboBox->GetCount(); |
| | | m_dateTimeStart.EnableWindow(nIndex == nCount - 1); |
| | | m_dateTimeEnd.EnableWindow(nIndex == nCount - 1); |
| | | |
| | | // æ´æ°æ¥æè¿æ»¤å¨å页颿°æ® |
| | | UpdateDateFilter(); |
| | | LoadTransfers(); |
| | | } |
| | | |
| | | void CPageTransferLog::OnCbnSelchangeComboStatusFilter() |
| | | { |
| | | CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_STATUS_FILTER); |
| | | int nIndex = pComboBox->GetCurSel(); |
| | | if (nIndex == 0) { |
| | | m_strStatus.clear(); |
| | | } |
| | | else { |
| | | CString cstrText; |
| | | pComboBox->GetLBText(nIndex, cstrText); |
| | | m_strStatus = CT2A(cstrText); |
| | | } |
| | | LoadTransfers(); |
| | | } |
| | | |
| | | void CPageTransferLog::OnBnClickedButtonSearch() |
| | | { |
| | | // è·åå
³é®åè¾å
¥æ¡å
容 |
| | | CString strKeyword; |
| | | GetDlgItemText(IDC_EDIT_KEYWORD, strKeyword); |
| | | m_strKeyword = CT2A(strKeyword); |
| | | |
| | | // æ´æ°æ¥æè¿æ»¤å¨å页颿°æ® |
| | | UpdateDateFilter(); |
| | | LoadTransfers(); |
| | | } |
| | | |
| | | void CPageTransferLog::OnBnClickedButtonExport() |
| | | { |
| | | CFileDialog fileDialog(FALSE, _T("csv"), NULL, OFN_HIDEREADONLY, _T("CSV Files (*.csv)|*.csv||")); |
| | | if (fileDialog.DoModal() != IDOK) { |
| | | return; |
| | | } |
| | | |
| | | CStdioFile file; |
| | | if (!file.Open(fileDialog.GetPathName(), CFile::modeCreate | CFile::modeWrite | CFile::typeText)) { |
| | | AfxMessageBox(_T("å建æä»¶å¤±è´¥ï¼")); |
| | | return; |
| | | } |
| | | |
| | | CString strHeader = _T("ä»»å¡ID,ç¶æ,ClassID,å建æ¶é´,åçæ¶é´,æ¾çæ¶é´,ç»ææ¶é´,æè¿°\n"); |
| | | file.WriteString(strHeader); |
| | | |
| | | for (int i = 0; i < m_listCtrl.GetItemCount(); ++i) { |
| | | CString row; |
| | | for (int j = 1; j <= 8; ++j) { |
| | | row += m_listCtrl.GetItemText(i, j); |
| | | if (j != 8) { |
| | | row += ","; |
| | | } |
| | | } |
| | | row += "\n"; |
| | | file.WriteString(row); |
| | | } |
| | | file.Close(); |
| | | } |
| | | |
| | | void CPageTransferLog::OnBnClickedButtonPrevPage() |
| | | { |
| | | if (m_nCurPage > 1) { |
| | | m_nCurPage--; |
| | | UpdatePageData(); |
| | | } |
| | | } |
| | | |
| | | void CPageTransferLog::OnBnClickedButtonNextPage() |
| | | { |
| | | if (m_nCurPage < m_nTotalPages) { |
| | | m_nCurPage++; |
| | | UpdatePageData(); |
| | | } |
| | | } |