diff --git a/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java b/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java index 20b12d8881..50fa38db93 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java @@ -21,6 +21,7 @@ import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; +import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WLayout; import com.fr.general.FRScreen; @@ -685,7 +686,10 @@ public class XWFitLayout extends XLayoutContainer { if (isRefreshing) { return; } - LayoutUtils.layoutContainer(this); + //当前的body布局为绝对布局的时候不要doLayout + if (toData().getBodyLayoutType() != WBodyLayoutType.ABSOLUTE){ + LayoutUtils.layoutContainer(this); + } WFitLayout layout = this.toData(); //自适应布局新增控件后,其他控件位置也会变 XWidgetCreator creator = (XWidgetCreator) e.getChild(); @@ -834,7 +838,7 @@ public class XWFitLayout extends XLayoutContainer { * 处理自适应布局的directions * @param xcreator 组件 */ - private void dealDirections(XCreator xcreator, boolean isInit) { + public void dealDirections(XCreator xcreator, boolean isInit) { if (xcreator == null) { return; } diff --git a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java index bdaad048aa..6b29a172e5 100644 --- a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java +++ b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java @@ -101,13 +101,13 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr xfl.getLayoutAdapter().removeBean(xwAbsoluteLayout, xwAbsoluteLayout.getWidth(), xwAbsoluteLayout.getHeight()); xfl.remove(xwAbsoluteLayout); - xfl.toData().setLayoutType(WBodyLayoutType.FIT); for (Component comp : components) { XCreator xCreator = (XCreator)comp; if (xCreator.shouldScaleCreator()){ XLayoutContainer parentPanel = xCreator.initCreatorWrapper(xCreator.getHeight()); xfl.add(parentPanel, xCreator.toData().getWidgetName()); + parentPanel.updateChildBound(xfl.getActualMinHeight()); continue; } xfl.add(xCreator); @@ -116,9 +116,6 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr moveComponents2FitLayout(xfl); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); formDesigner.getSelectionModel().setSelectedCreator(xfl); - xfl.convert(); - LayoutUtils.layoutContainer(xfl); - xfl.adjustCreatorsWhileSlide(xfl.getContainerPercent() - 1.0); for (int i = 0; i < components.length; i++) { Component comp = xfl.getComponent(i); @@ -133,6 +130,7 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr xfl.toData().setCompInterval(compInterval); xfl.addCompInterval(xfl.getAcualInterval()); } + xfl.toData().setLayoutType(WBodyLayoutType.FIT); return true; } } @@ -212,6 +210,7 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr ((XWCardMainBorderLayout)components[i]).recalculateChildWidth(components[i].getWidth()); ((XWCardMainBorderLayout)components[i]).recalculateChildHeight(components[i].getHeight()); } + xwFitLayout.dealDirections((XCreator)components[i], false); } xwFitLayout.updateBoundsWidget(); }