|
|
@ -191,6 +191,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
this.switchAction = switchAction; |
|
|
|
this.switchAction = switchAction; |
|
|
|
topXCreators=new TopXCreators(this); |
|
|
|
topXCreators=new TopXCreators(this); |
|
|
|
|
|
|
|
topXCreators.setVisible(true); |
|
|
|
add(topXCreators); |
|
|
|
add(topXCreators); |
|
|
|
|
|
|
|
|
|
|
|
// 必须刷新"参数/控件树"面板,否则,若最近一次打开模版为 cpt,重启设计器,打开 frm,控件树消失
|
|
|
|
// 必须刷新"参数/控件树"面板,否则,若最近一次打开模版为 cpt,重启设计器,打开 frm,控件树消失
|
|
|
@ -836,12 +837,16 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 从已选择的组件中找x,y所在的组件 |
|
|
|
* 从已选择的组件中找x,y所在的组件 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private XCreator xCreatorAt(int x, int y, XCreator[] xCreators) { |
|
|
|
private XCreator xCreatorAt(int x, int y,XCreator root) { |
|
|
|
|
|
|
|
XCreator[] xCreators = selectionModel.getSelection().getSelectedCreators(); |
|
|
|
for (XCreator creator : xCreators) { |
|
|
|
for (XCreator creator : xCreators) { |
|
|
|
if (creator == null || !creator.isVisible()) { |
|
|
|
boolean shouldContinue = creator == null |
|
|
|
continue; |
|
|
|
|| !creator.isVisible() |
|
|
|
} |
|
|
|
|| !XCreatorUtils.containComponent(root, creator) |
|
|
|
if (creator instanceof XWAbsoluteBodyLayout || creator instanceof XWFitLayout || creator instanceof XWParameterLayout) { |
|
|
|
|| creator instanceof XWAbsoluteBodyLayout |
|
|
|
|
|
|
|
|| creator instanceof XWFitLayout |
|
|
|
|
|
|
|
|| creator instanceof XWParameterLayout; |
|
|
|
|
|
|
|
if (shouldContinue) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
x -= creator.getX(); |
|
|
|
x -= creator.getX(); |
|
|
@ -1072,7 +1077,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
} |
|
|
|
} |
|
|
|
int relativeX = x + (int) (formArea.getHorizontalValue() / scale) - container.getX(); |
|
|
|
int relativeX = x + (int) (formArea.getHorizontalValue() / scale) - container.getX(); |
|
|
|
int relativeY = y + (int) (formArea.getVerticalValue() / scale) - container.getY(); |
|
|
|
int relativeY = y + (int) (formArea.getVerticalValue() / scale) - container.getY(); |
|
|
|
XCreator result = xCreatorAt(relativeX, relativeY, selectionModel.getSelection().getSelectedCreators()); |
|
|
|
XCreator result = xCreatorAt(relativeX, relativeY, container); |
|
|
|
return result == null ? getComponentAt(x, y, null) : result; |
|
|
|
return result == null ? getComponentAt(x, y, null) : result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|