pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: Adding font properties to a TextArea
Date Tue, 01 Jun 2010 23:16:22 GMT
This may not actually be that tough. TextArea currently provides a getCharacterBounds() method
- you can determine the bounding area of the range you want to highlight by calling this method
for the first and last character in the range. Note that the highlight shape may not always
be a rectangle - when text wraps, your highlighted area may span multiple lines. However,
handling this condition is also not terribly difficult.


On Jun 1, 2010, at 4:27 PM, Noel Grandin wrote:

> Hi Rodney
> 
> I think you're better off waiting until we implement RichTextArea
> support in the next version of Pivot, then you will be able to set
> styles on sections of the text.
> Calculating the location and size of the text is quite a complex job,
> not something you can easily do from outside the component.
> 
> If you want this really desperately, you could download the source and
> patch it with the necessary support yourself.
> Have a look at
> https://issues.apache.org/jira/browse/PIVOT-31
> 
> Regards, Noel
> 
> On Tue, Jun 1, 2010 at 17:29, JohnRodey <timothyddaly@yahoo.com> wrote:
>> 
>> Hey Greg,  I'm starting to look into adding this functionality again.  I am
>> planning on attempting to add a decorator to my text area that will
>> highlight text occurrances of words that were entered in a "find" text input
>> box.
>> 
>> Do you have any suggestions were to start?  From the examples provided, it
>> looks like they all decorate a component, but don't change depending on the
>> components value.  I can get the text from the text area and see if the
>> entered string matches anything, but how do I correlate that to how to draw
>> the highlight box?  The text area can be scrollable and resizable too, which
>> I assume won't be a problem, I just wanted to mention that.
>> 
>> Thanks
>> --
>> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Adding-font-properties-to-a-TextArea-tp444141p861890.html
>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>> 


Mime
View raw message