TextFlow doesn't return correct height from getPreferredSize() [message #210319] |
Fri, 24 February 2006 16:14  |
Eclipse User |
|
|
|
I have a custom figure with a FlowPage contianing 2 TextFlows with
different fonts. For some reason the TextFlows layout correctly width-wise
and wrap if they are supposed to, but when my custom figure returns the
sum of the height of the TextFlows called by getPreferredSize(-1,-1) it
gets the size as if the TextFlows were on one line. I notice that this is
because the Figure.bounds variable of the TextFlows are already set. If I
repaint the figure (My canvas is in a ScrolledForm that gets reflow()'ed)
the TextFlow's bounds gets set correctly.
Any idea why this might be happening. I understand that InlineFlows get
laid out differently than most figures.
TIA,
Nate
|
|
|
Re: TextFlow doesn't return correct height from getPreferredSize() [message #210337 is a reply to message #210319] |
Sat, 25 February 2006 11:38  |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Any time you call getPreferredSize, the current state of the figure is not
important. You are asking the figure for its size with no width (or height)
constraint. The result is that everything will be on 1 line. If you want the
preferred size with wrapping, tell it where to wrap with wHint.
"Nathan Snapp" <nathan.snapp@altiris.com> wrote in message
news:0ec65e0f1066fe6e24a74776eff50688$1@www.eclipse.org...
>I have a custom figure with a FlowPage contianing 2 TextFlows with
>different fonts. For some reason the TextFlows layout correctly width-wise
>and wrap if they are supposed to, but when my custom figure returns the sum
>of the height of the TextFlows called by getPreferredSize(-1,-1) it gets
>the size as if the TextFlows were on one line. I notice that this is
>because the Figure.bounds variable of the TextFlows are already set. If I
>repaint the figure (My canvas is in a ScrolledForm that gets reflow()'ed)
>the TextFlow's bounds gets set correctly.
>
> Any idea why this might be happening. I understand that InlineFlows get
> laid out differently than most figures.
>
> TIA,
> Nate
>
|
|
|
Powered by
FUDForum. Page generated in 0.03187 seconds