本文整理汇总了C++中CTransaction::getPrintingTotalPages方法的典型用法代码示例。如果您正苦于以下问题:C++ CTransaction::getPrintingTotalPages方法的具体用法?C++ CTransaction::getPrintingTotalPages怎么用?C++ CTransaction::getPrintingTotalPages使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTransaction
的用法示例。
在下文中一共展示了CTransaction::getPrintingTotalPages方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnChildDlgSwitchClicked
/*
当MainPage窗口有子窗口要切换,但是切换的控制在子窗口内部本身,发送一个消息给
MainPage,然后MainPage接受这个消息,再处理切换相关的事务。
*/
LRESULT CMainPage::OnChildDlgSwitchClicked(WPARAM wParam, LPARAM lParam)
{
CSysLog sl;
PopupDialog pdlg;
pdlg.SetTimeout(2);
pdlg.SetButtonText("确 定");
int file_total_pages = 0;
switch(wParam) {
case DLG_FILEPICK:
this->pDialog[DLG_PAY]->ShowWindow(SW_HIDE);
this->pDialog[DLG_PRINTSETTING]->ShowWindow(SW_HIDE);
this->pDialog[DLG_PREVIEW]->ShowWindow(SW_HIDE);
this->pDialog[DLG_FILEPICK]->ShowWindow(SW_SHOW);
break;
case DLG_PREVIEW:
/////////////////////////////////暂时不支持预览/////////////////////////////////////////
sl.writeLog("文件预览请求被点击");
pdlg.SetMessage("即将支持的功能,请稍等!");
pdlg.DoModal();
return 0;
/////////////////////////////////暂时不支持预览/////////////////////////////////////////
this->pDialog[DLG_FILEPICK]->ShowWindow(SW_HIDE);
//将要预览的文件传递给预览对话框
//PreviewDlg.m_fileFullPathInPreview = FilePickDlg.m_cur_path +"\\"+ FilePickDlg.m_sFileNameSelected;
PreviewDlg.m_fileFullPathInPreview = transaction.getFilenamePrinting();
//PreviewDlg.m_fileFullPathInPreview = "H:\\新建文件夹\\WeiYongcheng UESTC.doc";
this->pDialog[DLG_PREVIEW]->ShowWindow(SW_SHOW);
this->pDialog[DLG_PRINTSETTING]->ShowWindow(SW_HIDE);
this->pDialog[DLG_PAY]->ShowWindow(SW_HIDE);
break;
case DLG_PRINTSETTING:
file_total_pages = GetPagesFromFileName(transaction.getFilenamePrinting());
if ( file_total_pages > 0) {
transaction.setFileTotalPages(file_total_pages);
}
else if ( file_total_pages == 0) {
pdlg.SetMessage("尚未选择文件,快去选择吧");
if (pdlg.DoModal() == IDC_DLG_MYRETURN)
::PostMessage(this->m_hWnd,WM_CHILDSWITCH,DLG_FILEPICK,0);
else
::PostMessage(this->m_hWnd,WM_CHILDSWITCH,DLG_FILEPICK,0);
}
else {
pdlg.SetMessage("不能获得本Document对象,请重新选择!");
if (pdlg.DoModal() == IDC_DLG_MYRETURN)
OnOK();
}
this->pDialog[DLG_FILEPICK]->ShowWindow(SW_HIDE);
this->pDialog[DLG_PREVIEW]->ShowWindow(SW_HIDE);
this->pDialog[DLG_PAY]->ShowWindow(SW_HIDE);
this->pDialog[DLG_PRINTSETTING]->ShowWindow(SW_SHOW);
break;
case DLG_PAY:
if (transaction.getFilenamePrinting() == "") {
pdlg.SetMessage("尚未选择文件,请重新选择文件。");
//如果没有选择文件,则去选择文件呀
if (pdlg.DoModal() == IDC_DLG_MYRETURN)
::PostMessage(this->m_hWnd,WM_CHILDSWITCH,DLG_FILEPICK,0);
else
::PostMessage(this->m_hWnd,WM_CHILDSWITCH,DLG_FILEPICK,0);
return 0;
}
//未对待打印的文件进行设置,则去设置呀
if (transaction.getPrintingTotalPages() == 0 || transaction.getPrintingCopies() == 0)
{
if (!transaction.getFileSettingStr().IsEmpty()) {
pdlg.SetMessage("设置页面范围错误,请重新设置");
}
else
pdlg.SetMessage("还没进行设置打印参数,去设置吧");
if (pdlg.DoModal() == IDC_DLG_MYRETURN)
::PostMessage(this->m_hWnd, WM_CHILDSWITCH, DLG_PRINTSETTING,0);
else
::PostMessage(this->m_hWnd,WM_CHILDSWITCH, DLG_PRINTSETTING,0);
return 0;
}
this->pDialog[DLG_FILEPICK]->ShowWindow(SW_HIDE);
this->pDialog[DLG_PREVIEW]->ShowWindow(SW_HIDE);
this->pDialog[DLG_PRINTSETTING]->ShowWindow(SW_HIDE);
this->pDialog[DLG_PAY]->ShowWindow(SW_SHOW);
break;
default:
//unknown fault
;
}
return 0;
}