Subversion Repositories Applications.papyrus

Rev

Rev 1372 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1372 Rev 1422
1
/*
1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
3
	All Rights Reserved.
4
 
4
 
5
	Licensed under the Academic Free License version 2.1 or above OR the
5
	Licensed under the Academic Free License version 2.1 or above OR the
6
	modified BSD license. For more information on Dojo licensing, see:
6
	modified BSD license. For more information on Dojo licensing, see:
7
 
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
9
*/
-
 
10
 
-
 
11
 
10
 
12
 
11
dojo.provide("dojo.widget.SplitContainer");
13
dojo.provide("dojo.widget.SplitContainer");
12
dojo.require("dojo.widget.*");
14
dojo.require("dojo.widget.*");
13
dojo.require("dojo.widget.ContentPane");
15
dojo.require("dojo.widget.ContentPane");
14
dojo.require("dojo.widget.HtmlWidget");
16
dojo.require("dojo.widget.HtmlWidget");
15
dojo.require("dojo.html.style");
17
dojo.require("dojo.html.style");
16
dojo.require("dojo.html.layout");
18
dojo.require("dojo.html.layout");
17
dojo.require("dojo.html.selection");
19
dojo.require("dojo.html.selection");
18
dojo.require("dojo.io.cookie");
20
dojo.require("dojo.io.cookie");
19
dojo.widget.defineWidget("dojo.widget.SplitContainer", dojo.widget.HtmlWidget, function () {
21
dojo.widget.defineWidget("dojo.widget.SplitContainer", dojo.widget.HtmlWidget, function () {
20
	this.sizers = [];
22
	this.sizers = [];
21
}, {isContainer:true, templateCssString:".dojoSplitContainer{\n\tposition: relative;\n\toverflow: hidden;\n\tdisplay: block;\n}\n\n.dojoSplitPane{\n\tposition: absolute;\n}\n\n.dojoSplitContainerSizerH,\n.dojoSplitContainerSizerV {\n\tfont-size: 1px;\n\tcursor: move;\n\tcursor: w-resize;\n\tbackground-color: ThreeDFace;\n\tborder: 1px solid;\n\tborder-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight;\n\tmargin: 0;\n}\n\n.dojoSplitContainerSizerV {\n\tcursor: n-resize;\n}\n\n.dojoSplitContainerVirtualSizerH,\n.dojoSplitContainerVirtualSizerV {\n\tfont-size: 1px;\n\tcursor: move;\n\tcursor: w-resize;\n\tbackground-color: ThreeDShadow;\n\t-moz-opacity: 0.5;\n\topacity: 0.5;\n\tfilter: Alpha(Opacity=50);\n\tmargin: 0;\n}\n\n.dojoSplitContainerVirtualSizerV {\n\tcursor: n-resize;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/SplitContainer.css"), activeSizing:false, sizerWidth:15, orientation:"horizontal", persist:true, postMixInProperties:function () {
23
}, {isContainer:true, templateCssString:".dojoSplitContainer{\n\tposition: relative;\n\toverflow: hidden;\n\tdisplay: block;\n}\n\n.dojoSplitPane{\n\tposition: absolute;\n}\n\n.dojoSplitContainerSizerH,\n.dojoSplitContainerSizerV {\n\tfont-size: 1px;\n\tcursor: move;\n\tcursor: w-resize;\n\tbackground-color: ThreeDFace;\n\tborder: 1px solid;\n\tborder-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight;\n\tmargin: 0;\n}\n\n.dojoSplitContainerSizerV {\n\tcursor: n-resize;\n}\n\n.dojoSplitContainerVirtualSizerH,\n.dojoSplitContainerVirtualSizerV {\n\tfont-size: 1px;\n\tcursor: move;\n\tcursor: w-resize;\n\tbackground-color: ThreeDShadow;\n\t-moz-opacity: 0.5;\n\topacity: 0.5;\n\tfilter: Alpha(Opacity=50);\n\tmargin: 0;\n}\n\n.dojoSplitContainerVirtualSizerV {\n\tcursor: n-resize;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/SplitContainer.css"), activeSizing:false, sizerWidth:15, orientation:"horizontal", persist:true, postMixInProperties:function () {
22
	dojo.widget.SplitContainer.superclass.postMixInProperties.apply(this, arguments);
24
	dojo.widget.SplitContainer.superclass.postMixInProperties.apply(this, arguments);
23
	this.isHorizontal = (this.orientation == "horizontal");
25
	this.isHorizontal = (this.orientation == "horizontal");
24
}, fillInTemplate:function () {
26
}, fillInTemplate:function () {
25
	dojo.widget.SplitContainer.superclass.fillInTemplate.apply(this, arguments);
27
	dojo.widget.SplitContainer.superclass.fillInTemplate.apply(this, arguments);
26
	dojo.html.addClass(this.domNode, "dojoSplitContainer");
28
	dojo.html.addClass(this.domNode, "dojoSplitContainer");
27
	if (dojo.render.html.moz) {
29
	if (dojo.render.html.moz) {
28
		this.domNode.style.overflow = "-moz-scrollbars-none";
30
		this.domNode.style.overflow = "-moz-scrollbars-none";
29
	}
31
	}
30
	var content = dojo.html.getContentBox(this.domNode);
32
	var content = dojo.html.getContentBox(this.domNode);
31
	this.paneWidth = content.width;
33
	this.paneWidth = content.width;
32
	this.paneHeight = content.height;
34
	this.paneHeight = content.height;
33
}, onResized:function (e) {
35
}, onResized:function (e) {
34
	var content = dojo.html.getContentBox(this.domNode);
36
	var content = dojo.html.getContentBox(this.domNode);
35
	this.paneWidth = content.width;
37
	this.paneWidth = content.width;
36
	this.paneHeight = content.height;
38
	this.paneHeight = content.height;
37
	this._layoutPanels();
39
	this._layoutPanels();
38
}, postCreate:function (args, fragment, parentComp) {
40
}, postCreate:function (args, fragment, parentComp) {
39
	dojo.widget.SplitContainer.superclass.postCreate.apply(this, arguments);
41
	dojo.widget.SplitContainer.superclass.postCreate.apply(this, arguments);
40
	for (var i = 0; i < this.children.length; i++) {
42
	for (var i = 0; i < this.children.length; i++) {
41
		with (this.children[i].domNode.style) {
43
		with (this.children[i].domNode.style) {
42
			position = "absolute";
44
			position = "absolute";
43
		}
45
		}
44
		dojo.html.addClass(this.children[i].domNode, "dojoSplitPane");
46
		dojo.html.addClass(this.children[i].domNode, "dojoSplitPane");
45
		if (i == this.children.length - 1) {
47
		if (i == this.children.length - 1) {
46
			break;
48
			break;
47
		}
49
		}
48
		this._addSizer();
50
		this._addSizer();
49
	}
51
	}
50
	if (typeof this.sizerWidth == "object") {
52
	if (typeof this.sizerWidth == "object") {
51
		try {
53
		try {
52
			this.sizerWidth = parseInt(this.sizerWidth.toString());
54
			this.sizerWidth = parseInt(this.sizerWidth.toString());
53
		}
55
		}
54
		catch (e) {
56
		catch (e) {
55
			this.sizerWidth = 15;
57
			this.sizerWidth = 15;
56
		}
58
		}
57
	}
59
	}
58
	this.virtualSizer = document.createElement("div");
60
	this.virtualSizer = document.createElement("div");
59
	this.virtualSizer.style.position = "absolute";
61
	this.virtualSizer.style.position = "absolute";
60
	this.virtualSizer.style.display = "none";
62
	this.virtualSizer.style.display = "none";
61
	this.virtualSizer.style.zIndex = 10;
63
	this.virtualSizer.style.zIndex = 10;
62
	this.virtualSizer.className = this.isHorizontal ? "dojoSplitContainerVirtualSizerH" : "dojoSplitContainerVirtualSizerV";
64
	this.virtualSizer.className = this.isHorizontal ? "dojoSplitContainerVirtualSizerH" : "dojoSplitContainerVirtualSizerV";
63
	this.domNode.appendChild(this.virtualSizer);
65
	this.domNode.appendChild(this.virtualSizer);
64
	dojo.html.disableSelection(this.virtualSizer);
66
	dojo.html.disableSelection(this.virtualSizer);
65
	if (this.persist) {
67
	if (this.persist) {
66
		this._restoreState();
68
		this._restoreState();
67
	}
69
	}
68
	this.resizeSoon();
70
	this.resizeSoon();
69
}, _injectChild:function (child) {
71
}, _injectChild:function (child) {
70
	with (child.domNode.style) {
72
	with (child.domNode.style) {
71
		position = "absolute";
73
		position = "absolute";
72
	}
74
	}
73
	dojo.html.addClass(child.domNode, "dojoSplitPane");
75
	dojo.html.addClass(child.domNode, "dojoSplitPane");
74
}, _addSizer:function () {
76
}, _addSizer:function () {
75
	var i = this.sizers.length;
77
	var i = this.sizers.length;
76
	this.sizers[i] = document.createElement("div");
78
	this.sizers[i] = document.createElement("div");
77
	this.sizers[i].style.position = "absolute";
79
	this.sizers[i].style.position = "absolute";
78
	this.sizers[i].className = this.isHorizontal ? "dojoSplitContainerSizerH" : "dojoSplitContainerSizerV";
80
	this.sizers[i].className = this.isHorizontal ? "dojoSplitContainerSizerH" : "dojoSplitContainerSizerV";
79
	var self = this;
81
	var self = this;
80
	var handler = (function () {
82
	var handler = (function () {
81
		var sizer_i = i;
83
		var sizer_i = i;
82
		return function (e) {
84
		return function (e) {
83
			self.beginSizing(e, sizer_i);
85
			self.beginSizing(e, sizer_i);
84
		};
86
		};
85
	})();
87
	})();
86
	dojo.event.connect(this.sizers[i], "onmousedown", handler);
88
	dojo.event.connect(this.sizers[i], "onmousedown", handler);
87
	this.domNode.appendChild(this.sizers[i]);
89
	this.domNode.appendChild(this.sizers[i]);
88
	dojo.html.disableSelection(this.sizers[i]);
90
	dojo.html.disableSelection(this.sizers[i]);
89
}, removeChild:function (widget) {
91
}, removeChild:function (widget) {
90
	if (this.sizers.length > 0) {
92
	if (this.sizers.length > 0) {
91
		for (var x = 0; x < this.children.length; x++) {
93
		for (var x = 0; x < this.children.length; x++) {
92
			if (this.children[x] === widget) {
94
			if (this.children[x] === widget) {
93
				var i = this.sizers.length - 1;
95
				var i = this.sizers.length - 1;
94
				this.domNode.removeChild(this.sizers[i]);
96
				this.domNode.removeChild(this.sizers[i]);
95
				this.sizers.length = i;
97
				this.sizers.length = i;
96
				break;
98
				break;
97
			}
99
			}
98
		}
100
		}
99
	}
101
	}
100
	dojo.widget.SplitContainer.superclass.removeChild.call(this, widget, arguments);
102
	dojo.widget.SplitContainer.superclass.removeChild.call(this, widget, arguments);
101
	this.onResized();
103
	this.onResized();
102
}, addChild:function (widget) {
104
}, addChild:function (widget) {
103
	dojo.widget.SplitContainer.superclass.addChild.apply(this, arguments);
105
	dojo.widget.SplitContainer.superclass.addChild.apply(this, arguments);
104
	this._injectChild(widget);
106
	this._injectChild(widget);
105
	if (this.children.length > 1) {
107
	if (this.children.length > 1) {
106
		this._addSizer();
108
		this._addSizer();
107
	}
109
	}
108
	this._layoutPanels();
110
	this._layoutPanels();
109
}, _layoutPanels:function () {
111
}, _layoutPanels:function () {
110
	if (this.children.length == 0) {
112
	if (this.children.length == 0) {
111
		return;
113
		return;
112
	}
114
	}
113
	var space = this.isHorizontal ? this.paneWidth : this.paneHeight;
115
	var space = this.isHorizontal ? this.paneWidth : this.paneHeight;
114
	if (this.children.length > 1) {
116
	if (this.children.length > 1) {
115
		space -= this.sizerWidth * (this.children.length - 1);
117
		space -= this.sizerWidth * (this.children.length - 1);
116
	}
118
	}
117
	var out_of = 0;
119
	var out_of = 0;
118
	for (var i = 0; i < this.children.length; i++) {
120
	for (var i = 0; i < this.children.length; i++) {
119
		out_of += this.children[i].sizeShare;
121
		out_of += this.children[i].sizeShare;
120
	}
122
	}
121
	var pix_per_unit = space / out_of;
123
	var pix_per_unit = space / out_of;
122
	var total_size = 0;
124
	var total_size = 0;
123
	for (var i = 0; i < this.children.length - 1; i++) {
125
	for (var i = 0; i < this.children.length - 1; i++) {
124
		var size = Math.round(pix_per_unit * this.children[i].sizeShare);
126
		var size = Math.round(pix_per_unit * this.children[i].sizeShare);
125
		this.children[i].sizeActual = size;
127
		this.children[i].sizeActual = size;
126
		total_size += size;
128
		total_size += size;
127
	}
129
	}
128
	this.children[this.children.length - 1].sizeActual = space - total_size;
130
	this.children[this.children.length - 1].sizeActual = space - total_size;
129
	this._checkSizes();
131
	this._checkSizes();
130
	var pos = 0;
132
	var pos = 0;
131
	var size = this.children[0].sizeActual;
133
	var size = this.children[0].sizeActual;
132
	this._movePanel(this.children[0], pos, size);
134
	this._movePanel(this.children[0], pos, size);
133
	this.children[0].position = pos;
135
	this.children[0].position = pos;
134
	pos += size;
136
	pos += size;
135
	for (var i = 1; i < this.children.length; i++) {
137
	for (var i = 1; i < this.children.length; i++) {
136
		this._moveSlider(this.sizers[i - 1], pos, this.sizerWidth);
138
		this._moveSlider(this.sizers[i - 1], pos, this.sizerWidth);
137
		this.sizers[i - 1].position = pos;
139
		this.sizers[i - 1].position = pos;
138
		pos += this.sizerWidth;
140
		pos += this.sizerWidth;
139
		size = this.children[i].sizeActual;
141
		size = this.children[i].sizeActual;
140
		this._movePanel(this.children[i], pos, size);
142
		this._movePanel(this.children[i], pos, size);
141
		this.children[i].position = pos;
143
		this.children[i].position = pos;
142
		pos += size;
144
		pos += size;
143
	}
145
	}
144
}, _movePanel:function (panel, pos, size) {
146
}, _movePanel:function (panel, pos, size) {
145
	if (this.isHorizontal) {
147
	if (this.isHorizontal) {
146
		panel.domNode.style.left = pos + "px";
148
		panel.domNode.style.left = pos + "px";
147
		panel.domNode.style.top = 0;
149
		panel.domNode.style.top = 0;
148
		panel.resizeTo(size, this.paneHeight);
150
		panel.resizeTo(size, this.paneHeight);
149
	} else {
151
	} else {
150
		panel.domNode.style.left = 0;
152
		panel.domNode.style.left = 0;
151
		panel.domNode.style.top = pos + "px";
153
		panel.domNode.style.top = pos + "px";
152
		panel.resizeTo(this.paneWidth, size);
154
		panel.resizeTo(this.paneWidth, size);
153
	}
155
	}
154
}, _moveSlider:function (slider, pos, size) {
156
}, _moveSlider:function (slider, pos, size) {
155
	if (this.isHorizontal) {
157
	if (this.isHorizontal) {
156
		slider.style.left = pos + "px";
158
		slider.style.left = pos + "px";
157
		slider.style.top = 0;
159
		slider.style.top = 0;
158
		dojo.html.setMarginBox(slider, {width:size, height:this.paneHeight});
160
		dojo.html.setMarginBox(slider, {width:size, height:this.paneHeight});
159
	} else {
161
	} else {
160
		slider.style.left = 0;
162
		slider.style.left = 0;
161
		slider.style.top = pos + "px";
163
		slider.style.top = pos + "px";
162
		dojo.html.setMarginBox(slider, {width:this.paneWidth, height:size});
164
		dojo.html.setMarginBox(slider, {width:this.paneWidth, height:size});
163
	}
165
	}
164
}, _growPane:function (growth, pane) {
166
}, _growPane:function (growth, pane) {
165
	if (growth > 0) {
167
	if (growth > 0) {
166
		if (pane.sizeActual > pane.sizeMin) {
168
		if (pane.sizeActual > pane.sizeMin) {
167
			if ((pane.sizeActual - pane.sizeMin) > growth) {
169
			if ((pane.sizeActual - pane.sizeMin) > growth) {
168
				pane.sizeActual = pane.sizeActual - growth;
170
				pane.sizeActual = pane.sizeActual - growth;
169
				growth = 0;
171
				growth = 0;
170
			} else {
172
			} else {
171
				growth -= pane.sizeActual - pane.sizeMin;
173
				growth -= pane.sizeActual - pane.sizeMin;
172
				pane.sizeActual = pane.sizeMin;
174
				pane.sizeActual = pane.sizeMin;
173
			}
175
			}
174
		}
176
		}
175
	}
177
	}
176
	return growth;
178
	return growth;
177
}, _checkSizes:function () {
179
}, _checkSizes:function () {
178
	var total_min_size = 0;
180
	var total_min_size = 0;
179
	var total_size = 0;
181
	var total_size = 0;
180
	for (var i = 0; i < this.children.length; i++) {
182
	for (var i = 0; i < this.children.length; i++) {
181
		total_size += this.children[i].sizeActual;
183
		total_size += this.children[i].sizeActual;
182
		total_min_size += this.children[i].sizeMin;
184
		total_min_size += this.children[i].sizeMin;
183
	}
185
	}
184
	if (total_min_size <= total_size) {
186
	if (total_min_size <= total_size) {
185
		var growth = 0;
187
		var growth = 0;
186
		for (var i = 0; i < this.children.length; i++) {
188
		for (var i = 0; i < this.children.length; i++) {
187
			if (this.children[i].sizeActual < this.children[i].sizeMin) {
189
			if (this.children[i].sizeActual < this.children[i].sizeMin) {
188
				growth += this.children[i].sizeMin - this.children[i].sizeActual;
190
				growth += this.children[i].sizeMin - this.children[i].sizeActual;
189
				this.children[i].sizeActual = this.children[i].sizeMin;
191
				this.children[i].sizeActual = this.children[i].sizeMin;
190
			}
192
			}
191
		}
193
		}
192
		if (growth > 0) {
194
		if (growth > 0) {
193
			if (this.isDraggingLeft) {
195
			if (this.isDraggingLeft) {
194
				for (var i = this.children.length - 1; i >= 0; i--) {
196
				for (var i = this.children.length - 1; i >= 0; i--) {
195
					growth = this._growPane(growth, this.children[i]);
197
					growth = this._growPane(growth, this.children[i]);
196
				}
198
				}
197
			} else {
199
			} else {
198
				for (var i = 0; i < this.children.length; i++) {
200
				for (var i = 0; i < this.children.length; i++) {
199
					growth = this._growPane(growth, this.children[i]);
201
					growth = this._growPane(growth, this.children[i]);
200
				}
202
				}
201
			}
203
			}
202
		}
204
		}
203
	} else {
205
	} else {
204
		for (var i = 0; i < this.children.length; i++) {
206
		for (var i = 0; i < this.children.length; i++) {
205
			this.children[i].sizeActual = Math.round(total_size * (this.children[i].sizeMin / total_min_size));
207
			this.children[i].sizeActual = Math.round(total_size * (this.children[i].sizeMin / total_min_size));
206
		}
208
		}
207
	}
209
	}
208
}, beginSizing:function (e, i) {
210
}, beginSizing:function (e, i) {
209
	this.paneBefore = this.children[i];
211
	this.paneBefore = this.children[i];
210
	this.paneAfter = this.children[i + 1];
212
	this.paneAfter = this.children[i + 1];
211
	this.isSizing = true;
213
	this.isSizing = true;
212
	this.sizingSplitter = this.sizers[i];
214
	this.sizingSplitter = this.sizers[i];
213
	this.originPos = dojo.html.getAbsolutePosition(this.children[0].domNode, true, dojo.html.boxSizing.MARGIN_BOX);
215
	this.originPos = dojo.html.getAbsolutePosition(this.children[0].domNode, true, dojo.html.boxSizing.MARGIN_BOX);
214
	if (this.isHorizontal) {
216
	if (this.isHorizontal) {
215
		var client = (e.layerX ? e.layerX : e.offsetX);
217
		var client = (e.layerX ? e.layerX : e.offsetX);
216
		var screen = e.pageX;
218
		var screen = e.pageX;
217
		this.originPos = this.originPos.x;
219
		this.originPos = this.originPos.x;
218
	} else {
220
	} else {
219
		var client = (e.layerY ? e.layerY : e.offsetY);
221
		var client = (e.layerY ? e.layerY : e.offsetY);
220
		var screen = e.pageY;
222
		var screen = e.pageY;
221
		this.originPos = this.originPos.y;
223
		this.originPos = this.originPos.y;
222
	}
224
	}
223
	this.startPoint = this.lastPoint = screen;
225
	this.startPoint = this.lastPoint = screen;
224
	this.screenToClientOffset = screen - client;
226
	this.screenToClientOffset = screen - client;
225
	this.dragOffset = this.lastPoint - this.paneBefore.sizeActual - this.originPos - this.paneBefore.position;
227
	this.dragOffset = this.lastPoint - this.paneBefore.sizeActual - this.originPos - this.paneBefore.position;
226
	if (!this.activeSizing) {
228
	if (!this.activeSizing) {
227
		this._showSizingLine();
229
		this._showSizingLine();
228
	}
230
	}
229
	dojo.event.connect(document.documentElement, "onmousemove", this, "changeSizing");
231
	dojo.event.connect(document.documentElement, "onmousemove", this, "changeSizing");
230
	dojo.event.connect(document.documentElement, "onmouseup", this, "endSizing");
232
	dojo.event.connect(document.documentElement, "onmouseup", this, "endSizing");
231
	dojo.event.browser.stopEvent(e);
233
	dojo.event.browser.stopEvent(e);
232
}, changeSizing:function (e) {
234
}, changeSizing:function (e) {
233
	this.lastPoint = this.isHorizontal ? e.pageX : e.pageY;
235
	this.lastPoint = this.isHorizontal ? e.pageX : e.pageY;
234
	if (this.activeSizing) {
236
	if (this.activeSizing) {
235
		this.movePoint();
237
		this.movePoint();
236
		this._updateSize();
238
		this._updateSize();
237
	} else {
239
	} else {
238
		this.movePoint();
240
		this.movePoint();
239
		this._moveSizingLine();
241
		this._moveSizingLine();
240
	}
242
	}
241
	dojo.event.browser.stopEvent(e);
243
	dojo.event.browser.stopEvent(e);
242
}, endSizing:function (e) {
244
}, endSizing:function (e) {
243
	if (!this.activeSizing) {
245
	if (!this.activeSizing) {
244
		this._hideSizingLine();
246
		this._hideSizingLine();
245
	}
247
	}
246
	this._updateSize();
248
	this._updateSize();
247
	this.isSizing = false;
249
	this.isSizing = false;
248
	dojo.event.disconnect(document.documentElement, "onmousemove", this, "changeSizing");
250
	dojo.event.disconnect(document.documentElement, "onmousemove", this, "changeSizing");
249
	dojo.event.disconnect(document.documentElement, "onmouseup", this, "endSizing");
251
	dojo.event.disconnect(document.documentElement, "onmouseup", this, "endSizing");
250
	if (this.persist) {
252
	if (this.persist) {
251
		this._saveState(this);
253
		this._saveState(this);
252
	}
254
	}
253
}, movePoint:function () {
255
}, movePoint:function () {
254
	var p = this.lastPoint - this.screenToClientOffset;
256
	var p = this.lastPoint - this.screenToClientOffset;
255
	var a = p - this.dragOffset;
257
	var a = p - this.dragOffset;
256
	a = this.legaliseSplitPoint(a);
258
	a = this.legaliseSplitPoint(a);
257
	p = a + this.dragOffset;
259
	p = a + this.dragOffset;
258
	this.lastPoint = p + this.screenToClientOffset;
260
	this.lastPoint = p + this.screenToClientOffset;
259
}, legaliseSplitPoint:function (a) {
261
}, legaliseSplitPoint:function (a) {
260
	a += this.sizingSplitter.position;
262
	a += this.sizingSplitter.position;
261
	this.isDraggingLeft = (a > 0) ? true : false;
263
	this.isDraggingLeft = (a > 0) ? true : false;
262
	if (!this.activeSizing) {
264
	if (!this.activeSizing) {
263
		if (a < this.paneBefore.position + this.paneBefore.sizeMin) {
265
		if (a < this.paneBefore.position + this.paneBefore.sizeMin) {
264
			a = this.paneBefore.position + this.paneBefore.sizeMin;
266
			a = this.paneBefore.position + this.paneBefore.sizeMin;
265
		}
267
		}
266
		if (a > this.paneAfter.position + (this.paneAfter.sizeActual - (this.sizerWidth + this.paneAfter.sizeMin))) {
268
		if (a > this.paneAfter.position + (this.paneAfter.sizeActual - (this.sizerWidth + this.paneAfter.sizeMin))) {
267
			a = this.paneAfter.position + (this.paneAfter.sizeActual - (this.sizerWidth + this.paneAfter.sizeMin));
269
			a = this.paneAfter.position + (this.paneAfter.sizeActual - (this.sizerWidth + this.paneAfter.sizeMin));
268
		}
270
		}
269
	}
271
	}
270
	a -= this.sizingSplitter.position;
272
	a -= this.sizingSplitter.position;
271
	this._checkSizes();
273
	this._checkSizes();
272
	return a;
274
	return a;
273
}, _updateSize:function () {
275
}, _updateSize:function () {
274
	var pos = this.lastPoint - this.dragOffset - this.originPos;
276
	var pos = this.lastPoint - this.dragOffset - this.originPos;
275
	var start_region = this.paneBefore.position;
277
	var start_region = this.paneBefore.position;
276
	var end_region = this.paneAfter.position + this.paneAfter.sizeActual;
278
	var end_region = this.paneAfter.position + this.paneAfter.sizeActual;
277
	this.paneBefore.sizeActual = pos - start_region;
279
	this.paneBefore.sizeActual = pos - start_region;
278
	this.paneAfter.position = pos + this.sizerWidth;
280
	this.paneAfter.position = pos + this.sizerWidth;
279
	this.paneAfter.sizeActual = end_region - this.paneAfter.position;
281
	this.paneAfter.sizeActual = end_region - this.paneAfter.position;
280
	for (var i = 0; i < this.children.length; i++) {
282
	for (var i = 0; i < this.children.length; i++) {
281
		this.children[i].sizeShare = this.children[i].sizeActual;
283
		this.children[i].sizeShare = this.children[i].sizeActual;
282
	}
284
	}
283
	this._layoutPanels();
285
	this._layoutPanels();
284
}, _showSizingLine:function () {
286
}, _showSizingLine:function () {
285
	this._moveSizingLine();
287
	this._moveSizingLine();
286
	if (this.isHorizontal) {
288
	if (this.isHorizontal) {
287
		dojo.html.setMarginBox(this.virtualSizer, {width:this.sizerWidth, height:this.paneHeight});
289
		dojo.html.setMarginBox(this.virtualSizer, {width:this.sizerWidth, height:this.paneHeight});
288
	} else {
290
	} else {
289
		dojo.html.setMarginBox(this.virtualSizer, {width:this.paneWidth, height:this.sizerWidth});
291
		dojo.html.setMarginBox(this.virtualSizer, {width:this.paneWidth, height:this.sizerWidth});
290
	}
292
	}
291
	this.virtualSizer.style.display = "block";
293
	this.virtualSizer.style.display = "block";
292
}, _hideSizingLine:function () {
294
}, _hideSizingLine:function () {
293
	this.virtualSizer.style.display = "none";
295
	this.virtualSizer.style.display = "none";
294
}, _moveSizingLine:function () {
296
}, _moveSizingLine:function () {
295
	var pos = this.lastPoint - this.startPoint + this.sizingSplitter.position;
297
	var pos = this.lastPoint - this.startPoint + this.sizingSplitter.position;
296
	if (this.isHorizontal) {
298
	if (this.isHorizontal) {
297
		this.virtualSizer.style.left = pos + "px";
299
		this.virtualSizer.style.left = pos + "px";
298
	} else {
300
	} else {
299
		var pos = (this.lastPoint - this.startPoint) + this.sizingSplitter.position;
301
		var pos = (this.lastPoint - this.startPoint) + this.sizingSplitter.position;
300
		this.virtualSizer.style.top = pos + "px";
302
		this.virtualSizer.style.top = pos + "px";
301
	}
303
	}
302
}, _getCookieName:function (i) {
304
}, _getCookieName:function (i) {
303
	return this.widgetId + "_" + i;
305
	return this.widgetId + "_" + i;
304
}, _restoreState:function () {
306
}, _restoreState:function () {
305
	for (var i = 0; i < this.children.length; i++) {
307
	for (var i = 0; i < this.children.length; i++) {
306
		var cookieName = this._getCookieName(i);
308
		var cookieName = this._getCookieName(i);
307
		var cookieValue = dojo.io.cookie.getCookie(cookieName);
309
		var cookieValue = dojo.io.cookie.getCookie(cookieName);
308
		if (cookieValue != null) {
310
		if (cookieValue != null) {
309
			var pos = parseInt(cookieValue);
311
			var pos = parseInt(cookieValue);
310
			if (typeof pos == "number") {
312
			if (typeof pos == "number") {
311
				this.children[i].sizeShare = pos;
313
				this.children[i].sizeShare = pos;
312
			}
314
			}
313
		}
315
		}
314
	}
316
	}
315
}, _saveState:function () {
317
}, _saveState:function () {
316
	for (var i = 0; i < this.children.length; i++) {
318
	for (var i = 0; i < this.children.length; i++) {
317
		var cookieName = this._getCookieName(i);
319
		var cookieName = this._getCookieName(i);
318
		dojo.io.cookie.setCookie(cookieName, this.children[i].sizeShare, null, null, null, null);
320
		dojo.io.cookie.setCookie(cookieName, this.children[i].sizeShare, null, null, null, null);
319
	}
321
	}
320
}});
322
}});
321
dojo.lang.extend(dojo.widget.Widget, {sizeMin:10, sizeShare:10});
323
dojo.lang.extend(dojo.widget.Widget, {sizeMin:10, sizeShare:10});
322
dojo.widget.defineWidget("dojo.widget.SplitContainerPanel", dojo.widget.ContentPane, {});
324
dojo.widget.defineWidget("dojo.widget.SplitContainerPanel", dojo.widget.ContentPane, {});
323
 
325