pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Noel Grandin <noelgran...@gmail.com>
Subject Re: [RFC] adding components to TextArea
Date Mon, 07 Jun 2010 08:44:43 GMT

The new child components are laid out using the existing *NodeView inner
classes in TextAreaSkin.
Currently, I set the size of the child components during the layout()
operation, and I set their position during the paint() operation.
I have to do it this way because TextAreaSkin only calculates position
information during paint().

The tricky part is that because the child components are part of the
normal Component hierarchy, their position is defined with reference to
the TextArea object, not with reference to the surrounding NodeView objects.
So I have to pass extra information down the paint() call chain in order
to set their position correctly.

I see that we're releasing a 1.5.1, so I'll hold off on checking
anything in until we've released 1.5.1

Regards, Noel.

Greg Brown wrote:
> I have not looked at the code in any detail, but I had assumed that the sub-components
would be arranged in TextAreaSkin#layout(), as is done with other containers. Is that feasible?
> On Jun 4, 2010, at 10:54 AM, Noel Grandin wrote:
>> Hi
>> This is my first attempt at the part of PIVOT-31 related to inserting Component's
into TextArea (soon to be RichTextArea).
>> It seems to be mostly working - I can add components, they follow the layout properly,
and the components can receive mouse events.
>> I'm asking for comments because there are 2 design decisions I'm not sure about
>> (1) in TextAreaSkin I'm passing x and y parameters down the paint() method chain,
because a Component inside a TextArea lives outside the way other nodes are painted.
>> (2) I've changed the listeners quite a lot in the wtk.text package to better reflect
the difference between events fired for text mutation, and events fired for node mutation.
>> Regards, Noel Grandin
>> <patch1.txt>

View raw message