Section doesn't resize around FigureCanvas with TextFlows properly [message #444412] |
Thu, 16 February 2006 03:12 |
Nathan Snapp Messages: 14 Registered: July 2009 |
Junior Member |
|
|
I have an eclipse View very similar to the Help->Search View. In fact
I've used mostly the same code. The main difference is that each
collapsable Section in the results, instead of using an inner composite
with a TableWrapLayout and a FormText child, I have an inner composite
with a FillLayout and a FigureCanvas child with multiple child Figures
(Rectangular shapes) that contain TextFlows.
From the View to the part that is having trouble it looks like
-MyView
--ScrolledForm (with a custom layout that works :)
---ManagedForm
There are some other things inside the ManagedForm like the search box,
"Go" button, and search scope. Below that point, here is a diagram of the
child controls (I abbreviated some of the "required" children and didn't
add boxes for clarity):
|-ScrolledForm--------------------------------|
| |
| |-Section---------------------------------| |
| | | |
| | |-Composite (FillLayout)--------------| | |
| | | | | |
| | | |-FigureCanvas--------------------| | | |
| | | | -Root Figure for Canvas | | | |
| | | | with ToolbarLayout | | | |
| | | | | | | |
| | | | |-Figure w/ FlowPage---------| | | | |
| | | | | | | | | |
| | | | | |-TextFlow---------------| | | | | |
| | | | | |"My title text" | | | | | |
| | | | | |------------------------| | | | | |
| | | | | | | | | |
| | | | | |-TextFlow---------------| | | | | |
| | | | | |"My body text" | | | | | |
| | | | | |------------------------| | | | | |
| | | | | | | | | |
| | | | |----------------------------| | | | |
| | | | | | | |
| | | | (Possibly more Figures | | | |
| | | | just like the above...) | | | |
| | | | | | | |
| | | |---------------------------------| | | |
| | | | | |
| | |-------------------------------------| | |
| | | |
| |-----------------------------------------| |
| |
| (Possibly more Sections |
| just like the above...) |
| |
|---------------------------------------------|
The FlowPage above defaults to a FlowPageLayout and the two TextFlows each
default to a ParagraphTextLayout.
The problem is that the Section doesn't layout the FigureCanvases
properly, returning a fixed height size from it's computeSize() function
when the layout is performed. Each TextFlow can have multiple lines which
wrap, but the returned height is about the height of two single-line
TextFlows, so it seems that I may have the flows in the Figure canvas set
up wrong.
To test something out, I added a FocusListener to the Figures in each
section so that when I click on a figure the reflow() method is called on
the ManagedForm and the ScrolledForm that is the parent of the Sections.
For some reason, when reflow() gets called once or twice the Section will
resize correctly around the FigureCanvas. Yes, sometimes it happens the
first time reflow() is called, and other times it takes a couple clicks on
the figure to get reflow() to get called a few times. I notice in the
FillLayout that a different (and accurate) height is being returned by
FigureCanvas.computeSize(...).
Anybody have any idea what is going on? I have looked at the code but I
just can't figure out what needs to be changed to make it work...
|
|
|
Powered by
FUDForum. Page generated in 0.03230 seconds