Browse Source

Merge pull request #515 in BA/design from ~VITO/design:master to master

* commit 'a260cd4f93c627d19f38a5167517e0ff33504348':
  改名
  REPORT-817 改个写法
master
superman 8 years ago
parent
commit
6e66327ae4
  1. 15
      designer_base/src/com/fr/design/style/AbstractPopBox.java

15
designer_base/src/com/fr/design/style/AbstractPopBox.java

@ -96,13 +96,14 @@ public abstract class AbstractPopBox extends JPanel {
} }
private void mouseClick(MouseEvent evt) { private void mouseClick(MouseEvent evt) {
int x = evt.getLocationOnScreen().x; Point point = new Point((int) (evt.getLocationOnScreen().getX()), (int) evt.getLocationOnScreen().getY());
int y = evt.getLocationOnScreen().y; Dimension popBoxD = AbstractPopBox.this.getSize();
Rectangle popBoxRect = AbstractPopBox.this.getBounds(); Point popBoxP = AbstractPopBox.this.getLocationOnScreen();
Rectangle rectangle = this.getControlWindow().getBounds(); Dimension popMenuD = this.getControlWindow().getSize();
boolean b1 = x < rectangle.x || x > rectangle.x + rectangle.width; Point popMenuP = this.getControlWindow().getLocation();
boolean b2 = y < rectangle.y - popBoxRect.height || y > rectangle.y + rectangle.height; Rectangle popBoxRect = new Rectangle(popBoxP, popBoxD);
if (b1 || b2) { Rectangle popMenuRect = new Rectangle(popMenuP, popMenuD);
if (!popBoxRect.contains(point) && !popMenuRect.contains(point)) {
this.hidePopupMenu(); this.hidePopupMenu();
} }
} }

Loading…
Cancel
Save