void CCombineTitleByTimeDlg::OnCancel() { if(IsModified()) { int nRet = AfxMessageBox(IDS_DOC_SAVEPROMPT, MB_YESNOCANCEL); switch(nRet) { case IDYES: break; case IDNO: OnBnClickedSave(); break; case IDCANCEL: return; } } CDialog::OnCancel(); }
void selectDialog::OnClose() { int return_value_ID = MessageBoxA("是否保存数据","保存对话框",MB_YESNOCANCEL); if(return_value_ID == IDYES) { OnBnClickedSave(); CDialogEx::OnClose(); } else if (return_value_ID == IDNO) { CDialogEx::OnClose(); } else if (return_value_ID == IDCANCEL) { ; } }
// // OnCommand() // Override this function to handle WM_COMMAND messages sent to the main window. // BOOL CDemoApp::OnCommand(int nCmdID, int nEvent) { switch (nCmdID) { case IDM_EXIT: SendMessage(m_hWnd, WM_CLOSE, 0, 0); break; case IDM_ABOUT: ShowAboutDialog(); break; case ID_CAM_ROT: m_hand_action = HA_ROTATE; break; case ID_CAM_MOV: m_hand_action = HA_MOVE; break; case ID_CAM_ZOOM: m_hand_action = HA_ZOOM; break; case ID_CAM_FIT: FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_SAVE: { OnBnClickedSave(); } break; case ID_LOAD: { OnBnClickedLoad(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); } break; case ID_IMPORT_DXF: { OnBnClickedImportDXF(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); } break; case ID_EXPORT_DXF: { OnBnClickedExportDXF(); } break; case ID_IMPORT_STL: { OnBnClickedImportSTL(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); } break; case ID_EXPORT_STL: { OnBnClickedExportSTL(); } break; case ID_TRIANGLES_OBJ: { OnBnClickedFromTriangles(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); } break; case ID_PRIM_POINTS: OnBnClickedPrPoints(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_PRIM_LINES: OnBnClickedPrLines(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_PRIM_CIRCLES: OnBnClickedPrCircles(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_PRIM_ARCS: OnBnClickedPrArcs(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_PRIM_SPLINES: OnBnClickedPrSplines(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_PRIM_CONTOURS: OnBnClickedPrContours(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_PRIM_EQIUDI: OnBnClickedPrEquidi(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_PRIM_BOXES: OnBnClickedPrBoxes(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_PRIM_SPHERES: OnBnClickedPrSpheres(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_PRIM_CYL: OnBnClickedPrCyls(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_PRIM_CONES: OnBnClickedPrCones(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_PRIM_ELL: OnBnClickedPrEllipsoids(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_PRIM_TORS: OnBnClickedPrTors(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_PRIM_SPH_B: OnBnClickedPrSphericBands(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_BOOL_INTER : OnBnClickedBInters(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_BOOL_UNION: OnBnClickedBUnion(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_BOOL_SUB: OnBnClickedBSub(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_BOOL_INT_SEC: OnBnClickedBIntCont(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_BOOL_PL_SECTIONS: OnBnClickedBSection(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_KIN_ROT_SUR: OnBnClickedKinRotSurf(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_KIN_ROT_BODY: OnBnClickedKinRotBod(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_KIN_EXTR_SUR: OnBnClickedKinExtrSurf(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_KIN_EXTR_BODY: OnBnClickedKinExtrBod(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_KIN_SPIR_SUR: OnBnClickedKinSpirSurf(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_KIN_SPIR_BODY: OnBnClickedKinSpirBod(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_KIN_PIPE_SUR: OnBnClickedKinPipeSurf(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_KIN_PIPE_BODY: OnBnClickedKinPipeBod(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_SUR_MESH: OnBnClickedSurfMesh(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_SUR_FACE: OnBnClickedSurfFace(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_SUR_COONS_3: OnBnClickedSurfCoons3(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_SUR_COONS_4: OnBnClickedSurfCoons4(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_SUR_LINEAR: OnBnClickedSurfLinear(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_SUR_CLIPS: OnBnClickedSurfFromSect(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_SUR_CL_BOD: OnBnClickedSurfBodyFromSect(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_CS_ROOM: OnBnClickedScenesRoom(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_CS_DRILLS: OnBnClickedScenesDrills(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_CS_CLOCK: OnBnClickedScenesClock(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_TEXT1: OnBnClickedText1(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_TEXT2: OnBnClickedText2(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_DIM1: OnBnClickedDim1(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; case ID_DIM2: OnBnClickedDim2(); FitToScene(); SendMessage(m_hWnd, WM_PAINT, 0, 0); break; default: return CApp::OnCommand(nCmdID, nEvent); // Call default handler } return TRUE; }
void CInstrumentEditorDPCM::save_clicked() { OnBnClickedSave(); }