コード例 #1
0
        CodeCompletionContext ICompletionWidget.CreateCodeCompletionContext(int triggerOffset)
        {
            CodeCompletionContext c = new CodeCompletionContext();

            c.TriggerLine       = 0;
            c.TriggerOffset     = triggerOffset;
            c.TriggerLineOffset = c.TriggerOffset;
            c.TriggerTextHeight = editEntry.SizeRequest().Height;
            c.TriggerWordLength = currentCompletionData.ExpressionLenght;

            int x, y;
            int tx, ty;

            editEntry.GdkWindow.GetOrigin(out x, out y);
            editEntry.GetLayoutOffsets(out tx, out ty);
            int cp = editEntry.TextIndexToLayoutIndex(editEntry.Position);

            Pango.Rectangle rect = editEntry.Layout.IndexToPos(cp);
            tx += Pango.Units.ToPixels(rect.X) + x;
            y  += editEntry.Allocation.Height;

            c.TriggerXCoord = tx;
            c.TriggerYCoord = y;
            return(c);
        }