ICSharpCode.TextEditor.Ime.SetIMEWindowLocation C# (CSharp) Метод

SetIMEWindowLocation() публичный Метод

public SetIMEWindowLocation ( int x, int y ) : void
x int
y int
Результат void
		public void SetIMEWindowLocation(int x, int y)
		{
			if (disableIME || hIMEWnd == IntPtr.Zero) return;

			POINT p = new POINT();
			p.x = x;
			p.y = y;

			COMPOSITIONFORM lParam = new COMPOSITIONFORM();
			lParam.dwStyle = CFS_POINT;
			lParam.ptCurrentPos = p;
			lParam.rcArea = new RECT();

			try {
				SendMessage(
					hIMEWnd,
					WM_IME_CONTROL,
					new IntPtr(IMC_SETCOMPOSITIONWINDOW),
					lParam
				);
			} catch (AccessViolationException ex) {
				Handle(ex);
			}
		}
		

Usage Example

Пример #1
0
        public void UpdateCaretPosition()
        {
            Log("UpdateCaretPosition");

            if (caretImplementation.RequireRedrawOnPositionChange)
            {
                textArea.UpdateLine(oldLine);
                if (line != oldLine)
                {
                    textArea.UpdateLine(line);
                }
            }
            else
            {
                if (textArea.MotherTextAreaControl.TextEditorProperties.LineViewerStyle == LineViewerStyle.FullRow && oldLine != line)
                {
                    textArea.UpdateLine(oldLine);
                    textArea.UpdateLine(line);
                }
            }
            oldLine = line;


            if (hidden || textArea.MotherTextEditorControl.IsInUpdate)
            {
                outstandingUpdate = true;
                return;
            }
            else
            {
                outstandingUpdate = false;
            }
            ValidateCaretPos();
            int lineNr = this.line;
            int xpos   = textArea.TextView.GetDrawingXPos(lineNr, this.column);
            //LineSegment lineSegment = textArea.Document.GetLineSegment(lineNr);
            Point pos = ScreenPosition;

            if (xpos >= 0)
            {
                CreateCaret();
                bool success = caretImplementation.SetPosition(pos.X, pos.Y);
                if (!success)
                {
                    caretImplementation.Destroy();
                    caretCreated = false;
                    UpdateCaretPosition();
                }
            }
            else
            {
                caretImplementation.Destroy();
            }

            // set the input method editor location
            if (ime == null)
            {
                ime = new Ime(textArea.Handle, textArea.Document.TextEditorProperties.Font);
            }
            else
            {
                ime.HWnd = textArea.Handle;
                ime.Font = textArea.Document.TextEditorProperties.Font;
            }
            ime.SetIMEWindowLocation(pos.X, pos.Y);

            currentPos = pos;
        }