TAILIEUCHUNG - Microsoft Visual C++ Windows Applications by Example phần 8

Các tế bào của bảng tính được tổ chức trong một ma trận. Kích thước của ma trận được xác định bởi hằng ROWS và COLS. M_buffer lĩnh vực là một mảng hai chiều giữ tế bào. Các nhà xây dựng mặc định đặt con trỏ này ma trận tế bào cho mỗi tế bào. | The Calc Application The Cell Matrix Managing Rows and Columns The cells of the spreadsheet are organized in a matrix. The size of the matrix is determined by the constants ROWS and COLS. The fields m_buffer is a two-dimensional array holding the cells. The default constructor sets the pointer to this cell matrix for each cell. The copy constructor and the assignment operator copy the cells one by one and set the cell matrix pointer for each cell. This shows that every cell has a pointer to the matrix it belongs to as well as the associated target set matrix. Serialize is called when the user chooses the save or open menu item. It serializes the matrix one cell at a time. In the case of loading it also sets the cell matrix pointer of the cell. class TSetMatrix const int ROWS 10 const int COLS 5 class CellMatrix public CellMatrix CellMatrix const CellMatrix cellMatrix CellMatrix operator const CellMatrix cellMatrix void SetTargetSetMatrix TSetMatrix pTargetSetMatrix Cell Get int iRow int iCol const Cell Get Reference home const void Serialize CArchive archive private Cell m_buffer ROWS COLS The copy constructor copies the cells one by one and sets the cell matrix pointer for each cell. This shows that every cell has a pointer to the matrix it belongs to. CellMatrix CellMatrix const CellMatrix cellMatrix for int iRow 0 iRow ROWS iRow for int iCol 0 iCol COLS iCol 286 Chapter 8 m_buffer iRow iCol iRow iCol m_buffer iRow iCol .SetCellMatrix this The method Get comes in two forms it returns a pointer to the cell indicated by the given row and column or by the given reference. The row and column are checked to be inside the limits of the matrix. However the check is for debugging purpose only the method will never be called with invalid parameters. Cell CellMatrix Get int iRow int iCol const check iRow 0 iRow ROWS check iCol 0 iCol COLS return Cell m_buffer iRow iCol Cell CellMatrix Get Reference home const return Get .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.