Browse Source

Merge pull request #657 in BA/design from ~LEE/design_release:release to release

* commit '2dad275f38b868bab361a6ff18b51ad0b7344ea9':
  REPORT-1808 设计器内tab bug修复
master
superman 8 years ago
parent
commit
a1fef7c518
  1. 8
      designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java
  2. 10
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java

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

@ -252,6 +252,8 @@ public class XCardSwitchButton extends XButton {
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