The Origin C MatrixPage class provides methods and properties common to Origin matrix books. This class is derived from Page class, from which it inherits its methods and properties. And matrixbook has the same data structure level with WorksheetPage in Origin, both are windows. So, they contain lots of similar operations.
Both matrixbook and workbook are windows, and they share lots of similar operations, and the Basic Workbook Operation chapter can be referred to.
MatrixPage matPg; matPg.Create("Origin"); // create a matrixbook using the Origin template
foreach(MatrixPage matPg in Project.MatrixPages) out_str(matPg.GetName()); // output matrixbook name
You can also access a matrixbook by passing its index to the Item method of the Collection class.
MatrixPage matPg; matPg = Project.MatrixPages.Item(2); if(matPg) // if there is a 3rd matrixbook out_str(matPg.GetName()); // output matrixbook name
If the matrixbook name is known, this matrixbook can be accessed by passing its name to the class constructor.
MatrixPage matPg("MBook1"); if(matPg) // if there is a matrixbook named "MBook1" matPg.SetName("MyBook1"); // rename the matrixbook
MatrixPage matPg("MBook1"); // Save matrixbook as OGM file bool bRet1 = matPg.SaveToFile("D:\\" + matPg.GetName() + ".ogm");
MatrixPage matPg("MBook1"); matPg.SetShow(PAGE_ACTIVATE); // Activate the matrixbook
MatrixPage matPg; matPg = Project.MatrixPages.Item(0); // get first matrixbook in project if( matPg ) // if there is a matrixbook matPg.Destroy(); // delete the matrixbook
// Duplicate "MBook1" window with data and style // Before calling make sure these windows exist MatrixPage matPage("MBook1"); MatrixPage matPage1 = matPage.Clone();
To show or hide image thumbnails, the method MatrixPage::ShowImageThumbnails is available.
MatrixPage mp("tangent"); mp.ShowImageThumbnails(true); // Pass true to make thumbnail visible