//>>built
define("dojox/grid/enhanced/_Events","dojo/_base/kernel dojo/_base/declare dojo/keys dojo/_base/html dojo/_base/event dojox/grid/_Events".split(" "),function(k,f,b,c,g,h){return f("dojox.grid.enhanced._Events",null,{_events:null,headerCellActiveClass:"dojoxGridHeaderActive",cellActiveClass:"dojoxGridCellActive",rowActiveClass:"dojoxGridRowActive",constructor:function(a){this._events=new h;a.mixin(a,this)},dokeyup:function(a){this.focus.currentArea().keyup(a)},onKeyDown:function(a){if(!a.altKey&&!a.metaKey){var e=
this.focus,d=this.edit.isEditing();switch(a.keyCode){case b.TAB:if(a.ctrlKey)break;e.tab(a.shiftKey?-1:1,a);break;case b.UP_ARROW:case b.DOWN_ARROW:if(d)break;e.currentArea().move(a.keyCode==b.UP_ARROW?-1:1,0,a);break;case b.LEFT_ARROW:case b.RIGHT_ARROW:if(d)break;d=a.keyCode==b.LEFT_ARROW?1:-1;c._isBodyLtr()&&(d*=-1);e.currentArea().move(0,d,a);break;case b.F10:if(this.menus&&a.shiftKey)this.onRowContextMenu(a);break;default:e.currentArea().keydown(a)}}},domouseup:function(a){if(a.cellNode)this.onMouseUp(a);
else this.onRowSelectorMouseUp(a)},domousedown:function(a){if(!a.cellNode)this.onRowSelectorMouseDown(a)},onMouseUp:function(a){this[-1==a.rowIndex?"onHeaderCellMouseUp":"onCellMouseUp"](a)},onCellMouseDown:function(a){c.addClass(a.cellNode,this.cellActiveClass);c.addClass(a.rowNode,this.rowActiveClass)},onCellMouseUp:function(a){c.removeClass(a.cellNode,this.cellActiveClass);c.removeClass(a.rowNode,this.rowActiveClass)},onCellClick:function(a){this._events.onCellClick.call(this,a);this.focus.contentMouseEvent(a)},
onCellDblClick:function(a){this.pluginMgr.isFixedCell(a.cell)||(!(1<this._click.length)||this._click[0]&&this._click[1]||(this._click[0]=this._click[1]=a),this._events.onCellDblClick.call(this,a))},onRowClick:function(a){this.edit.rowClick(a);a.cell&&this.plugin("indirectSelection")||this.selection.clickSelectEvent(a)},onRowContextMenu:function(a){!this.edit.isEditing()&&this.menus&&this.showMenu(a)},onSelectedRegionContextMenu:function(a){this.selectedRegionMenu&&(this.selectedRegionMenu._openMyself({target:a.target,
coords:a.keyCode!==b.F10&&"pageX"in a?{x:a.pageX,y:a.pageY}:null}),g.stop(a))},onHeaderCellMouseOut:function(a){a.cellNode&&(c.removeClass(a.cellNode,this.cellOverClass),c.removeClass(a.cellNode,this.headerCellActiveClass))},onHeaderCellMouseDown:function(a){a.cellNode&&c.addClass(a.cellNode,this.headerCellActiveClass)},onHeaderCellMouseUp:function(a){a.cellNode&&c.removeClass(a.cellNode,this.headerCellActiveClass)},onHeaderCellClick:function(a){this.focus.currentArea("header");a.cell.isRowSelector||
this._events.onHeaderCellClick.call(this,a);this.focus.headerMouseEvent(a)},onRowSelectorMouseDown:function(a){this.focus.focusArea("rowHeader",a)},onRowSelectorMouseUp:function(a){},onMouseUpRow:function(a){if(-1!=a.rowIndex)this.onRowMouseUp(a)},onRowMouseUp:function(a){}})});