Esempio n. 1
0
        public static bool ShowWindow(char firstChar, ICompletionDataList list, ICompletionWidget completionWidget, CodeCompletionContext completionContext, System.Action closedDelegate)
        {
            try {
                if (wnd == null)
                {
                    wnd = new CompletionListWindow();

                    wnd.WordCompleted += HandleWndWordCompleted;
                }
                try {
                    if (!wnd.ShowListWindow(firstChar, list, completionWidget, completionContext, closedDelegate))
                    {
                        if (list is IDisposable)
                        {
                            ((IDisposable)list).Dispose();
                        }
                        DestroyWindow();
                        return(false);
                    }

                    if (ForceSuggestionMode)
                    {
                        wnd.AutoSelect = false;
                    }

                    OnWindowShown(EventArgs.Empty);
                    return(true);
                } catch {                //(Exception ex) {
                    //LoggingService.LogError (ex.ToString ());
                    return(false);
                }
            } finally {
                ParameterInformationWindowManager.UpdateWindow(completionWidget);
            }
        }
Esempio n. 2
0
 static void DestroyWindow()
 {
     isTemplateModes = false;
     if (wnd != null)
     {
         wnd.Destroy();
         ParameterInformationWindowManager.UpdateWindow(wnd.CompletionWidget);
         wnd = null;
     }
     ;
     OnWindowClosed(EventArgs.Empty);
 }
Esempio n. 3
0
        void Reposition(bool force)
        {
            X = CodeCompletionContext.TriggerXCoord - TextOffset;
            Y = CodeCompletionContext.TriggerYCoord;

            int w, h;

            GetSize(out w, out h);

            if (!force && previousHeight != h && previousWidth != w)
            {
                return;
            }

            Gdk.Rectangle geometry = Screen.GetMonitorGeometry(Screen.GetMonitorAtPoint(X, Y));

            previousHeight = h;
            previousWidth  = w;
            if (X + w > geometry.Right)
            {
                X = geometry.Right - w;
            }

            if (Y + h > geometry.Bottom || yPosition == WindowPositonY.Top)
            {
                Y         = Y - CodeCompletionContext.TriggerTextHeight - h;
                yPosition = WindowPositonY.Top;
            }
            else
            {
                yPosition = WindowPositonY.Bottom;
            }

            curXPos = X;
            curYPos = Y;
            Move(X, Y);
            UpdateDeclarationView();
            ParameterInformationWindowManager.UpdateWindow(CompletionWidget);
        }