Extend Text Editor to Draw Shapes
Learn to enhance a text editor by adding drawing capabilities such as shapes and text boxes. Define attributes in a TextEditor class, create graphic and pen objects, and write event handlers for various shape menu items. Test the program to ensure all shape menu items function correctly
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Extend Text Editor to Draw shapes
Add Shape to text editor main menu then add to shape menu the items in the following figure and add text box to Draw text item
Define the following attributes in class TextEditor
Create graphic and pen objects in the constructor
Write event handler for items inn shape menu: rectangle, ellipse, line and erase
Write event handler for items draw text, return to text and actor then write event handler to Document Mouse Down event
In Document Mouse Up event handler write the following code
In Document Mouse Down event handler write the following code
Run the program and test all shape menu items