diff options
author | Deryck Hodge <deryck@samba.org> | 2005-08-30 03:55:08 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:35:00 -0500 |
commit | 37db11885d4a15be1afcfe868b73ebfaa44a8a61 (patch) | |
tree | 70e689188f8edbc969e8c0a9a8f0a7c2381db70b /swat/scripting/client | |
parent | 24dd21c498efd67054620d900d3358bcf0085cab (diff) | |
download | samba-37db11885d4a15be1afcfe868b73ebfaa44a8a61.tar.gz samba-37db11885d4a15be1afcfe868b73ebfaa44a8a61.tar.bz2 samba-37db11885d4a15be1afcfe868b73ebfaa44a8a61.zip |
r9779: Add a contextmenu function to be used by all window/widget objects.
deryck
(This used to be commit f0c7b43767b713f15d9c50fc744da0a6582618b2)
Diffstat (limited to 'swat/scripting/client')
-rw-r--r-- | swat/scripting/client/desktop.js | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/swat/scripting/client/desktop.js b/swat/scripting/client/desktop.js index 6383e58bda..bddd38b60c 100644 --- a/swat/scripting/client/desktop.js +++ b/swat/scripting/client/desktop.js @@ -89,26 +89,6 @@ function openIn(e) blank.setVisible(true); } -function winMenu(e) -{ - var self = this; - var WinWin = new QxCommand(); - WinWin.addEventListener("execute", function() { - var blank = new QxWindow(); - self.add(blank); - blank.setVisible(true); - }); - - var inset = new QxMenu; - var sub1 = new QxMenuButton("Open window in a window", null, WinWin); - - inset.add(sub1); - self.add(inset) - - cmenu.setVisible(false); - inset.setVisible(true); -} - function Window(h, src, s) { this.self = new QxWindow(h); @@ -121,7 +101,7 @@ function Window(h, src, s) this.self.setTop(getPosX(this.self)); this.self.setLeft(getPosY(this.self)); - this.self.addEventListener("contextmenu", winMenu); + this.self.addEventListener("contextmenu", contextMenu); return this.self; } @@ -148,10 +128,23 @@ Window.small = SmallWindow; Window.standard = StandardWindow; Window.large = LargeWindow; +function contextMenu(e) +{ + var t = e.getTarget() + var tObj = t.getHtmlAttribute("class") + + if (tObj == 'QxWidget') { + clientContextMenu(e); + } else if (tObj == 'QxWindowPane') { + windowContextMenu(t, e); + } +} + + window.application.main = function() { var doc = this.getClientWindow().getClientDocument(); - doc.addEventListener("contextmenu", showContextMenu); + doc.addEventListener("contextmenu", contextMenu); doc.add(w); var bar = new QxMenuBar; |