private void InputOnTouchDown() { // Handle context menu if (ContextMenu != null && !ContextMenu.Bounds.Contains(TouchPosition)) { var ev = ContextMenuClosing; if (ev != null) { var args = new ContextMenuClosingEventArgs(ContextMenu); ev(this, args); if (args.Cancel) { return; } } HideContextMenu(); } // Handle focus var activeWidget = GetTopWidget(true); if (activeWidget == null) { return; } // Widgets at the bottom of tree become focused Widget focusedWidget = null; ProcessWidgets(activeWidget, s => { if (s.Enabled && s.IsTouchOver && s.Active && s.AcceptsKeyboardFocus) { focusedWidget = s; } return(true); }); FocusedKeyboardWidget = focusedWidget; focusedWidget = null; ProcessWidgets(activeWidget, s => { if (s.Enabled && s.IsTouchOver && s.Active && s.AcceptsMouseWheelFocus) { focusedWidget = s; } return(true); }); if (focusedWidget != null || (FocusedMouseWheelWidget != null && FocusedMouseWheelWidget.MouseWheelFocusCanBeNull)) { FocusedMouseWheelWidget = focusedWidget; } }
private void DesktopOnContextMenuClosing(object sender, ContextMenuClosingEventArgs args) { // Prevent closing/opening of the context menu if (OpenMenuItem != null && OpenMenuItem.Bounds.Contains(Desktop.MousePosition)) { args.Cancel = true; } }
private void DesktopOnContextMenuClosing(object sender, ContextMenuClosingEventArgs args) { // Prevent autoclosing of the context menu if mouse is over combobox button // It'll be manually closed in the InternalChild_PressedChanged if (Bounds.Contains(Desktop.TouchPosition)) { args.Cancel = true; } }
private void InputOnMouseDown() { if (ContextMenu != null && !ContextMenu.Bounds.Contains(MousePosition)) { var ev = ContextMenuClosing; if (ev != null) { var args = new ContextMenuClosingEventArgs(ContextMenu); ev(this, args); if (args.Cancel) { return; } } HideContextMenu(); } }