r21325: delete children in reverse order since the array is manipulated during the...
[samba.git] / webapps / qooxdoo-0.6.3-sdk / frontend / framework / source / class / qx / ui / menu / Separator.js
1 /* ************************************************************************
2
3    qooxdoo - the new era of web development
4
5    http://qooxdoo.org
6
7    Copyright:
8      2004-2006 by 1&1 Internet AG, Germany, http://www.1and1.org
9
10    License:
11      LGPL 2.1: http://www.gnu.org/licenses/lgpl.html
12
13    Authors:
14      * Sebastian Werner (wpbasti)
15      * Andreas Ecker (ecker)
16
17 ************************************************************************ */
18
19 /* ************************************************************************
20
21 #module(ui_menu)
22
23 ************************************************************************ */
24
25 qx.OO.defineClass("qx.ui.menu.Separator", qx.ui.layout.CanvasLayout,
26 function()
27 {
28   qx.ui.layout.CanvasLayout.call(this);
29
30   // Fix IE Styling Issues
31   this.setStyleProperty("fontSize", "0");
32   this.setStyleProperty("lineHeight", "0");
33
34   // ************************************************************************
35   //   LINE
36   // ************************************************************************
37
38   this._line = new qx.ui.basic.Terminator;
39   this._line.setAnonymous(true);
40   this._line.setAppearance("menu-separator-line");
41   this.add(this._line);
42
43
44   // ************************************************************************
45   //   EVENTS
46   // ************************************************************************
47
48   // needed to stop the event, and keep the menu showing
49   this.addEventListener("mousedown", this._onmousedown);
50 });
51
52 qx.OO.changeProperty({ name : "appearance", type : "string", defaultValue : "menu-separator" });
53
54 qx.Proto.hasIcon = qx.util.Return.returnFalse;
55 qx.Proto.hasLabel = qx.util.Return.returnFalse;
56 qx.Proto.hasShortcut = qx.util.Return.returnFalse;
57 qx.Proto.hasMenu = qx.util.Return.returnFalse;
58
59 qx.Proto._onmousedown = function(e) {
60   e.stopPropagation();
61 }
62
63 qx.Proto.dispose = function()
64 {
65   if (this.getDisposed()) {
66     return true;
67   }
68
69   if (this._line)
70   {
71     this._line.dispose();
72     this._line = null;
73   }
74
75   return qx.ui.layout.CanvasLayout.prototype.dispose.call(this);
76 }