public void ShowContextMenu(IContextMenu menu, Point mapLocation) { StopTooltip(); _activeContextMenu = menu; menu.Show(_control, mapLocation); }
void OnGUI() { GUI.skin = GameResources.GUIskin; CurrentMenu.Show(); if (CurrentContextMenu.isShown) { CurrentContextMenu.Show(); } }
private void showContextMenu(IContextMenu contextMenu, Point popupLocation) { contextMenu.Show(_view, popupLocation); }
public void Show(Control relativeTo) { handler.Show(relativeTo); }
public void should_tell_view_to_show_the_menu_at_point() { A.CallTo(() => _menu.Show(_view, _point)).MustHaveHappened(); }
protected void BaseHandleEvent(Event e) { if (IsInScrollView && !IsHandlingEventInternal || !IsEnabled) { return; } if (e != null) { if (WantsMouseEvents) { if (e.isMouse) { EventType type = e.type; Vector2 localMouse = e.mousePosition; if (Contains(localMouse)) { if (!IsMouseOver) { IsMouseOver = true; MouseEnterEvent(new MouseEventArgs(e.mousePosition, e.modifiers)); } if (type == EventType.MouseDown || type == EventType.MouseUp) { MouseButton mb = ConvertButton(e.button); MouseClickEventArgs args = new MouseClickEventArgs(e.mousePosition, e.modifiers, mb, e.clickCount); if (type == EventType.MouseDown) { MouseDownEvent(args); } else { MouseUpEvent(args); } if (args.Handled) { e.Use(); } } else if (type == EventType.ScrollWheel || type == EventType.MouseMove || type == EventType.MouseDrag) { MouseButton mb = ConvertButton(e.button); MouseMoveEventArgs args = new MouseMoveEventArgs(e.mousePosition, e.modifiers, mb, e.delta); if (type == EventType.ScrollWheel) { OnScrollWheel(args); } else if (type == EventType.MouseMove) { MouseMoveEvent(args); } else { MouseDragEvent(args); } if (args.Handled) { e.Use(); } } } else { if (IsMouseOver) { IsMouseOver = false; MouseLeaveEvent(new MouseEventArgs(e.mousePosition, e.modifiers)); } } } } if (ContextMenu != null && e.type != EventType.Used && e.type == EventType.ContextClick) { Vector2 localMouse = e.mousePosition; if (Contains(localMouse)) { ContextMenu.Show(this, e.mousePosition); e.Use(); } } } }