Пример #1
0
        protected override void OnMouseClick(int x, int y, MouseButton button)
        {
            var contextMenu = new ComboboxContextMenu(_items, Width, _maxHeight)
            {
                X = ScreenCoordinateX, Y = ScreenCoordinateY
            };

            contextMenu.OnOptionSelected += _contextMenu_OnOptionSelected;
            UIManager.Add(contextMenu);

            base.OnMouseClick(x, y, button);
        }
Пример #2
0
        protected override void OnMouseClick(int x, int y, MouseButton button)
        {
            var contextMenu = new ComboboxContextMenu(_items, Width, _maxHeight)
            {
                X = ScreenCoordinateX, Y = ScreenCoordinateY
            };

            if (contextMenu.Height + ScreenCoordinateY > Engine.WindowHeight)
            {
                contextMenu.Y -= contextMenu.Height + ScreenCoordinateY - Engine.WindowHeight;
            }
            contextMenu.OnOptionSelected += _contextMenu_OnOptionSelected;
            Engine.UI.Add(contextMenu);
            base.OnMouseClick(x, y, button);
        }