Browse Source

REPORT-37588 final传一份

final/10.0
kerry 4 years ago
parent
commit
fd2bbe1e68
  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(next);
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
@ -251,7 +252,7 @@ public class XCardSwitchButton extends XButton {
//是否进入点击关闭按钮区域
private boolean isSelectedClose(MouseEvent e, FormDesigner designer){
int diff = designer.getArea().getHorScrollBar().getValue();
int diff = designer.getHorizontalScaleValue();
// mouse position
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) {
UIPopupMenu cellPopupMenu = creator.createPopupMenu(designer);
if (cellPopupMenu != UIPopupMenu.EMPTY) {
GUICoreUtils.showPopupMenu(cellPopupMenu, designer, e.getX(), e.getY());
GUICoreUtils.showPopupMenu(cellPopupMenu, designer, oldX, oldY);
}
}
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());
}
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() {
return (int) (this.getArea().getHorizontalValue() / this.scale);

Loading…
Cancel
Save