コード例 #1
0
        public override void GetRequiredPosition(TextEditor editor, Components.Window tipWindow, out int requiredWidth, out double xalign)
        {
            var win = (TooltipInformationWindow)tipWindow;

            requiredWidth = (int)win.Width;
            xalign        = 0.5;
        }
コード例 #2
0
        public override void ShowTooltipWindow(TextEditor editor, Components.Window tipWindow, TooltipItem item, Xwt.ModifierKeys modifierState, int mouseX, int mouseY)
        {
            base.ShowTooltipWindow(editor, tipWindow, item, modifierState, mouseX, mouseY);
            var info                      = (TaggedTooltipInformation <CodeActions.CodeActionContainer>)item.Item;
            var sourceEditorView          = editor.GetContent <SourceEditorView> ();
            var codeActionEditorExtension = editor.GetContent <CodeActionEditorExtension> ();
            var loc = editor.OffsetToLocation(info.Tag.Span.Start);

            if (info.Tag?.FloatingWidgetShown == true)
            {
                var point = sourceEditorView.TextEditor.TextArea.LocationToPoint(loc.Line, loc.Column);
                point.Y += (int)editor.GetLineHeight(loc.Line);
                var window = (LanguageItemWindow)tipWindow;
                if (floatingWidget != null)
                {
                    floatingWidget.Destroy();
                    floatingWidget = null;
                }
                floatingWidget = new FloatingQuickFixIconWidget(codeActionEditorExtension, window, sourceEditorView, SmartTagSeverity.ErrorFixes, info.Tag, point);
                sourceEditorView.TextEditor.GdkWindow.GetOrigin(out int ox, out int oy);
                floatingWidget.Move(ox + (int)point.X, oy + (int)(point.Y + 4));
                window.Tag = floatingWidget;
                window.EnterNotifyEvent += delegate {
                    floatingWidget.CancelDestroy();
                };
                window.LeaveNotifyEvent += delegate {
                    floatingWidget.QueueDestroy();
                };
            }
        }
コード例 #3
0
        public override bool GetIsFullscreen(Components.Window window)
        {
            WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT();

            lpwndpl.length = Marshal.SizeOf(lpwndpl);

            Gtk.Window controlWindow = window;
            IntPtr     handle        = GdkWin32.HgdiobjGet(controlWindow.GdkWindow);

            Win32.GetWindowPlacement(handle, ref lpwndpl);
            return(lpwndpl.showCmd == Win32.SW_SHOWMAXIMIZED);
        }
コード例 #4
0
 public override bool IsInteractive(TextEditor editor, Components.Window tipWindow)
 {
     return(true);
 }
コード例 #5
0
 public static Task <bool> Run(string url, SupportedCredentialTypes types, Credentials cred, Components.Window parentWindow = null)
 {
     return(Runtime.RunInMainThread(() => {
         var engine = Platform.IsMac ? Toolkit.NativeEngine : Toolkit.CurrentEngine;
         var response = false;
         engine.Invoke(() => {
             using (var xwtDialog = new XwtCredentialsDialog(url, types, cred)) {
                 response = xwtDialog.Run(parentWindow ?? IdeServices.DesktopService.GetFocusedTopLevelWindow()) == Command.Ok;
             }
         });
         return response;
     }));
 }
コード例 #6
0
 public MessageDialogProgressMonitor(bool showProgress, bool allowCancel, bool showDetails, bool hideWhenDone, Components.Window parent)
     : base(Runtime.MainSynchronizationContext)
 {
     if (showProgress)
     {
         var parentWindow = parent ?? DesktopService.GetFocusedTopLevelWindow();
         dialog         = new ProgressDialog(parentWindow, allowCancel, showDetails);
         dialog.Message = "";
         MessageService.PlaceDialog(dialog, parentWindow);
         dialog.Show();
         dialog.CancellationTokenSource = CancellationTokenSource;
         DispatchService.RunPendingEvents();
         this.hideWhenDone = hideWhenDone;
         this.showDetails  = showDetails;
     }
 }
コード例 #7
0
 public override void SetIsFullscreen(Components.Window window, bool isFullscreen)
 {
     //no-op as we have not yet implemented this
 }
コード例 #8
0
 public override bool GetIsFullscreen(Components.Window window)
 {
     //the Fullscreen functionality is broken in GTK on Win7+
     //TODO: implement a workaround.
     return(false);
 }
コード例 #9
0
 public QuickAccessKeywordAssignedWindow(Components.Window window)
 {
     this.window = window;
     InitializeComponent();
 }