1 / 11

Single Document Interface(SDI) Multiple Document Interface(MDI)

Single Document Interface(SDI) Multiple Document Interface(MDI). Giảng viên : Trần Anh Tuấn A Bộ môn : Ứng dụng Tin Học. Cách tạo project SDI & MDI. Cách tạo project SDI & MDI. Cấu trúc Document-View của SDI & MDI. Cấu trúc Document-View của SDI & MDI. Cấu trúc Document-View của SDI & MDI.

annora
Télécharger la présentation

Single Document Interface(SDI) Multiple Document Interface(MDI)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Single Document Interface(SDI) Multiple Document Interface(MDI) Giảng viên : Trần Anh Tuấn A Bộ môn : Ứng dụng Tin Học

  2. Cách tạo project SDI & MDI

  3. Cách tạo project SDI & MDI

  4. Cấu trúc Document-View của SDI & MDI

  5. Cấu trúc Document-View của SDI & MDI

  6. Cấu trúc Document-View của SDI & MDI • Ứng dụng dạng SDI & MDI các class được tạo ra kế thừa từ các class có sẵn: • SDI : CWinApp , CFrameWnd , CDocument , CView • MDI : CWinApp , CMDIFrameWnd , CMDIChildWnd , CDocument , CView. • Nhiệm vụ cụ thể của từng lớp như sau :

  7. Cấu trúc Document-View của SDI & MDI

  8. SDI : MDI : Tương tác giữa các Class

  9. Tương tác giữa các Class • Ví dụ : • Tạo project SDI tên Test • Chương trình tạo các lớp sau : • CMainFrame , CTestApp , CTestDoc , CTestView • Thêm chỉnh toolbar , các toolbox trong lớp CMainFrame • Định nghĩa cấu trúc dữ liệu trong CTestDoc • Ví dụ : Cấu trúc CLine có các hàm AddLine , DrawLine , RemoveLine …..

  10. Tương tác giữa các Class • Trong CTestView • Xử lý các sự kiện trên toolbar , menu • Xử lý các sự kiện chuột bàn phím • Truy cập dữ liệu hay hàm trong CTestDoc • CTestDoc * pDoc = GetDocument(); • pDoc{Tên hàm , Tên dữ liệu} • Lưu trữ dữ liệu sau khi tính vào CTestDoc • GetDocument()AddLine(point,point);

  11. Hết

More Related