FormattedText in Memory

  • From: Jim Pitchford <jim@xxxxxxxxxxxxxxxx>
  • To: "ftcdev@xxxxxxxxxxxxx" <ftcdev@xxxxxxxxxxxxx>
  • Date: Thu, 13 Jun 2013 11:33:45 -0500

I'm feeling a bit thwarted in trying to do something that maybe FTC wasn't 
designed to do.

My app currently uses TextAreas to allow editing of text on screen. My app 
allows viewing and editing of events on screen - each event will contain a 
title, a description and any number of notes, each of which is edited within a 
self sizing textArea. There maybe 100's of events available to view at anyone 
time.

By using TextArea I am also able to use the graphics classes to get 
g.stringHeight to be able to calculate the desired sizes and positioning of the 
textAreas - both for presentation on-screen, and for scaled presentation for 
printing. It is close to a WYSIWYG display.

I was hoping to be able to drop in a FormattedText class instead of textArea to 
be able to do similar, by using the getDoc.getTotalPageLength, but I am finding 
a key limitation, that is I don't seem to be able to instantiate and manipulate 
the class in memory.

It seems that FTC requires itself to be placed on a Window or ContainerControl 
somewhere so that the Open event will trigger to initialise itself, and 
establish the correct linkages to the associated FTDocument. It doesn't seem 
possible to initialise the FTC in memory only (as that doesn't trigger an Open 
event).

Thus, in its current format, I think I would have to create a new FTC instance 
on an, albeit hidden, window - or multiple windows(potentially thousands of 
them for larger documents). That would seem to create an unnecessarily large 
management overhead.

I've tried FTProxy, but that has the same requirement of being placed on a 
Window/ContainerControl. I've also tried creating the FTDocument and placing in 
FTC directly, but many of the methods required to initialise (equivalent to the 
Open event) are protected.

Am I missing a trick somewhere?

Jim







FTC Website: http://www.bkeeney.com/products/formatted-text-control
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.


Other related posts: