Browse Source

REPORT-37473 多层嵌套的tab模板,如果进行增加删除tab,无法点击删除

feature/big-screen
pengda 4 years ago
parent
commit
ba3da486cb
  1. 20
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java

20
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java

@ -258,10 +258,24 @@ public class XCardSwitchButton extends XButton {
int ey = e.getY();
//获取tab布局的位置,鼠标相对于tab按钮的位置
XLayoutContainer mainLayout = cardLayout.getBackupParent();
Container mainLayout = cardLayout.getBackupParent();
Point point = mainLayout.getLocation();
double mainX = point.getX();
double mainY = point.getY();
int y = 0;
int x = 0;
//遍历一下,不然是相对位置,嵌套后位置不对
while (mainLayout.getParent() != null){
if(mainLayout instanceof XWCardLayout){
y += mainLayout.getY();
}
mainLayout = mainLayout.getParent();
if(mainLayout instanceof XWCardMainBorderLayout){
x += mainLayout.getX();
}
}
double mainX = point.getX() + x;
double mainY = point.getY() + y;
// 参数界面对坐标的影响
JForm jform = (JForm) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();

Loading…
Cancel
Save