In Figure 3 in topic 1.3.1 we show you an OpenDoc document with text, 2D Graphics and a playing video. The figure is show again in Figure 149. The steps to create this document are similar to the steps for the Financial Portfolio explained in "The Financial Portfolio Example" in topic 4.5.1.
Figure 149. An OpenDoc Document with Text, Graphics and Video ComponentsThe following are the steps for creating this example:
1. Drag the Page Layout template from the OpenDoc Templates folder to, for example, the OpenDoc Shell Plug-Ins folder. (You can use the Desktop or any folder to drag the Page Layout object.)
2. We renamed the object to Redbook OpenDoc Sample. Use any name you wish to use.
3. Double-click on the object to open it.
4. You will have the Page Layout open and ready as a Root Part. To make our work easier we clicked on the Grid icon to have the grid on the canvas.
5. Drag the Text part from the OpenDoc Templates folder to the canvas.
6. Resize the Text Part by clicking on the part to activate it. Move the mouse to the hashed border until the mouse changes to the mouse pointer with a star at the point. You can now select the border by clicking once on it. The border will change to a dashed border with black blocks on the corners. Select a black block and drag the Text Part until it fills the page horizontally from the left to the right margin and align it with the top margin. You don't have to worry about the bottom part as it will expand the Text Part as soon as we load the text into the Test Part.
7. You can now either import the text or do the layout of the graphics. We decided to import the text first as it will be easier to decide where the graphics needs to go.
8. You can drag a text file onto the Text Part to import the text, load it from a text file, or use cut and paste. The Text Part will expand at the bottom to fit in all of the text.
9. Drag a 2D Graphics Part from the OpenDoc Templates folder. Drop this part on the document where you want it.
10. Now resize and position the Graphics Part using the same method as you used with the Text Part. To move the whole 2D Graphics Part you can click with the second mouse button in the part when it is enabled to be resized, and move it to the new position. If the 2D Graphics Part is within the Text Part, then you can only resize and move it within the boundaries of the Text Part.
11. Select the 2D Graphics Part. You will have a tool bar at the bottom left corner of the 2D Graphics Part. Select the type of figure that you want to draw and follow the instructions that appear in the status window at the bottom of the Layout Page window. The drawing functions are easy to use. To change the color of the lines or the background, the style of the background, width of the lines, or shadows, select the Graphics object and press the second mouse button for the pop-up menu. To include a bitmap in the 2D Graphics Part drag, the bitmap file onto the part.
12. To include the Video Part, drag the Container part from the OpenDoc Templates folder to your document. Resize and position the part and then drag the AVI Video.AVI Part from the Multimedia Templates folder into the Container Part. You can now drag the .AVI file into the video Part.
13. To play the video, click with the second mouse button inside the Video Part and select Play from the pop-up menu.
14. To save the document you can either close the document or select Save Document from the Document main menu.
You can resize or position any parts after you have worked with them. If you imported a bitmap into the 2D Graphics Part or the Image Part you can resize the frame to the size that you want the bitmap to be displayed. If you reposition or resize any parts that are inside a Text Part, the text inside the Text Part will reflow around the parts that are inside the Text Part.