diff --git a/designer_base/src/com/fr/design/mainframe/HelpDialogManager.java b/designer_base/src/com/fr/design/mainframe/HelpDialogManager.java index 5de971b71..febda0a85 100644 --- a/designer_base/src/com/fr/design/mainframe/HelpDialogManager.java +++ b/designer_base/src/com/fr/design/mainframe/HelpDialogManager.java @@ -35,11 +35,4 @@ public class HelpDialogManager { } return THIS; } - - public void destroyDialog() { - if (handler != null) { - handler.destroyHelpDialog(); - } - handler = null; - } } diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 2ba11975f..f2fa5cfa1 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -282,12 +282,12 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme * @param e 点击事件 */ public void respondClick(EditingMouseListener editingMouseListener,MouseEvent e){ + HelpDialogManager.getInstance().setPane(coverPanel); super.respondClick(editingMouseListener, e); if (this.isHelpBtnOnFocus()) { coverPanel.setMsgDisplay(e); - }else { - coverPanel.destroyHelpDialog(); - switchTab(e,editingMouseListener); + } else { + switchTab(e, editingMouseListener); } } diff --git a/designer_form/src/com/fr/design/mainframe/CoverReportPane.java b/designer_form/src/com/fr/design/mainframe/CoverReportPane.java index ee1fb27bd..1d8277c46 100644 --- a/designer_form/src/com/fr/design/mainframe/CoverReportPane.java +++ b/designer_form/src/com/fr/design/mainframe/CoverReportPane.java @@ -1,8 +1,6 @@ package com.fr.design.mainframe; import com.fr.design.constants.UIConstants; -import com.fr.design.designer.beans.events.DesignerEditListener; -import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.icon.IconPathConstants; import com.fr.form.share.ShareConstants; @@ -13,6 +11,8 @@ import com.fr.stable.StringUtils; import javax.swing.*; import java.awt.*; import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; /** * 报表块的封面(如果后面所有的组件都有帮助信息的话就抽接口吧) @@ -43,18 +43,6 @@ public class CoverReportPane extends CoverPane implements HelpDialogHandler{ public CoverReportPane(String helpMsg) { super(); this.helpMsg = helpMsg; - add(controlButton); -// if (WidgetPropertyPane.getInstance().getEditingFormDesigner() != null) { -// WidgetPropertyPane.getInstance().getEditingFormDesigner().addDesignerEditListener(new DesignerEditListener() { -// @Override -// public void fireCreatorModified(DesignerEvent evt) { -// if (evt.getCreatorEventID() == (DesignerEvent.CREATOR_DELETED) -// || evt.getCreatorEventID() == (DesignerEvent.CREATOR_RESIZED)) { -// destroyHelpDialog(); -// } -// } -// }); -// } } public String getHelpMsg() { @@ -63,12 +51,16 @@ public class CoverReportPane extends CoverPane implements HelpDialogHandler{ public void setHelpMsg(String helpMsg) { this.helpMsg = helpMsg; + //帮助信息为空就不显示帮助按钮 + if (StringUtils.isNotEmpty(helpMsg)) { + add(controlButton); + } } public void setMsgDisplay(MouseEvent e) { if (helpDialog == null) { - controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_CLOSE_ICON_PATH); - controlButton.repaint(); +// controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_CLOSE_ICON_PATH); + controlButton.setVisible(false); helpDialog = new ElementCaseHelpDialog(DesignerContext.getDesignerFrame(), helpMsg); double screenValue = FRScreen.getByDimension(Toolkit.getDefaultToolkit().getScreenSize()).getValue(); int offsetX = 0; @@ -80,12 +72,14 @@ public class CoverReportPane extends CoverPane implements HelpDialogHandler{ int rY = 165 + e.getY();//165是设计器最上面几个面板的高度 helpDialog.setLocationRelativeTo(DesignerContext.getDesignerFrame(), rX, rY); helpDialog.showWindow(); + helpDialog.addWindowListener(new WindowAdapter() { + @Override + public void windowClosed(WindowEvent e) { + helpDialog = null; + controlButton.setVisible(true); + } + }); HelpDialogManager.getInstance().setPane(this); - } else { - controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_HELP_ICON_PATH); - controlButton.repaint(); - helpDialog.dispose(); - helpDialog = null; } } @@ -135,8 +129,8 @@ public class CoverReportPane extends CoverPane implements HelpDialogHandler{ @Override public void setVisible(boolean aFlag) { super.setVisible(aFlag); - if (aFlag) { - HelpDialogManager.getInstance().setPane(this); - } +// if (aFlag) { +// HelpDialogManager.getInstance().setPane(this); +// } } } diff --git a/designer_form/src/com/fr/design/mainframe/ElementCaseHelpDialog.java b/designer_form/src/com/fr/design/mainframe/ElementCaseHelpDialog.java index 60b699107..0894bd0db 100644 --- a/designer_form/src/com/fr/design/mainframe/ElementCaseHelpDialog.java +++ b/designer_form/src/com/fr/design/mainframe/ElementCaseHelpDialog.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe; import com.fr.design.dialog.UIDialog; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.itextarea.UITextArea; +import com.fr.general.Inter; import javax.swing.*; import java.awt.*; @@ -15,7 +16,7 @@ import java.awt.*; public class ElementCaseHelpDialog extends UIDialog { private static final int OUTER_WIDTH = 190; - private static final int OUTER_HEIGHT = 120; + private static final int OUTER_HEIGHT = 280; private String helpMsg; @@ -25,7 +26,6 @@ public class ElementCaseHelpDialog extends UIDialog { public ElementCaseHelpDialog(Frame parent, String helpMsg) { super(parent); this.helpMsg = helpMsg; - setUndecorated(true); initHelpArea(); JPanel panel = (JPanel) getContentPane(); initComponents(panel); @@ -37,21 +37,23 @@ public class ElementCaseHelpDialog extends UIDialog { textArea.setEditable(false); textArea.setBorder(null); helpArea = new UIScrollPane(textArea); - helpArea.setBounds(0, 0, 190, 120); + helpArea.setBounds(0, 0, 190, 280); helpArea.setBorder(null); } private void initComponents(JPanel contentPane) { contentPane.setLayout(new BorderLayout()); add(helpArea, BorderLayout.CENTER); + this.applyClosingAction(); + this.setTitle(Inter.getLocText("FR-Designer_Help")); } /** * 打开帮助框 */ public void showWindow() { - setVisible(true); this.setResizable(false); + setVisible(true); } /**