Article Preview
Buy Now
FEATURE
Postmortem: FTC
Building the Formatted Text Control
Issue: 7.2 (January/February 2009)
Author: Brendan Murphy
Author Bio: Brendan is the founder of True North Software. He worked for Motorola for many years and has extensive experience working on very large projects. He is a Sci-Fi fan and is still mourning the canceling of Stargate! True North Software can be found at
Article Description: No description available.
Article Length (in bytes): 25,239
Starting Page Number: 13
Article Number: 7208
Related Web Link(s):
http://www.TrueNorthSoftware.com
http://www.TrueNorthSoftware.com/FormattedTextControl/FormattedTextControl.html
http://www.rbdeveloper.com/browse/5.3/5311/
Excerpt of article text...
The Formatted Text Control (FTC) is a WYSIWYG word processor control. The FTC was designed from the ground up to be a word processor as opposed to a text editor with other capabilities added to it like picture support. This is important distinction because trying to add word processor capabilities to something that starts out as a plain text editor is asking for trouble. To add these capabilities down the road I would have to constantly rewrite the core code. So I decided to go for a complete solution from the beginning because I knew it would be a lot easier create a plain text editor from something that exceeded the requirements than trying to build a word processor upon a text editor. The FTC is word processor that can be reconfigured to act like an EditField and everything in between. The FTC supports three different modes of display; page, normal, and edit. Page mode is like what you see in a true WYSIWYG editor like Apple Pages. Normal mode is like Microsoft's Word normal mode. Edit mode is like an EditField on steroids. It also has RTF support, paragraph and character styles, picture and custom object support, undo management, and many customization options for adapting it to your application. The FTC is a professional solution for adding word processing to your REALbasic (RB) application. A college professor once said to me, "Beg, borrow, or steal before you invent brand new" and over the years I have found this advice to be true and it has saved me a lot of time and money. So in searching for a solution I very carefully examined my alternatives and it turned out that inventing brand new was my only option. None of the existing solutions satisfied my requirements for implementing a full featured word processor suitable for rendering reports as I needed. I knew creating a word processor for RB would be a taunting task, but I knew I could do it. In this article I want to share my experiences in creating the FTC so that you may apply them to your own projects.
When I first thought of creating the FTC, I had the choice of creating it as a plugin or straight RB code. Going with the plugin route may have produced faster code, but at the expense of rewriting the control for each platform. Having it written in RB meant I only wrote it once for all platforms which translates into huge saving of time. One of the first questions I had to answer was, "Is REALbasic was fast enough?" Could it generate object code together with the RB framework that could actually be fast enough in execution speed comparable to any other word processor?
...End of Excerpt. Please purchase the magazine to read the full article.