1 jls.loader.provide('jls.win32.Menu'); 2 3 jls.loader.requireLibrary('jls_win32'); 4 5 jls.win32.Menu = jls.lang.Class.create( 6 { 7 initialize : function(popup) { 8 this._no = new _native.win32.Menu(popup); 9 }, 10 append : function(flags, idNewItem, data) { 11 if (idNewItem instanceof jls.win32.Menu) { 12 idNewItem = idNewItem._no; 13 } 14 return this._no.append(flags, idNewItem, data); 15 }, 16 insert : function(position, flags, idNewItem, data) { 17 if (idNewItem instanceof jls.win32.Menu) { 18 idNewItem = idNewItem._no; 19 } 20 return this._no.insert(position, flags, idNewItem, data); 21 }, 22 enable : function(id, flags) { 23 return this._no.enable(id, flags); 24 }, 25 state : function(id, flags) { 26 return this._no.state(id, flags); 27 }, 28 remove : function(position, flags) { 29 flags = flags || jls.win32.Menu.MF_BYPOSITION; 30 return this._no.remove(position, flags); 31 }, 32 handle : function() { 33 return this._no.handle(); 34 }, 35 trackPopup : function(window, x, y) { 36 if (! (window instanceof jls.win32.Window)) { 37 throw new jls.lang.Exception('Invalid window argument'); 38 } 39 return this._no.trackPopup(window._no, x, y); 40 } 41 }); 42 43 /*Object.extend(jls.win32.Menu, 44 { 45 _nop : null, 46 nop : function() { 47 } 48 });*/ 49 50 Object.inheritConstants(jls.win32.Menu, _native.win32.Menu); 51