Maple 2016 improves on the programmatic content generation tools introduced in Maple 2015. DocumentTools:-InsertContent allows the insertion into a worksheet a block of worksheet content, called a task. With a new option, you can programatically replace a task with new content:
replaceid: replace previously inserted worksheet content
In this example we create an application that constructs new user interface elements on the fly. That is, we start with a plot and a table. On each click of the plot, we tear down the whole interface and rebuild it as a plot and a bigger table. This allows us to redefine the user interface as needed.
Step 1: Execute this Code Edit region
Step 2: Execute the following command, and then click on the plot to add points to the table
click on the plot to add points to the table below
The definition of the procedure in the Code Edit region is given below. The flow is:
PlotAndFunctionTabletanx,cotx; — calls ModuleApply, which generates the worksheet XML, and injects it into the current document via DocumentTools:-InsertContent.
Click() — when a user clicks on the plot, the Click() method is called. This generates new worksheet XML and replaces the old interface via a call to DocumentTools:-InsertContent, giving it the replaceid option with the name of any one of the components present in the original task.
Download Help Document