2 Windows, tabs, and general widgetry for SWAT.
4 Copyright (C) Deryck Hodge 2005
5 released under the GNU GPL Version 2 or later
8 /* Qooxdoo's browser sniffer doesn't distinguish IE version.
9 We'll cover IE 6 for now, but these checks need to be
10 revisited for fuller browser coverage. */
11 var browser = QxClient().engine;
13 // DocX/Y returns the width/height of the page in browser
17 if (browser != "mshtml") {
18 x = window.innerWidth;
20 x = document.documentElement.clientWidth;
28 if (browser != "mshtml") {
29 y = window.innerHeight;
31 y = document.documentElement.clientHeight;
36 // If given a number, sizeX/Y returns in pixels a percentage of the browser
37 // window. If given a Window object, sizeX/Y returns the size of that object.
42 if (typeof(s) == 'number') {
43 sX = Math.floor(docX() * s);
54 if (typeof(s) == 'number') {
55 sY = Math.floor(docY() * s);
57 sY = s.getMinHeight();
65 var y = Math.floor( (docY() - sizeY(win)) * Math.random() );
71 var x = Math.floor( (docX() - sizeX(win)) * Math.random() );
77 var blank = new Window("New Menu");
79 blank.setVisible(true);
82 function Window(h, src, s)
84 this.self = new QxWindow(h);
86 // Settings for all windows
88 this.self.setMinWidth(sizeX(s));
89 this.self.setMinHeight(sizeY(s));
91 this.self.setTop(getPosX(this.self));
92 this.self.setLeft(getPosY(this.self));
94 this.self.addEventListener("contextmenu", contextMenu);
99 function SmallWindow(h, src)
101 this.self = new Window(h, src, .20);
105 function StandardWindow(h, src)
107 this.self = new Window(h, src, .45);
111 function LargeWindow(h, src)
113 this.self = new Window(h, src, .70);
117 Window.small = SmallWindow;
118 Window.standard = StandardWindow;
119 Window.large = LargeWindow;