Re: HeaderPanel not setting height of the Content widget

2013-09-24 Thread Patrick Tucker
Ahh sorry must have misread.

On Friday, September 6, 2013 8:26:10 AM UTC-4, stuckagain wrote:

 Patrick,

 No, I don't know the height of the header, and I certainly don't want to 
 set it in pixel sizes in the code either. (I even have the header change 
 height depending on what the user is doing in there).
 The question was about the content widget not being resized in a 
 HeaderPanel, not the header that one works really well.

 But the tip from Jens fixed it for me. I now enforce relative to the 
 content container and force top,bottom,left,right at 0px. This removes the 
 need for code to do size calculations and the content is resized and 
 onResize is properly called automatically when the browser window resizes.

 The only problem I have is that it is a bit a hack on the HeaderPanel, 
 possible breaking in the future. It is not easy to implement a custom 
 LayoutPanel since if you look at the implementation of HeaderPanel it is 
 depending on quite a lot of internals of the Layout classes.


 On Friday, September 6, 2013 2:17:24 PM UTC+2, Patrick Tucker wrote:

 If you have a set size for your header, you most likely should be using a 
 DockLayoutPanel.  The HeaderPanel should be used when you do not want to 
 restrict your header or footer to a particular size and allow it to be 
 whatever size it ends up being.



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.


Re: HeaderPanel not setting height of the Content widget

2013-09-06 Thread Patrick Tucker
If you have a set size for your header, you most likely should be using a 
DockLayoutPanel.  The HeaderPanel should be used when you do not want to 
restrict your header or footer to a particular size and allow it to be whatever 
size it ends up being.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.


Re: HeaderPanel not setting height of the Content widget

2013-09-06 Thread stuckagain
Patrick,

No, I don't know the height of the header, and I certainly don't want to 
set it in pixel sizes in the code either. (I even have the header change 
height depending on what the user is doing in there).
The question was about the content widget not being resized in a 
HeaderPanel, not the header that one works really well.

But the tip from Jens fixed it for me. I now enforce relative to the 
content container and force top,bottom,left,right at 0px. This removes the 
need for code to do size calculations and the content is resized and 
onResize is properly called automatically when the browser window resizes.

The only problem I have is that it is a bit a hack on the HeaderPanel, 
possible breaking in the future. It is not easy to implement a custom 
LayoutPanel since if you look at the implementation of HeaderPanel it is 
depending on quite a lot of internals of the Layout classes.


On Friday, September 6, 2013 2:17:24 PM UTC+2, Patrick Tucker wrote:

 If you have a set size for your header, you most likely should be using a 
 DockLayoutPanel.  The HeaderPanel should be used when you do not want to 
 restrict your header or footer to a particular size and allow it to be 
 whatever size it ends up being.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.


Re: HeaderPanel not setting height of the Content widget

2013-09-06 Thread Zak Linder
See this thread for some more discussion on this issue and another 
workaround method: 
https://groups.google.com/d/msg/google-web-toolkit/Fx6uZyaQxDA/zQxNUehfR1sJ

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.


Re: HeaderPanel not setting height of the Content widget

2013-08-20 Thread David
Jens,

Thanks for the tip, that is actually a nicer solution to my problem!

David


On Mon, Aug 19, 2013 at 6:11 PM, Jens jens.nehlme...@gmail.com wrote:

 But reality is a bit different, the layout panels are actively changing
 widget sizes, except the HeaderPanel.


 This is happening because HeaderPanel isn't a LayoutPanel and does not use
 one internally.

 To fully mimic the LayoutPanel behavior you would need to add
 position:absolute; top, left, right, bottom = 0; to the center container's
 child widget. This should stretch the child widget to the center
 container's size which HeaderPanel recalculates on header/footer resizes.

 -- J.

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-web-toolkit+unsubscr...@googlegroups.com.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 Visit this group at http://groups.google.com/group/google-web-toolkit.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.


Re: HeaderPanel not setting height of the Content widget

2013-08-19 Thread Thomas Broyer

On Monday, August 19, 2013 4:06:07 PM UTC+2, stuckagain wrote:

 Hi,
  
 I am trying to use the HeaderPanel to set a Header/Footer and an resizing 
 ContentPanel (which contains a CellTable).
  
 The problem is that unlike other LayoutPanel classes the vertical size is 
 not enforced on the content widget, its width is set to 100% but the height 
 is not set.
 I don't really want to set width/height to 100% either since that would 
 make it impossible to have a scrollbar.
  
 Right now I have a solution in that I override the onResize method of the 
 widget that gets inserted as the content panel. 
 But that is not really nice in a framework where I have lots of reusable 
 widgets, and I don't know which will be inserted in a HeaderPanel or not.
  
 Any reason why this Layout Panel is not enforcing the height and width in 
 pixels like other layout panels do on their children ?


There's a reason for RequiresResize to have an onResize method rather than 
relying on setSize. One of the goals (expectations? dreams?) of layout 
panels was that the layout could be done in pure CSS (including animations) 
and you'd only need to notify widgets when their size has changed (through 
onResize), something that you know when it happens because the layout is 
controlled from the outside in (it should only happen the top layout panel 
is resized, or some panels' inner layout change, or possibly when font 
sizes or zoom change; there's the case of borders and margins but you're 
supposed to know what you're doing so you could call onResize or 
forceLayout then).

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.


Re: HeaderPanel not setting height of the Content widget

2013-08-19 Thread David
Thomas,

But reality is a bit different, the layout panels are actively changing
widget sizes, except the HeaderPanel.
Additionally the forceLayout is a private method in this Layout widget, not
that it matters to me in this case.

But Ok, I have a workaround in that I set the pixel size myself. I created
a subclass of HeaderPanel that wraps the content widget in a custom panel
that does a setPixelSize on the child when onResize is triggered. It would
be nice if the HeaderPanel would have this behaviour ( or even support
animation like the other Layout Panels do).

David
On Mon, Aug 19, 2013 at 4:24 PM, Thomas Broyer t.bro...@gmail.com wrote:


 On Monday, August 19, 2013 4:06:07 PM UTC+2, stuckagain wrote:

 Hi,

 I am trying to use the HeaderPanel to set a Header/Footer and an resizing
 ContentPanel (which contains a CellTable).

 The problem is that unlike other LayoutPanel classes the vertical size is
 not enforced on the content widget, its width is set to 100% but the height
 is not set.
 I don't really want to set width/height to 100% either since that would
 make it impossible to have a scrollbar.

 Right now I have a solution in that I override the onResize method of the
 widget that gets inserted as the content panel.
 But that is not really nice in a framework where I have lots of reusable
 widgets, and I don't know which will be inserted in a HeaderPanel or not.

 Any reason why this Layout Panel is not enforcing the height and width in
 pixels like other layout panels do on their children ?


 There's a reason for RequiresResize to have an onResize method rather than
 relying on setSize. One of the goals (expectations? dreams?) of layout
 panels was that the layout could be done in pure CSS (including animations)
 and you'd only need to notify widgets when their size has changed (through
 onResize), something that you know when it happens because the layout is
 controlled from the outside in (it should only happen the top layout panel
 is resized, or some panels' inner layout change, or possibly when font
 sizes or zoom change; there's the case of borders and margins but you're
 supposed to know what you're doing so you could call onResize or
 forceLayout then).

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-web-toolkit+unsubscr...@googlegroups.com.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 Visit this group at http://groups.google.com/group/google-web-toolkit.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.


Re: HeaderPanel not setting height of the Content widget

2013-08-19 Thread Jens


 But reality is a bit different, the layout panels are actively changing 
 widget sizes, except the HeaderPanel.


This is happening because HeaderPanel isn't a LayoutPanel and does not use 
one internally.

To fully mimic the LayoutPanel behavior you would need to add 
position:absolute; top, left, right, bottom = 0; to the center container's 
child widget. This should stretch the child widget to the center 
container's size which HeaderPanel recalculates on header/footer resizes. 

-- J.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.