示例#1
0
        void IActionTextLineMarker.MouseHover(Mono.TextEditor.MonoTextEditor editor, MarginMouseEventArgs args, TextLineMarkerHoverResult result)
        {
            if (args.Button != 0)
            {
                return;
            }
            var line = editor.GetLine(loc.Line);

            if (line == null)
            {
                return;
            }
            var          x = editor.ColumnToX(line, loc.Column) - editor.HAdjustment.Value + editor.TextViewMargin.TextStartPosition;
            var          y = editor.LineToY(line.LineNumber + 1) - editor.VAdjustment.Value;
            const double xAdditionalSpace = tagMarkerWidth;

            if (args.X - x >= -xAdditionalSpace * editor.Options.Zoom &&
                args.X - x < (tagMarkerWidth + xAdditionalSpace) * editor.Options.Zoom /*&&
                                                                                        * args.Y - y < (editor.LineHeight / 2) * editor.Options.Zoom*/)
            {
                result.Cursor = null;
                ShowPopup?.Invoke(null, null);
            }
            else
            {
                CancelPopup?.Invoke(null, null);
            }
        }
示例#2
0
    static void Init()
    {
        ShowPopup window = ScriptableObject.CreateInstance <ShowPopup>();

        window.position = new Rect(Screen.width / 2, Screen.height / 2, 250, 150);
        window.ShowPopup();
    }
 public override void InformMousePress(MonoTextEditor editor, Margin margin, MarginMouseEventArgs args)
 {
     if (!(margin is QuickFixMargin))
     {
         return;
     }
     ShowPopup?.Invoke(this, EventArgs.Empty);
 }
示例#4
0
 public void Handle(ShowPopup message)
 {
     if (!PopupIsOpen)
     {
         PopupWidth = message.Width;
         PopupHeight = message.Height;
         PopupItem = message.Popup;
         PopupItem.Activate();
         PopupIsOpen = true;         
     }
 }
 private void Start()
 {
     IButton showPopup   = new ShowPopup(_showPopupButton, _popup, _exitPopupButton);
     IButton displayText = new DisplayText(_displayTextButton, _displayText);
     IButton playSound   = new PlaySound(_playSoundButton, _audio);
 }
示例#6
0
 // Menu Event
 private void contextMenu_Opened(object sender, EventArgs e)
 {
     ShowPopup.Begin();
 }