void CYM::OnEditProperties(CElecMapView * pView) { CPropertySheet sheet( _T("累加量对象..") ); CYC_PROP_INFO dlg0(2); dlg0.SetPara(m_ym.ename,m_ym.digitlength,m_ym.hint,m_ym.unit, m_ym.unitcolor,m_ym.hintcolor,m_ym.hintenable,m_ym.hintdis,m_ym.unitdis); sheet.AddPage( &dlg0); CYC_PROP_DIS dlg1(2); dlg1.SetPara2(m_ym.disablecolor,m_ym.normalcolor, m_ym.lgfont,m_ym.rect.x0,m_ym.rect.y0, m_ym.fontwidth,m_ym.fontheight,m_ym.fontjj); sheet.AddPage( &dlg1); if (sheet.DoModal() != IDOK) return; RefreshIt(); dlg0.GetPara(m_ym.ename,&m_ym.digitlength,m_ym.hint,m_ym.unit, &m_ym.unitcolor,&m_ym.hintcolor,&m_ym.hintenable,&m_ym.hintdis,&m_ym.unitdis); dlg1.GetPara2(&m_ym.disablecolor,&m_ym.normalcolor, &m_ym.lgfont,&m_ym.rect.x0,&m_ym.rect.y0, &m_ym.fontwidth,&m_ym.fontheight,&m_ym.fontjj); SetModifiedFlag(); m_recalrect=true; RefreshIt(); CYMTool::canuse=true; CYMTool::m_ym=this->m_ym; sprintf(CYMTool::m_ym.ename,""); CYMTool::m_ym.fontwidth=(float)(pView->ULtoLL(m_ym.fontwidth)); CYMTool::m_ym.fontheight=(float)(pView->ULtoLL(m_ym.fontheight)); CYMTool::m_ym.fontjj=(float)(pView->ULtoLL(m_ym.fontjj)); CYMTool::m_ym.hintdis=(float)(pView->ULtoLL(m_ym.hintdis)); }
void MainWindow::on_actionAdd_triggered() { QModelIndex ixgroupst = ui.treeGroup->currentIndex(); if ( ixgroupst.isValid() ){ int rowst = ixgroupst.row(); QSqlRecord recordst = model2->record ( rowst ); QString idgrload = recordst.value ( "id" ).toString(); QString title = ( "New" ); AddDialog dlg1 ( title,idgrload,this ); //dlg1.exec(); if ( dlg1.exec() == QDialog::Accepted ) { model->setQuery ( "SELECT * FROM contacts WHERE idgroup = "+ dlg1.group +"" ); ui.treeView->hideColumn ( 3 ); ui.treeView->hideColumn ( 4 ); ui.treeView->hideColumn ( 5 ); ui.treeView->hideColumn ( 6 ); } } else{ QMessageBox::information ( this, "info"," You must create a group first." ); } }
void ImageWndPicWnd::OnPicWndSave() { if(org.HasImage()) { CFileDialog dlg1(FALSE,"png"); if(dlg1.DoModal()==IDOK) { org.SaveImage(dlg1.GetFileName()); } } }
void TreeView::SaveFile(DataObj *currentObj, CString name) { CFileDialog dlg1( FALSE, "csv",name , OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "CSV file|*.csv|All files|*.*||"); if ( dlg1.DoModal() == IDOK ) { CString filename( dlg1.GetPathName() ); CWaitCursor c; currentObj->WriteAscii(filename); } }
RMDialogChoice::RMDialogChoice() { RMResRaw dlg1(RES_I_DLGTEXT); RMResRaw dlg2(RES_I_DLGTEXTLINE); RMRes dlgpal(RES_I_DLGTEXTPAL); _dlgText.init(dlg1, dlg1.width(), dlg1.height()); _dlgTextLine.init(dlg2, dlg2.width(), dlg2.height()); _dlgText.loadPaletteWA(dlgpal); _dlgTextLine.loadPaletteWA(dlgpal); _hUnreg = CoroScheduler.createEvent(false, false); _bRemoveFromOT = false; _curAdded = 0; _bShow = false; }
void main() { MyDialogHandler myHandler; DialogWindow dlg1( IC_DEFAULT_FRAME_ID, IWindow::desktopWindow(), myHandler, "myHandler" ); DialogWindow dlg2( IC_DEFAULT_FRAME_ID, IWindow::desktopWindow(), myDlgProc, "myDlgProc" ); dlg1.show(); dlg2.show().setFocus(); IThread::current().processMsgs(); }
BOOL CProductControlApp::InitInstance() { CUserLoading dlg1(m_pChaseDataLib); if(IDCANCEL==dlg1.DoModal()) return false; AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif CProductControlDlg dlg(m_pChaseDataLib); m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; }
KNDdeTorusCollocation::KNDdeTorusCollocation(KNExprSystem& sys_, size_t ndeg1_, size_t ndeg2_, size_t nint1_, size_t nint2_) : sys(&sys_), ndim(sys_.ndim()), ntau(sys_.ntau()), npar(sys_.npar()), ndeg1(ndeg1_), ndeg2(ndeg2_), nint1(nint1_), nint2(nint2_), col1(ndeg1_), col2(ndeg2_), mesh1(ndeg1_ + 1), mesh2(ndeg2_ + 1), lgr1(ndeg1_ + 1, ndeg1_ + 1), lgr2(ndeg2_ + 1, ndeg2_ + 1), dlg1(ndeg1_ + 1, ndeg1_ + 1), dlg2(ndeg2_ + 1, ndeg2_ + 1), I1((ndeg1_ + 1), (ndeg1_ + 1)), ID1((ndeg1_ + 1), (ndeg1_ + 1)), I2((ndeg2_ + 1), (ndeg2_ + 1)), ID2((ndeg2_ + 1), (ndeg2_ + 1)), mlg1((ndeg1_ + 1)*(ndeg1_ + 1)), mlg2((ndeg2_ + 1)*(ndeg2_ + 1)), mlgd1((ndeg1_ + 1)*(ndeg1_ + 1)), mlgd2((ndeg2_ + 1)*(ndeg2_ + 1)), ilg1((ndeg1_ + 1)*(ndeg1_ + 1) + 1), ilg2((ndeg2_ + 1)*(ndeg2_ + 1) + 1), ilgd1((ndeg1_ + 1)*(ndeg1_ + 1) + 1), ilgd2((ndeg2_ + 1)*(ndeg2_ + 1) + 1), time1(ndeg1*ndeg2*nint1*nint2), time2(ndeg1*ndeg2*nint1*nint2), kk((ntau+1)*(ndeg1+1)*(ndeg2+1), ndeg1*ndeg2*nint1*nint2), ee((ntau+1)*(ndeg1+1)*(ndeg2+1), ndeg1*ndeg2*nint1*nint2), rr((ntau+1)*(ndeg1+1)*(ndeg2+1), ndeg1*ndeg2*nint1*nint2), p_tau(ntau, ndeg1*ndeg2*nint1*nint2), p_dtau(ntau, ndeg1*ndeg2*nint1*nint2), p_xx(ndim, ntau+2*(ntau+1), ndeg1*ndeg2*nint1*nint2), p_fx(ndim, ndeg1*ndeg2*nint1*nint2), p_dfp(ndim, 1, ndeg1*ndeg2*nint1*nint2), p_dfx(ndim, ndim, ndeg1*ndeg2*nint1*nint2), p_dummy(0, 0, ndeg1*ndeg2*nint1*nint2) { lobatto(mesh1); lobatto(mesh2); gauss(col1); gauss(col2); for (size_t i = 0; i < mesh1.size(); i++) { poly_coeff_lgr(lgr1(i), mesh1, i); poly_coeff_diff(dlg1(i), lgr1(i)); } for (size_t i = 0; i < mesh2.size(); i++) { poly_coeff_lgr(lgr2(i), mesh2, i); poly_coeff_diff(dlg2(i), lgr2(i)); } // here comes the phase condition for par(OMEGA0) and par(OMEGA1) // the integration in the bottom border // construct the diffint matrix for (size_t i = 0; i < ndeg1 + 1; i++) { for (size_t k = 0; k < ndeg1 + 1; k++) { mlg1.clear(); mlgd1.clear(); ilg1.clear(); ilgd1.clear(); poly_coeff_mul(mlg1, lgr1(i), lgr1(k)); poly_coeff_mul(mlgd1, dlg1(i), lgr1(k)); poly_coeff_int(ilg1, mlg1); poly_coeff_int(ilgd1, mlgd1); I1(i, k) = (poly_eval(ilg1, 1.0)-poly_eval(ilg1, 0.0)) / nint1; ID1(i, k) = poly_eval(ilgd1, 1.0); } } for (size_t j = 0; j < ndeg2 + 1; j++) { for (size_t l = 0; l < ndeg2 + 1; l++) { mlg2.clear(); mlgd2.clear(); ilg2.clear(); ilgd2.clear(); poly_coeff_mul(mlg2, lgr2(j), lgr2(l)); poly_coeff_mul(mlgd2, dlg2(j), lgr2(l)); poly_coeff_int(ilg2, mlg2); poly_coeff_int(ilgd2, mlgd2); I2(j, l) = (poly_eval(ilg2, 1.0) - poly_eval(ilg2, 0.0))/ nint2; ID2(j, l) = poly_eval(ilgd2, 1.0); } } }
//任务列表 void CTaoFlowDlg::OnDblclkListTasklist(NMHDR *pNMHDR, LRESULT *pResult) { LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR); // TODO: 在此添加控件通知处理程序代码 NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; if (pNMListView->iItem < 0) { return; } TTaskAttribute &task = tasks.at(pNMListView->iItem); int nRet; CDlgTaoFlowSettings dlg(task); CDlgOptimizeKeyWord dlg1(task); CDlgTaoAlexaSetting dlg2(task); CDlgTaoQSpaceSettings dlg3(task); switch (task.eType) { default: nRet = dlg.DoModal(); break; case Alexa: nRet = dlg2.DoModal(); break; case KeyWord: nRet = dlg1.DoModal(); break; case QSpace: nRet = dlg3.DoModal(); break; } if (IDOK == nRet) { CString str, str1; CString strPathName = _T(".\\wkdata"); int nTaskCount = 0; unsigned int i = 0; switch (task.eAction) { default: break; case StartTask: m_ListTask.SetItemText(pNMListView->iItem, 2, _T("运行中")); CloseProgram(_T("wk.exe")); str1.Format(_T("%d"), 1); str.Format(_T("%s%d"), _T("Task"), pNMListView->iItem + 1); WritePrivateProfileString(str, _T("stat"), str1, strPathName); WinExec(".\\wk.exe",SW_HIDE); break; case StopTask: m_ListTask.SetItemText(pNMListView->iItem, 2, _T("已停止")); CloseProgram(_T("wk.exe")); str1.Format(_T("%d"), 0); str.Format(_T("%s%d"), _T("Task"), pNMListView->iItem + 1); WritePrivateProfileString(str, _T("stat"), str1, strPathName); WinExec(".\\wk.exe",SW_HIDE); break; case DelTask: tasks.erase(tasks.begin() + pNMListView->iItem); CloseProgram(_T("wk.exe")); nTaskCount = GetPrivateProfileInt(_T("TaskCount"), _T("Value"), 0, strPathName); str.Format(_T("%d"), nTaskCount - 1); WritePrivateProfileString(_T("TaskCount"), _T("Value"), str, strPathName); DelAllTaskDataF(); for (size_t i = 1; i <= tasks.size(); ++i) { SetFlowDataF(i); } m_ListTask.DeleteItem(pNMListView->iItem); WinExec(".\\wk.exe",SW_HIDE); break; case ModTask: CloseProgram(_T("wk.exe")); switch (task.eType) { default: m_ListTask.SetItemText(pNMListView->iItem, 1, task.strNetAddr); str.Format(_T("%s%d"), _T("Task"), pNMListView->iItem + 1); str += _T("Source"); WritePrivateProfileString(str, NULL, NULL, strPathName); str.Format(_T("%s%d"), _T("Task"), pNMListView->iItem + 1); str += _T("Click"); WritePrivateProfileString(str, NULL, NULL, strPathName); SetFlowDataF(pNMListView->iItem + 1); break; case KeyWord: m_ListTask.SetItemText(pNMListView->iItem, 1, task.strNetAddr); SetKeyWordDataF(pNMListView->iItem + 1); break; case Alexa: m_ListTask.SetItemText(pNMListView->iItem, 1, task.strNetAddr); SetAlexaDataF(pNMListView->iItem + 1); break; case QSpace: CString str = _T("user.qzone.qq.com/"); str += task.strQNumber; m_ListTask.SetItemText(pNMListView->iItem, 1, str); SetQSpaceDataF(pNMListView->iItem + 1); break; } WinExec(".\\wk.exe",SW_HIDE); break; } } *pResult = 0; }