Joe Strout wrote:
We're evaluating FTC for use in a something like a drawing application -- picture little text objects scattered around the page, and when you click on one, it becomes editable; when you click away or tab out, then it becomes just drawn text on the page again. Ultimately we need to be able to export to PDF (using Asher Dunn's classes), too. Is this a square-peg-in-round-hole situation for FTC, or is it a comfy fit? Specifically:
FYI, I am intending in the future to directly support Asher Dunn's PDF classes. I already implemented the infrastructure code that walks through the FTC's data structures. All that needs to be done is add the glue code to translates the FTC data into Asher's method calls.
1. Can FTC be used in some way without a canvas, just telling it to draw some content within given rectangular bounds? Or, telling me where the line breaks are and letting me iterate over style runs and embedded objects, so I can manually draw or export them?
The FTC is canvas based, so the short answer is no. For rendering when the content is not being edited, you could move the FTC offscreen and just grab the internal data structures and render them yourself. You would have to provide glue code to render the lines in your custom environment, but that would be pretty straight forward. To fit a particular rectangle you would adjust the control's dimensions and possibly use the page mode (by setting the page size to get you page breaks) to tell you how much text to display. You could also use the line heights to indicate when to stop rendering lines.
2. Can I make an editable FTC area that's just a rectangular area of a canvas, rather than the whole thing? (I generally try to avoid layer canvases on top of each other, but I guess we could try that if necessary.)
No, it is not designed to do that.
3. Can I link two editable areas together, so that content flows from one to another? (Picture a multi-column newsletter layout, where text that flows off the end of column 1 goes to the top of column 2.)
It is not designed to do that, but you do have access to the source code, which makes it possible. The question would be if it is feasible? Without actually trying it I couldn't tell you how much work it will be. My guess is it would be a fair amount of work.
4. How hard would it be to make an editable area that grows as needed to fit the text? (For this, picture a drawing program like OmniGraffle -- as you add more text, the text box expands downward to fit.)
I am assuming you are suggesting to have a display area that grows without the use of scrollbars and you want it to resize itself as the content grows. I would say this is possible, but I have not tried it. This is a matter of adjusting the canvas size to fit the composed sized after you request an update which means you would override a couple of methods. That shouldn't be to hard to do. FTC Website: http://www.truenorthsoftware.com/FormattedTextControl/FormattedTextControl.html Set List Options (digest and vacation modes): www.freelists.org/list/ftcdev List Archive: www.freelists.org/archives/ftcdev Unsubscribe: Send email to ftcdev-request@xxxxxxxxxxxxx with "unsubscribe" in the subject field.