예제 #1
0
        public void ShowContextMenu(IContextMenu menu, Point mapLocation)
        {
            StopTooltip();

            _activeContextMenu = menu;
            menu.Show(_control, mapLocation);
        }
예제 #2
0
 void OnGUI()
 {
     GUI.skin = GameResources.GUIskin;
     CurrentMenu.Show();
     if (CurrentContextMenu.isShown)
     {
         CurrentContextMenu.Show();
     }
 }
 private void showContextMenu(IContextMenu contextMenu, Point popupLocation)
 {
     contextMenu.Show(_view, popupLocation);
 }
예제 #4
0
파일: Map.cs 프로젝트: kindam/TWTactics
        public void ShowContextMenu(IContextMenu menu, Point mapLocation)
        {
            StopTooltip();

            _activeContextMenu = menu;
            menu.Show(_control, mapLocation);
        }
예제 #5
0
 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();
 }
예제 #7
0
        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();
                    }
                }
            }
        }