I'm having a single Parent Panel, which has 2 child panels. One has content dynamically created, while the other is fixed height and width. The Parent panel is using border layout, with center and east regions defined. I'm trying to get autoscroll to trigger on the parent panel when there is an overflow on on the center region panel. I've set the autoscroll option to true to the parent panel, but everytime there is an overflow on the center panel, it just gets cuts off. When I'm adding an overflow to center region panel, i get a scrollbar for that panel alone. I don't need that, but rather I want it on the entire Parent Panel. Let me know if anyone has any suggestions..
This issue is usually a result of over-nesting Panels, and/or one or more Panels in the layout not having a layout config specified. Some layout configuration code would help.
Here is my view from what I understood.. You have two panels that go into the center region of the border layout.. and you need a scroll bar for the center when one of the panels overflow.
Here is how I worked out a similar situation. In my center region, I have a panel with autoScroll set to true. I have two panels added to this panel. The first is fixed height (its a grid) and second is panel (displayed below the grid) is a large form panel. Due to the parent panel having a autoScroll property set, you will have a scroll bar for the entire panel and not the second panel alone!
I don't think you can use fit layout. In fit layout, the panel will take up the whole area of its container and you will not be able to add another panel (the second panel will be hidden I suppose!).
Note: I am using the default layout (Container Layout) I do not specify any layout in my parent panel.
Related
I have a Vaadin 8 application with several views.
public class ViewName extends Panel implements View {
There is a VerticalLayout as main layout in the panel.
public ViewName() {
setSizeFull();
VerticalLayout mainLayout = new VerticalLayout();
setContent(mainLayout);
Then I have many different layouts (HorizontalLayout, GridLayout) or Components such as Label being added as components to the mainLayout. For the HorizontalLayouts I often do the following to use the full width of the screen:
hLayout.setWidth("100%");
I have a lot of icons, grids etc. Everything is OK as long as I don't resize the window.
When I resize the window to a small size I get a mess (icons, text etc. on top of each other) and no horizontal scrollbar. (However, the grids get horizontal scrollbars.) I have tried many things to fix this. If I add
mainLayout.setSizeFull();
or
mainLayout.setWidth("100%");
I have a mess on the big screen already. I also tried the CSS for the mainLayout as described here. I get several scrollbars but none for the window itself!
The only component that resizes correctly is a Label added to the mainLayout, e.g.:
Label title = new Label("Some text",ContentMode.HTML);
title.setWidth(100, Unit.PERCENTAGE);
mainLayout.addComponent(title);
mainLayout.setComponentAlignment(title, Alignment.MIDDLE_CENTER);
I also noticed that anything in a GridLayout seems to stay in place after resizing but is not vissible since I have no scrollbar. However, icons in a HorizontalLayout get on top of each other.
What is wrong? Please, I need a general instruction on which layout I should use as main layout for my view panel, how to size the components and how to get ONE horizontal scrollbar for the main window if necessary.
The problem is that you are setting the width of your mainLayout to the width of your view. This means, that your mainLayouts width will never be bigger than your views width. So no scroll bar will appear.
According to the information you posted, changing your mainLayouts width to undefined should fix the problem.
mainLayout.setWidth("-1px");
Is there any way to make a widget's config and move buttons be placed at the top of the widget itself.
As it is one has to hover over a widget in order to see which one of the items in the widget zone it belongs to. This is impossible though when the content of the widget is not in the same screen space (I had to zoom out in the browser in order to get the below screenshot) unless you zoom out and then zoom back in.
In this image, there are 3 seperate widgets (red, white and green respectively) in a single widget zone.
Also, when the mouse leaves the widget the widget config/move buttons are no longer visible.
One solution is to right-click on the widget and then scroll up to the config wheel but this is not something I want to tell my editors they have to do.
Has anyone else come across this problem and if so, how did they solve it?
This can happen when you have CSS conflicts. You can use Chrome Inspector, Firebug, or IE developer tool to investigate and see if anthing is 'overlapping' those buttons (often a floating div is overlapping the buttons and intercepting the 'click')
Then once you figure out a css class to make it work, just add it to your style sheet with ".EditMode " before it, this is a special class that is on the body when in page editor.
Example:
.EditMode .MyFloatingDivThatsCoveringTheWidgets {
z-index: 0;
}
I have a QTreeView widget placed inside a QDockWidget:
I want to set the properties of the QTreeView, that it automatically fills the whole available client drawing area (similar as WinForms DockFill property).
How can this be achieved with the QT-Designer?
Note: I've been playing around with the QTreeViews sizePolicy properties. If these are set to Expanding (as is the default) the accepted answer works out out of the box.
In Qt Designer, right-click the dock-widget, and then select Lay out -> Lay Out Vertically from the menu. Or you can just click on the dock-widget to select it, and then use the equivalent layout toolbar buttons.
If you want to maximise the space taken up by the tree-view, select the first child widget of the dock widget (it will probably be shown as dockWidgetContents in the Object Inspector pane). Then scroll down to the bottom of the Property Editor, and reset all the margins to zero.
There is a panel with anchor layout used for vertical sizing.
Inside the panel there is a horizontal buttongroup.
Is there a way to set fixed width or better make the width depend on buttons?
In my case it is always stretched to the size of the window.
There is the same problem with the grid inside the panel.
Thank you.
Making the width dependent on the buttons is handled by the layout itself. If you have an hbox layout, each of the items inside the container (say, buttons) will automatically occupy the width.
I have a dojo TabContainer that has a BorderContainer child, with a left region and a center region ContentPanes.
-TabContainer
-BorderContainer
-ContentPane (left)
-dojox.layout.ContentPane (center)
I have it setup so that the left ContentPane is collapsible (by replacing it with a slimmer ContentPane) which works fine. However, the idea of this functionality is to make the center (dojox.layout.ContentPane) region wider but when the left pane is collapsed to the slim one, the center region stays the same width.
Now I know I can call refresh() on the center ContentPane but this also refreshes the content as the center ContentPane is retrieved via href - which I don't what as it loses changes to form data.
So how do I get the center ContentPane to refresh it's layout without manually figuring out the proper width and calling resize()?
Or could you use dojox.layout.ExpandoPane. It's a ContentPane that has a 'click to minimise' ability.
how are you replacing the left pane? Are you using addChild/removeChild methods? How about just changing the widthof the left pane rather than replacing it?