/// <summary> /// Remap event.keyCode in horizontalLayout so that arrow /// keys work properly and call original onKeyDown handler. /// </summary> /// <param name="e">The browser event.</param> /// <returns>The handled value.</returns> public override bool onKeyDown(goog.events.BrowserEvent e) { if (this.horizontalLayout_) { var map = new Dictionary <goog.events.KeyCodes, goog.events.KeyCodes>(); map[goog.events.KeyCodes.RIGHT] = goog.events.KeyCodes.DOWN; map[goog.events.KeyCodes.LEFT] = goog.events.KeyCodes.UP; map[goog.events.KeyCodes.UP] = goog.events.KeyCodes.LEFT; map[goog.events.KeyCodes.DOWN] = goog.events.KeyCodes.RIGHT; var newKeyCode = map.ContainsKey((goog.events.KeyCodes)e.keyCode); e.keyCode = (int)(newKeyCode ? map[(goog.events.KeyCodes)e.keyCode] : (goog.events.KeyCodes)e.keyCode); } return(base.onKeyDown(e)); }
/// <summary> /// Expand or collapse the node on mouse click. /// </summary> /// <param name="e">The browser event.</param> public override void onMouseDown(goog.events.BrowserEvent e) { // Expand icon. if (this.hasChildren() && this.isUserCollapsible_) { this.toggle(); this.select(); } else if (this.isSelected()) { this.getTree().setSelectedItem(null); } else { this.select(); } this.updateRow(); }
/// <summary> /// Supress the inherited double-click behaviour. /// </summary> /// <param name="e">The browser event.</param> internal override void onDoubleClick_(goog.events.BrowserEvent e) { // NOP. }