summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeryck Hodge <deryck@samba.org>2005-08-21 05:41:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:15 -0500
commit375d11ac788af6e0d9b95cfce9dcbe54024d7505 (patch)
treec2e2e054a88740aba818e7f3fd3dd3d461cf338f
parentf0b06b36f9d98e67de1b20dc840d317720ba4ab7 (diff)
downloadsamba-375d11ac788af6e0d9b95cfce9dcbe54024d7505.tar.gz
samba-375d11ac788af6e0d9b95cfce9dcbe54024d7505.tar.bz2
samba-375d11ac788af6e0d9b95cfce9dcbe54024d7505.zip
r9443: We can now move windows around anywhere on our SWAT "desktop".
QxWidget doesn't accept percentages, so I feed the toplevel widget the actual brower height/width onload and onresize. deryck (This used to be commit dadc89f8839b5c481ba47eeadec9f7bf4d3e14a9)
-rw-r--r--swat/desktop/index.esp55
1 files changed, 48 insertions, 7 deletions
diff --git a/swat/desktop/index.esp b/swat/desktop/index.esp
index a81581bf3c..aeded6ed47 100644
--- a/swat/desktop/index.esp
+++ b/swat/desktop/index.esp
@@ -10,26 +10,69 @@ libinclude("base.js");
<script type="text/javascript">
+/* Qooxdoo's browser sniffer doesn't distinguish IE version.
+ We'll cover IE 6 for now, but these checks need to be
+ revisited for fuller browser coverage. */
+var browser = QxClient().engine;
+
+function docWidth()
+{
+ var x;
+ if (browser != "mshtml") {
+ x = window.innerWidth;
+ } else {
+ x = document.documentElement.clientWidth;
+ }
+ return x;
+}
+
+function docHeight()
+{
+ var y;
+ // Less 25px to not cover the toolbar
+ if (browser != "mshtml") {
+ y = window.innerHeight - 25;
+ } else {
+ y = document.documentElement.clientHeight;
+ }
+ return y;
+}
+
/*** init the page for qooxdoo ***/
window.application.main = function()
{
+ var doc = this.getClientWindow().getClientDocument();
// Don't declare local with var
- doc = this.getClientWindow().getClientDocument();
+ w = new QxWidget();
+ with(w) {
+ setTop(0);
+ setLeft(0);
+ setWidth(docWidth());
+ setHeight(docHeight());
+ }
+ doc.add(w);
+
+}
+
+window.onresize = function()
+{
+ w.setWidth(docWidth());
+ w.setHeight(docHeight());
}
function showReg()
{
var regedit = regedit_widget("ncalrpc:");
- doc.add(regedit);
+ w.add(regedit);
regedit.startup();
}
function startSwat()
{
// Don't declare local with var (for now)
- w1 = new QxWindow("Welcome to SWAT.");
- w1.setSpace(100, 100, 100, 100);
- doc.add(w1);
+ var w1 = new QxWindow("Welcome to SWAT.");
+ w1.setSpace("40%", 0, "35%", 0);
+ w.add(w1);
var btn1 = new QxButton("View Registry");
btn1.set({ top: 20, left : 30 });
@@ -40,8 +83,6 @@ function startSwat()
}
</script>
-<div id="canvas" style="overflow:hidden;position:static;margin-top:38px;margin-left:10px;margin-right:700px;width:700px"></div>
-
<div id="toolbar">
<h3><a href="javascript:startSwat()">SWAT (Start)</a></h3>
</div>