示例#1
0
        unsafe private IntPtr HandleIMR_DocumnetFeed(IntPtr lParam)
        {
            ImeDocumentFeedEventArgs e = new ImeDocumentFeedEventArgs();

            this.ImeDocumentFeed(this, e);
            if (lParam.ToInt32() != 0)
            {
                if (e.pos > e.Pragraph.Length)
                {
                    e.pos = e.Pragraph.Length;
                }
                else if (e.pos < 0)
                {
                    e.pos = 0;
                }

                RECONVERTSTRING *reconv    = (RECONVERTSTRING *)lParam.ToPointer();
                char *           paragraph = (char *)((byte *)reconv + sizeof(RECONVERTSTRING));
                reconv->dwSize            = (uint)sizeof(RECONVERTSTRING);
                reconv->dwVersion         = 0;
                reconv->dwStrLen          = (uint)e.Pragraph.Length;
                reconv->dwStrOffset       = (uint)sizeof(RECONVERTSTRING);
                reconv->dwCompStrLen      = 0;
                reconv->dwCompStrOffset   = 0;
                reconv->dwTargetStrLen    = 0;
                reconv->dwTargetStrOffset = (uint)e.pos * sizeof(char);
                for (int i = 0; i < e.Pragraph.Length; i++)
                {
                    paragraph[i] = e.Pragraph[i];
                }
            }
            return(new IntPtr(sizeof(RECONVERTSTRING) + e.Pragraph.Length * sizeof(char)));
        }
示例#2
0
        void Ime_ImeDocumentFeed(object sender, ImeDocumentFeedEventArgs e)
        {
            TextPoint tp = this.CaretPostion;

            e.Pragraph = this.LayoutLines[tp.row];
            e.pos      = tp.col;
        }