[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: inline/block

> Finally, sounds like another person to give us feedback on our Text
> example.
>
> "David Michonneau" <david_michonneau@xxxxxxxxxxx> wrote in message
> news:cnfuio$4ck$1@xxxxxxxxxxxxxxxxxx
>> Hi,
>>
>> I am trying to implement a layout manager that can understand the
>> inline/block css attributes. It is very similar to a flowlayout except
> that
>> the block element take the whole space on their line, and inline elements
>> can be on the same line with other inline elements. I'm having a problem
>> with the text:
>
> Have you looked at the draw2d.text package?  Specifically, FlowPage,
> InlineFlow, and TextFlow.

I did, I am actually using them.

>
>> - how can I have inline text continue on the next line like in html?
> Figures
>> have to be inside rectangle, but in that case, that's not a rectangle
>> anymore, but two rectangles.
>
> That's fine.  There is still a rectangular bounds, but containsPoint(x,y)
> is
> implemented to hit-test the fragments on each line.
>

Can you explain in further details? What layout should I use, the
paragraphlayout wraps, but not the way I'm interested in. Here is an
example:

"Element 1 Element 1 Element 1 Element 1 Element 1 Element 1 Element 1
Element 1 Element 1 Element 1 Element 1" "Element 2"

If you make your email client window small enough, element 1 will be on two
lines, element 2 will start right after on the same line. How to achieve the
same layout for Element1 and 2 in GEF?

>> - how can I have the flowpage automatically resize the text figure so
>> that
>> there is no empty space in my text figure? If I set the width hint to -1
> it
>
> I'm not sure what you mean.  You mean if a line does not extend to the
> right
> margin, you want it stretched there anyway?  I would imagine this is going
> to be useful when hit-testing and placing the caret.
>

Ok so what happens is that the main layout gives a widthhint to the flowpage
figure. Then the flowpage figure will use all of it, even it could use a
shorter width because the text is shorter than this width. So my text figure
will take more space than the text itself.

Now if I give a widthhint of -1 it will never wrap, because it doesn't know
when to wrap, since there is no hint to tell.

>> works, but then it doesn't know about the maximum size so it doesn't wrap
>> any more...
>>
>> Thanks,
>>
>> David
>>
>>
>
>