Browse Source

Pull request #2124: REPORT-37588 final传一份

Merge in DESIGN/design from ~KERRY/design_10.0:final/10.0 to final/10.0

* commit 'fd2bbe1e68233ce79aa24432889f8a7919df62df':
  REPORT-37588 final传一份
final/10.0
Kara 4 years ago
parent
commit
e197a9f9ae
  1. 5
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java
  2. 2
      designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java
  3. 8
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

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

@ -202,7 +202,8 @@ public class XCardSwitchButton extends XButton {
jPopupMenu.add(prev); jPopupMenu.add(prev);
jPopupMenu.add(next); jPopupMenu.add(next);
jPopupMenu.add(end); jPopupMenu.add(end);
GUICoreUtils.showPopupMenu(jPopupMenu, editingMouseListener.getDesigner(), e.getX(), e.getY()); FormDesigner designer = editingMouseListener.getDesigner();
GUICoreUtils.showPopupMenu(jPopupMenu, editingMouseListener.getDesigner(), designer.getOriginX(e.getX()), designer.getOriginY(e.getY()));
} }
@Override @Override
@ -251,7 +252,7 @@ public class XCardSwitchButton extends XButton {
//是否进入点击关闭按钮区域 //是否进入点击关闭按钮区域
private boolean isSelectedClose(MouseEvent e, FormDesigner designer){ private boolean isSelectedClose(MouseEvent e, FormDesigner designer){
int diff = designer.getArea().getHorScrollBar().getValue(); int diff = designer.getHorizontalScaleValue();
// mouse position // mouse position
int ex = e.getX() + diff; int ex = e.getX() + diff;

2
designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java

@ -607,7 +607,7 @@ public class EditingMouseListener extends MouseInputAdapter {
if (e.getButton() == MouseEvent.BUTTON3) { if (e.getButton() == MouseEvent.BUTTON3) {
UIPopupMenu cellPopupMenu = creator.createPopupMenu(designer); UIPopupMenu cellPopupMenu = creator.createPopupMenu(designer);
if (cellPopupMenu != UIPopupMenu.EMPTY) { if (cellPopupMenu != UIPopupMenu.EMPTY) {
GUICoreUtils.showPopupMenu(cellPopupMenu, designer, e.getX(), e.getY()); GUICoreUtils.showPopupMenu(cellPopupMenu, designer, oldX, oldY);
} }
} }
creator.doLayout(); creator.doLayout();

8
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -1611,6 +1611,14 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
return (int) ((y - this.getPaintY()) / this.getScale()); return (int) ((y - this.getPaintY()) / this.getScale());
} }
public int getOriginX(int x) {
return (int) (x * this.getScale() + this.getPaintX());
}
public int getOriginY(int y) {
return (int) (y * this.getScale() + this.getPaintY());
}
public int getHorizontalScaleValue() { public int getHorizontalScaleValue() {
return (int) (this.getArea().getHorizontalValue() / this.scale); return (int) (this.getArea().getHorizontalValue() / this.scale);

Loading…
Cancel
Save