291a292,295
> // DW
> procedure WMImeSetContext(var Msg: TMessage); message WM_IME_SETCONTEXT;
> procedure WMImeEndComposition(var Msg: TMessage); message WM_IME_ENDCOMPOSITION;
> procedure SetCustomCompo(Value : boolean);
315a320,322
> fPbuffer : pchar;
> fCustomComposition : Boolean;
> fOldContext : Cardinal;
811a819,821
> // DW - for Unisyn Bug fix
> UseUniSyn : boolean;
>
886a897,900
> // For Custom Composition User setting flag, Do-wan Kim
> {$IFDEF SYN_MBCSSUPPORT}
> property CustomComposition : boolean read FCustomComposition write SetCustomCompo;
> {$ENDIF}
891a906,910
> // For Custom Composition User setting flag, Do-wan Kim
> {$IFDEF SYN_MBCSSUPPORT}
> public
> property CustomComposition;
> {$ENDIF}
1251a1271,1272
> // DW
> UseUniSyn := false;
1342a1364,1365
> Getmem(fPBuffer,100);
> fCustomComposition := True;
1461c1484,1487
<
---
> // DW
> {$IFDEF SYN_MBCSSUPPORT}
> FreeMem(fPbuffer,100);
> {$ENDIF}
1741a1768,1799
> // added for Setup Composition mode
> procedure TCustomSynEdit.SetCustomCompo(Value : boolean);
> begin
> FCustomComposition := Value;
> SendMessage(handle,WM_IME_SETCONTEXT,1,FOldContext);
> end;
>
> // added for Delete Composition gabage at WM_IME_ENDCOMPOSITION
> // by Do-wan Kim
> procedure TCustomSynEdit.WMImeEndComposition(var Msg: TMessage);
> begin
> if not ReadOnly then
> if FCustomComposition then begin
> fpBuffer[0] := #0;
> CommandProcessor(ecImeStr, #0, fpBuffer);
> end;
> inherited;
> end;
> // added for Don't Show Composition window
> // by Do-wan Kim
> procedure TCustomSynEdit.WMImeSetContext(var Msg: TMessage);
> begin
> if FCustomComposition then
> Msg.LParam := Msg.LParam and (not ISC_SHOWUICOMPOSITIONWINDOW)
> else
> Msg.LParam := Msg.LParam or longint(ISC_SHOWUICOMPOSITIONWINDOW);
> FOldContext := Msg.LParam;
> inherited;
> end;
>
> // modified for own draw , Do-wan Kim
> // by Do-wan Kim
1745c1803,1807
< p: PChar;
---
> //p: PChar;
> //oldFont : TFont;
> px : TPoint;
> bl : TColor;
> pl : tagCompositionForm;
1747,1748c1809,1810
< if ((Msg.LParam and GCS_RESULTSTR) <> 0) then
< begin
---
> if ((Msg.LParam and (GCS_RESULTSTR or GCS_COMPSTR)) <> 0) then begin
>
1750a1813
> if (msg.LParam and GCS_RESULTSTR)<>0 then begin
1752c1815
< GetMem(p, fImeCount + 1);
---
> //GetMem(p, fImeCount + 1);
1754,1756c1817,1819
< ImmGetCompositionString(imc, GCS_RESULTSTR, p, fImeCount + 1);
< p[fImeCount] := #0;
< CommandProcessor(ecImeStr, #0, p);
---
> ImmGetCompositionString(imc, GCS_RESULTSTR, fpBuffer, fImeCount + 1);
> fpBuffer[fImeCount] := #0;
> CommandProcessor(ecImeStr, #0, fpBuffer);
1758c1821
< FreeMem(p, fImeCount + 1);
---
> //FreeMem(p, fImeCount + 1);
1759a1823,1852
> end;
> if not ReadOnly then begin
> if FCustomComposition then begin
> // Not Use ImmGetCompositionString. It cause getting incorret string.
> // May it not Over 2 byte string?
> //fImeCount := 3;
> fpBuffer[0] := char(Msg.WParam shr 8);
> fpBuffer[1] := char(Msg.WParam and $00ff);
> fpBuffer[2] := #0;
> GetCaretPos(px);
> //oldfont := Canvas.Font;
> Canvas.Font := Font;
> Canvas.Font.Color := clHighlightText;
> bl := Canvas.Brush.Color;
> Canvas.Brush.Color := clHighlight;
> Canvas.TextOut(px.x, px.y-1, fpBuffer);
> Canvas.Brush.Color := bl;
> //Canvas.Font := OldFont;
> sendmessage(handle,WM_PAINT,0,0);
> end else begin
> // It place Composition Window at WM_IME_STARTCOMPOSITION
> // First Composition Window position is 0,0 on Screen,
> // It Fix that bug.
> ImmGetCompositionWindow(imc,@pl);
> GetCaretPos(px);
> pl.dwStyle := CFS_POINT;
> pl.ptCurrentPos := px;
> ImmSetCompositionWindow(imc,@pl);
> end;
> end; // if not ReadOnly
2305c2398
< for i := 1 to MAX_MARKS do
---
> for i := 0 to MAX_MARKS-1 do
2309c2402,2404
< Inc(offs, BookMarkOptions.XOffset);
---
> if (not allmrk[i].InternalImage) and Assigned(fBookMarkOpt.BookmarkImages) then
> begin
> Inc(offs, BookMarkOptions.Xoffset);
2315c2410,2414
< end;
---
> end else begin
> mark := allmrk[i];
> break;
> end;
> end;
2421c2520
< aGutterOff := fBookMarkOpt.XOffset;
---
> aGutterOff := 0; //modified
3300a3400,3402
> {$IFDEF SYN_MBCSSUPPORT}
> if ByteType(sToken,nTokenLen)<>mbSingleByte then inc(nTokenLen);
> {$ENDIF}
3321a3424,3425
> // DW = Unisyn Bug fix
> if not UseUniSyn then
4431a4536,4538
> // In ime98, composition window appeares at ImmSetCompositonWindow.
> // Cause disabled when CustomComposition mode
> if not FCustomComposition then begin
4434a4542
> end;
Patch generated by WinMerge