Browse Source

REPORT-1808 设计器内tab bug修复

1.嵌套情况下,删除不起效果。
2.删除最后一个没有提示。
3.字体自定义之后再设置默认,字体没有变回来。
master
lee 8 years ago
parent
commit
2dad275f38
  1. 10
      designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java
  2. 10
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java

10
designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java

@ -251,7 +251,9 @@ public class XCardSwitchButton extends XButton {
Point position = button.getLocation();
int width = button.getWidth();
int height = button.getHeight();
ey = ey % DEFAULT_BUTTON_HEIGHT;
// 鼠标进入按钮右侧删除图标区域
double recX = position.getX() + (width - RIGHT_OFFSET);
double recY = position.getY() + (height - TOP_OFFSET);
@ -337,6 +339,12 @@ public class XCardSwitchButton extends XButton {
//删除tab布局
private void deleteTabLayout(SelectionModel selectionModel,FormDesigner designer){
String titleName = this.getContentLabel().getText();
int value = JOptionPane.showConfirmDialog(null, Inter.getLocText("FR-Designer_ConfirmDialog_Content") + "“" + titleName + "”",
Inter.getLocText("FR-Designer_ConfirmDialog_Title"),JOptionPane.YES_NO_OPTION);
if (value != JOptionPane.OK_OPTION) {
return;
}
XLayoutContainer mainLayout = this.cardLayout.getBackupParent();
if(mainLayout != null){
selectionModel.setSelectedCreator(mainLayout);

10
designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java

@ -45,6 +45,9 @@ public class XWTabFitLayout extends XWFitLayout {
// tab布局在拖拽导致的缩放里(含间隔时),如果拖拽宽高大于组件宽高,会导致调整的时候找不到原来的组件
// 这里先将拖拽之前的宽高先做备份
private static final Color NORMAL_GRAL = new Color(236,236,236);
private static final String DEFAULT_FONT_NAME = "SimSun";
public final static Font DEFAULTFT = new Font("Song_TypeFace",0,12);
public final static FRFont DEFAULT_FRFT = FRFont.getInstance(DEFAULT_FONT_NAME, 0, 9);
private Dimension referDim;
private Background initialBackground;
private Background overBackground;
@ -229,16 +232,21 @@ public class XWTabFitLayout extends XWFitLayout {
boolean isStyle = ((WTabFitLayout) data).isCustomStyle();
Background bg;
bg = ColorBackground.getInstance(NORMAL_GRAL);
CardSwitchButton cardSwitchButton = (CardSwitchButton) this.xCardSwitchButton.toData();
if (!isStyle) {
this.xCardSwitchButton.setCustomStyle(false);
this.xCardSwitchButton.setSelectBackground(bg);
this.xCardSwitchButton.getLabel().setFont(DEFAULTFT);
cardSwitchButton.setFont(DEFAULT_FRFT);
} else {
CardSwitchButton cardSwitchButton = (CardSwitchButton) this.xCardSwitchButton.toData();
Background initialBackground = cardSwitchButton.getInitialBackground();
bg = initialBackground == null ? bg : initialBackground;
this.xCardSwitchButton.setSelectBackground(bg);
this.xCardSwitchButton.setCustomStyle(true);
cardSwitchButton.setCustomStyle(true);
if (font != null) {
cardSwitchButton.setFont(font);
}
}
}

Loading…
Cancel
Save