|
Re: Draw2d FigureCanvas scrollbar visibility issue [message #196509 is a reply to message #196491] |
Thu, 22 September 2005 14:59 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
The figure inside the viewport must return its preferredSize via its layout
manager. It sounds like your viewports contents doesn't have a layout.
"Brad Reynolds" <bradleyjames@gmail.com> wrote in message
news:dgsppr$4b6$1@news.eclipse.org...
>I have a component I wrote using draw2d that I'm having issues with getting
>the scrollbar to appear. The scrollbars on my FigureCanvas are set to
>always display so space for the scrollbar is allocated and visible but when
>I should be able to scroll the scrollbar there is nothing to scroll. I'm
>having a hard time coming up with a snippet that displays the behavior and
>was hoping that I might be able to get some suggestions here as to how to
>debug this or what to try. If I resize my FigureCanvas a few times (having
>quite figured out what is the trigger here) the scrollbar will appear and
>all is well. I've stepped through the code into
>ScrollPaneSolver.solve(...) and found that the preferred size of the
>viewport is being returned as height=2 width=2. But somehow after a few
>resizes this gets recalculated. If anyone has any ideas or suggestions
>feel free to shoot them my way. I'll keep trying to dig and come up with a
>snippet that shows the issue.
>
> -Brad
|
|
|
|
Re: Draw2d FigureCanvas scrollbar visibility issue [message #196562 is a reply to message #196555] |
Fri, 23 September 2005 03:39 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
If a figure doesn't have a layout, then its preferred size is its current
size.
Viewport stretches out its figure to fill up the avialable space. So, if you
stretch the figure, that becomes its new preferred size and when the canvas
gets smaller it would display scrollbars.
Anyway, you should just step into the FigureCanvas method that determines
scrollbar visibility, and find out who is lying about preferred size.
"Brad Reynolds" <bradleyjames@gmail.com> wrote in message
news:4333518B.6080305@gmail.com...
> Randy, thank you for the response. I looked through my hierarchy and they
> all seem to have layouts. If there wasn't a layout I would have assumed
> that it would have exhibited the issue at all times. The part that
> confuses me is that after a few resizes the scrollbars appear and behave
> as expected. It seems like something is getting cached as the preferred
> size but after the resizes it gets flushed. If I didn't have a layout
> manager would it remedy itself with resizes?
>
> Randy Hudson wrote:
>> The figure inside the viewport must return its preferredSize via its
>> layout manager. It sounds like your viewports contents doesn't have a
>> layout.
>>
>> "Brad Reynolds" <bradleyjames@gmail.com> wrote in message
>> news:dgsppr$4b6$1@news.eclipse.org...
>>
>>>I have a component I wrote using draw2d that I'm having issues with
>>>getting the scrollbar to appear. The scrollbars on my FigureCanvas are
>>>set to always display so space for the scrollbar is allocated and visible
>>>but when I should be able to scroll the scrollbar there is nothing to
>>>scroll. I'm having a hard time coming up with a snippet that displays
>>>the behavior and was hoping that I might be able to get some suggestions
>>>here as to how to debug this or what to try. If I resize my FigureCanvas
>>>a few times (having quite figured out what is the trigger here) the
>>>scrollbar will appear and all is well. I've stepped through the code
>>>into ScrollPaneSolver.solve(...) and found that the preferred size of the
>>>viewport is being returned as height=2 width=2. But somehow after a few
>>>resizes this gets recalculated. If anyone has any ideas or suggestions
>>>feel free to shoot them my way. I'll keep trying to dig and come up with
>>>a snippet that shows the issue.
>>>
>>>-Brad
>>
>>
|
|
|
|
Powered by
FUDForum. Page generated in 0.02936 seconds