FXScrollWindow and resizing.

View: New views
3 Messages — Rating Filter:   Alert me  

FXScrollWindow and resizing.

by Timothy M. Schaeffer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Howdy, &c,

I'm creating an app with several widgets created dynamically and placed inside an FXScrollWindow widget.  There are other controls beneath the scroll window.  It's fine, except that when the height scroll window is bigger than its contained widgets, there is a white bar beneath them in the scroll window.  I'd like to do one of the following:

1 Quick fix: fill in the white with the default background color.
2 Better: have the scroll window get no bigger than the widgets.
3 Best: One of the widgets beneath is a list of messages, a sort of scrollable status bar.  Have this grow until the scroll window is exactly the size of its children.

I've message with the LAYOUT_FILL parms, all of which have produced disastrous results.  E.g. using LAYOUT_FILL_Y on the vertical frame containing the status-message-list widget below makes it too big and causes the scroll window to be smushed at the top of the window.

(How can I What's the best way to) do 1?  Or 2?  Can I do 3, and how?

Thanks much,

Tim S.
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

Re: FXScrollWindow and resizing.

by Jeroen van der Zijp-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 21 October 2009, Timothy Schaeffer wrote:

> Howdy, &c,
>
> I'm creating an app with several widgets created dynamically and placed inside an FXScrollWindow widget.  There are other controls beneath the scroll window.  It's fine, except that when the height scroll window is bigger than its contained widgets, there is a white bar beneath them in the scroll window.  I'd like to do one of the following:
>
> 1 Quick fix: fill in the white with the default background color.
> 2 Better: have the scroll window get no bigger than the widgets.
> 3 Best: One of the widgets beneath is a list of messages, a sort of scrollable status bar.  Have this grow until the scroll window is exactly the size of its children.
>
> I've message with the LAYOUT_FILL parms, all of which have produced disastrous results.  E.g. using LAYOUT_FILL_Y on the vertical frame containing the status-message-list widget below makes it too big and causes the scroll window to be smushed at the top of the window.
>
> (How can I What's the best way to) do 1?  Or 2?  Can I do 3, and how?
>
> Thanks much,

Well,

        1) setBackColor() should work.  This will set the area surrounding the content window
           to a different color.

        2) A bit tricky; you can "couple" the size of the content window through to the FXScrollWindow,
           (independently in X and Y) but then of course you will get into trouble when the content gets
           too large.  For example, HSCROLLING_OFF causes the FXScrollWindow to be as wide as the content
           width.

        3) Not sure what you mean here.


I want to suggest option 4:

        4) Set the content window's layout to LAYOUT_FILL_Y.  This will cause the FXScrollWindow to resize
           the content window to its viewport size if the computed (default) content size is smaller than
           the viewport of the FXScrollWindow.

The FXScrollWindow supports a few layout hints from its content window, such as LAYOUT_TOP, LAYOUT_BOTTOM,
LAYOUT_CENTER_Y and LAYOUT_FILL_Y (and similar hints for the horizontal direction).


Hope this helps,


                - Jeroen

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

Re: FXScrollWindow and resizing.

by Timothy M. Schaeffer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 

> -----Original Message-----
> From: Jeroen van der Zijp [mailto:jvdzijp@...]
> Sent: Thursday, October 22, 2009 9:30 AM
>
> On Wednesday 21 October 2009, Timothy Schaeffer wrote:
> > Howdy, &c,
> >
> > I'm creating an app with several widgets created
> dynamically and placed inside an FXScrollWindow widget.  
> There are other controls beneath the scroll window.  It's
> fine, except that when the height scroll window is bigger
> than its contained widgets, there is a white bar beneath them
> in the scroll window.  I'd like to do one of the following:
> >
> > 1 Quick fix: fill in the white with the default background color.
> > 2 Better: have the scroll window get no bigger than the widgets.
> > 3 Best: One of the widgets beneath is a list of messages, a
> sort of scrollable status bar.  Have this grow until the
> scroll window is exactly the size of its children.
> >
> > I've message with the LAYOUT_FILL parms, all of which have
> produced disastrous results.  E.g. using LAYOUT_FILL_Y on the
> vertical frame containing the status-message-list widget
> below makes it too big and causes the scroll window to be
> smushed at the top of the window.
> >
> > (How can I What's the best way to) do 1?  Or 2?  Can I do
> 3, and how?
> >
> > Thanks much,
> Well,
>
> 1) setBackColor() should work.  This will set the area
> surrounding the content window
>   to a different color.
> 2) A bit tricky; you can "couple" the size of the
> content window through to the FXScrollWindow,
>   (independently in X and Y) but then of course you
> will get into trouble when the content gets
>   too large.  For example, HSCROLLING_OFF causes the
> FXScrollWindow to be as wide as the content
>   width.
> 3) Not sure what you mean here.

> I want to suggest option 4:
> 4) Set the content window's layout to LAYOUT_FILL_Y.  
> This will cause the FXScrollWindow to resize
>   the content window to its viewport size if the
> computed (default) content size is smaller than
>   the viewport of the FXScrollWindow.
>
> The FXScrollWindow supports a few layout hints from its
> content window, such as LAYOUT_TOP, LAYOUT_BOTTOM,
> LAYOUT_CENTER_Y and LAYOUT_FILL_Y (and similar hints for the
> horizontal direction).
>
> Hope this helps, - Jeroen

Thanks for the feedback.

I tried (4), probably the best option in general, but in my case
the widgets in the ScrollWindow don't look right when stretched
vertically.  (1) works and looks fine, so I'll leave it there for
now.

Thanks,
Tim S.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users