1
|
=== modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js'
|
2
|
--- src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js 2015-12-09 06:42:45 +0000
|
3
|
+++ src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js 2015-12-09 19:44:53 +0000
|
4
|
@@ -32,6 +32,8 @@
|
5
|
** SBI 20151201 Fixed two times clicks for menus.
|
6
|
** 009 SBI 20151208 Added new parameters, scroll amount and scroll unit for wheel events and
|
7
|
** a mouse modifiers mask for all mouse events.
|
8
|
+** SBI 20151209 Changed to create task icons only for main windows (the child windows includes
|
9
|
+** all modal windows), to cleanup all mouse handlers for destroyed windows.
|
10
|
*/
|
11
|
|
12
|
"use strict";
|
13
|
@@ -738,6 +740,52 @@
|
14
|
};
|
15
|
|
16
|
/**
|
17
|
+ * Deregister all mouse widgets for this window.
|
18
|
+ */
|
19
|
+ Window.prototype.deregisterAllMouseWidget = function()
|
20
|
+ {
|
21
|
+ for (var opName in mouseOps)
|
22
|
+ {
|
23
|
+ if (mouseOps.hasOwnProperty(opName))
|
24
|
+ {
|
25
|
+ var mactions = this.mouseAwareWidgets[opName];
|
26
|
+ for (var wid in mactions)
|
27
|
+ {
|
28
|
+ if (mactions.hasOwnProperty(wid))
|
29
|
+ {
|
30
|
+ delete mactions[wid];
|
31
|
+ }
|
32
|
+ }
|
33
|
+ }
|
34
|
+ }
|
35
|
+
|
36
|
+ for (var opName in osOps)
|
37
|
+ {
|
38
|
+ if (osOps.hasOwnProperty(opName))
|
39
|
+ {
|
40
|
+ var mactions = this.osAwareWidgets[opName];
|
41
|
+ for (var wid in mactions)
|
42
|
+ {
|
43
|
+ if (mactions.hasOwnProperty(wid))
|
44
|
+ {
|
45
|
+ var opHandler = mactions[wid];
|
46
|
+ opHandler.deregisterListeners();
|
47
|
+ delete mactions[wid];
|
48
|
+ }
|
49
|
+ }
|
50
|
+ }
|
51
|
+ }
|
52
|
+
|
53
|
+ for (var wid in this.anyMouseAwareWidgets)
|
54
|
+ {
|
55
|
+ if (this.anyMouseAwareWidgets.hasOwnProperty(wid))
|
56
|
+ {
|
57
|
+ delete this.anyMouseAwareWidgets[wid];
|
58
|
+ }
|
59
|
+ }
|
60
|
+ };
|
61
|
+
|
62
|
+ /**
|
63
|
* Register the specified widget for any mouse events.
|
64
|
*
|
65
|
* @param {Number} wid
|
66
|
@@ -767,6 +815,7 @@
|
67
|
*/
|
68
|
Window.prototype.cleanup = function()
|
69
|
{
|
70
|
+ this.deregisterAllMouseWidget();
|
71
|
// remove the child linkage from the owner if it exists
|
72
|
if (isExistingWindowId(this.owner))
|
73
|
{
|
74
|
@@ -1875,6 +1924,22 @@
|
75
|
*/
|
76
|
me.createWindow = function(wid)
|
77
|
{
|
78
|
+ return createWindowInternal(wid, true);
|
79
|
+ }
|
80
|
+
|
81
|
+ /**
|
82
|
+ * Create a new top-level window (and the canvas that backs it).
|
83
|
+ *
|
84
|
+ * @param wid
|
85
|
+ * The window id by which this window can be uniquely identified.
|
86
|
+ * @param canBeMinimized
|
87
|
+ * The boolean flag indicates that this window must be represented by a task icon on
|
88
|
+ * the tools bar.
|
89
|
+ *
|
90
|
+ * @return The created window instance or <code>null</code> on any error.
|
91
|
+ */
|
92
|
+ function createWindowInternal(wid, canBeMinimized)
|
93
|
+ {
|
94
|
if (!isValidWindowId(wid))
|
95
|
{
|
96
|
me.error("Window ids must be non-positive integers.");
|
97
|
@@ -1895,9 +1960,12 @@
|
98
|
// add to the z-order list
|
99
|
addZOrderEntry(wid, newwin);
|
100
|
|
101
|
- // creates new task icon widget for new window
|
102
|
- taskBar.addTaskIcon(newwin.id);
|
103
|
-
|
104
|
+ if (canBeMinimized)
|
105
|
+ {
|
106
|
+ // creates new task icon widget for new window
|
107
|
+ taskBar.addTaskIcon(newwin.id);
|
108
|
+ }
|
109
|
+
|
110
|
return newwin;
|
111
|
};
|
112
|
|
113
|
@@ -1927,18 +1995,14 @@
|
114
|
return null;
|
115
|
}
|
116
|
|
117
|
- var newwin = me.createWindow(wid);
|
118
|
+ var newwin = createWindowInternal(wid, false);
|
119
|
|
120
|
if (newwin === null)
|
121
|
return null;
|
122
|
|
123
|
newwin.owner = owner;
|
124
|
newwin.title = title || "";
|
125
|
-
|
126
|
- // creates new task icon widget for new window
|
127
|
- var taskIcon = taskBar.addTaskIcon(newwin.id);
|
128
|
- taskIcon.title = newwin.title;
|
129
|
-
|
130
|
+
|
131
|
var parent = getWindow(owner);
|
132
|
|
133
|
// add to the owned window list
|
134
|
|