maxChars would not work right. We allow users the ability to choose different fonts and sizes, along with weight (bold) and italics. Setting maxChars would be overly complicated.
We could use TextLineMetrics libraries (these are wonderful!) to measure the width and height of lines and always calculate when we are nearing the end. That was my first idea of a solution - first, watch until you know that you will hit the last available row. Then, watch the width of that line and make sure it does not go past the end and create a new row. The idea is to intercept key presses and stop them if it will create a new row. Alternatively, you could create a hidden text box of the same size and put the user's input in there first - if it causes scrolling, then deny the key press. Of course, changing size or font still breaks the box (darn!). Third option: actually allow scrolling but give the user a notice that they have two much text. It's a little more out of the box, but perhaps the simplest and cleanest solution. If you guys have tried Mixbook, let me know what you think of this option! I'd be glad for any help. --- In [email protected], "Willy Ci" <[EMAIL PROTECTED]> wrote: > > can you use maxChars? > > > On 8/5/07, landrew65 <[EMAIL PROTECTED]> wrote: > > > > I am working on improving the text editing at Mixbook > > (http://www.mixbook.com), and we're trying to prevent the text box > > from "scrolling". I am not talking about scroll bars - those are easy > > to disable. What I want is to make it so that the user cannot keep > > typing at the end of the text box - so the VScrollPosition can never > > go past 0. Is there a simple way to do this? Is there a component > > that supports this out of the box? Please let me know your ideas. > > Thanks! > > > > Andrew @ Mixbook > > > > > > > > > > -- > Willy > > ---------------------------------------------------------------------- > maybe today is a good day to write some code, > hold on, late me take a nap first ... Zzzz > ---------------------------------------------------------------------- >
