diff options
Diffstat (limited to 'src/cppcheckplus/outlookpanel/MyOutlookSplitListener.java')
-rw-r--r-- | src/cppcheckplus/outlookpanel/MyOutlookSplitListener.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/cppcheckplus/outlookpanel/MyOutlookSplitListener.java b/src/cppcheckplus/outlookpanel/MyOutlookSplitListener.java new file mode 100644 index 0000000..b65e706 --- /dev/null +++ b/src/cppcheckplus/outlookpanel/MyOutlookSplitListener.java | |||
@@ -0,0 +1,33 @@ | |||
1 | |||
2 | package cppcheckplus.outlookpanel; | ||
3 | |||
4 | import java.awt.Dimension; | ||
5 | import java.awt.Point; | ||
6 | import java.awt.event.MouseEvent; | ||
7 | import javax.swing.JComponent; | ||
8 | |||
9 | import cppcheckplus.control.MyHeader; | ||
10 | import cppcheckplus.control.MyListSplitListener; | ||
11 | |||
12 | public class MyOutlookSplitListener extends MyListSplitListener | ||
13 | { | ||
14 | public MyOutlookSplitListener(MyHeader header) | ||
15 | { | ||
16 | super(header); | ||
17 | } | ||
18 | |||
19 | public void mouseDragged(MouseEvent e) | ||
20 | { | ||
21 | if (!header.isShrinked() && lastPoint != null) | ||
22 | { | ||
23 | JComponent parent = (JComponent)header.getParent(); | ||
24 | Dimension size = parent.getPreferredSize(); | ||
25 | Point thisPoint = e.getPoint(); | ||
26 | int xMovement = thisPoint.x - lastPoint.x; | ||
27 | size.width += xMovement; | ||
28 | size.width = Math.max(size.width, 37); | ||
29 | parent.setPreferredSize(size); | ||
30 | header.revalidateParent(); | ||
31 | } | ||
32 | } | ||
33 | } | ||