Subversion Repositories Applications.papyrus

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1318 alexandre_ 1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
4
 
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:
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
10
 
11
dojo.provide("dojo.widget.TaskBar");
12
dojo.require("dojo.widget.*");
13
dojo.require("dojo.widget.FloatingPane");
14
dojo.require("dojo.widget.HtmlWidget");
15
dojo.require("dojo.event.*");
16
dojo.require("dojo.html.selection");
17
dojo.widget.defineWidget("dojo.widget.TaskBarItem", dojo.widget.HtmlWidget, {iconSrc:"", caption:"Untitled", templateString:"<div class=\"dojoTaskBarItem\" dojoAttachEvent=\"onClick\">\n</div>\n", templateCssString:".dojoTaskBarItem {\n\tdisplay: inline-block;\n\tbackground-color: ThreeDFace;\n\tborder: outset 2px;\n\tmargin-right: 5px;\n\tcursor: pointer;\n\theight: 35px;\n\twidth: 100px;\n\tfont-size: 10pt;\n\twhite-space: nowrap;\n\ttext-align: center;\n\tfloat: left;\n\toverflow: hidden;\n}\n\n.dojoTaskBarItem img {\n\tvertical-align: middle;\n\tmargin-right: 5px;\n\tmargin-left: 5px;\t\n\theight: 32px;\n\twidth: 32px;\n}\n\n.dojoTaskBarItem a {\n\t color: black;\n\ttext-decoration: none;\n}\n\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TaskBar.css"), fillInTemplate:function () {
18
	if (this.iconSrc) {
19
		var img = document.createElement("img");
20
		img.src = this.iconSrc;
21
		this.domNode.appendChild(img);
22
	}
23
	this.domNode.appendChild(document.createTextNode(this.caption));
24
	dojo.html.disableSelection(this.domNode);
25
}, postCreate:function () {
26
	this.window = dojo.widget.getWidgetById(this.windowId);
27
	this.window.explodeSrc = this.domNode;
28
	dojo.event.connect(this.window, "destroy", this, "destroy");
29
}, onClick:function () {
30
	this.window.toggleDisplay();
31
}});
32
dojo.widget.defineWidget("dojo.widget.TaskBar", dojo.widget.FloatingPane, function () {
33
	this._addChildStack = [];
34
}, {resizable:false, titleBarDisplay:false, addChild:function (child) {
35
	if (!this.containerNode) {
36
		this._addChildStack.push(child);
37
	} else {
38
		if (this._addChildStack.length > 0) {
39
			var oarr = this._addChildStack;
40
			this._addChildStack = [];
41
			dojo.lang.forEach(oarr, this.addChild, this);
42
		}
43
	}
44
	var tbi = dojo.widget.createWidget("TaskBarItem", {windowId:child.widgetId, caption:child.title, iconSrc:child.iconSrc});
45
	dojo.widget.TaskBar.superclass.addChild.call(this, tbi);
46
}});
47