win32: implement IME input support for Edit controls. KeyUp (for VK_RETURN) event is supressed if IME composition is finished, bug #16430

git-svn-id: trunk@26984 -
This commit is contained in:
dmitry 2010-08-02 23:52:51 +00:00
parent a58662c257
commit f017af8aaa
2 changed files with 14 additions and 0 deletions

View File

@ -1024,6 +1024,12 @@ begin
end; end;
end; end;
lWinControl := WindowInfo^.AWinControl; lWinControl := WindowInfo^.AWinControl;
{for ComboBox IME sends WM_IME_NOTIFY with WParam=WM_IME_ENDCOMPOSITION}
if (Msg = WM_IME_NOTIFY) and (WPARAM=WM_IME_ENDCOMPOSITION) then
begin
if Assigned(WindowInfo) then WindowInfo^.IMEComposed:=True;
end;
// filter messages we want to pass on to LCL // filter messages we want to pass on to LCL
if (Msg <> WM_KILLFOCUS) and (Msg <> WM_SETFOCUS) and (Msg <> WM_NCDESTROY) if (Msg <> WM_KILLFOCUS) and (Msg <> WM_SETFOCUS) and (Msg <> WM_NCDESTROY)
and ((Msg < WM_KEYFIRST) or (Msg > WM_KEYLAST)) and ((Msg < WM_KEYFIRST) or (Msg > WM_KEYLAST))
@ -1095,6 +1101,11 @@ begin
end; end;
end; end;
end; end;
WM_IME_ENDCOMPOSITION:
begin
{IME Windows the composition has finished}
if Assigned(WindowInfo) then WindowInfo^.IMEComposed:=True;
end;
BM_SETCHECK: BM_SETCHECK:
begin begin
LMessage.Msg := LM_CHANGED; LMessage.Msg := LM_CHANGED;
@ -1562,6 +1573,7 @@ begin
Assert(False,Format('WM_KEYDOWN KeyData= %d CharCode= %d ',[KeyData,CharCode])); Assert(False,Format('WM_KEYDOWN KeyData= %d CharCode= %d ',[KeyData,CharCode]));
Assert(False,' lWinControl= '+TComponent(lWinControl).Name+':'+lWinControl.ClassName); Assert(False,' lWinControl= '+TComponent(lWinControl).Name+':'+lWinControl.ClassName);
end; end;
if Assigned(WindowInfo) then WindowInfo^.IMEComposed:=False;
WinProcess := false; WinProcess := false;
end; end;
WM_KEYUP: WM_KEYUP:
@ -1577,6 +1589,7 @@ begin
Assert(False,Format('WM_KEYUP KeyData= %d CharCode= %d ',[KeyData,CharCode])); Assert(False,Format('WM_KEYUP KeyData= %d CharCode= %d ',[KeyData,CharCode]));
end; end;
WinProcess := false; WinProcess := false;
if Assigned(WindowInfo) and WindowInfo^.IMEComposed then LMKey.Msg:=LM_NULL;
end; end;
WM_KILLFOCUS: WM_KILLFOCUS:
begin begin

View File

@ -65,6 +65,7 @@ Type
DispInfoTextA: array [0..LV_DISP_INFO_COUNT-1] of AnsiString; // buffer for ListView LVN_GETDISPINFO notification DispInfoTextA: array [0..LV_DISP_INFO_COUNT-1] of AnsiString; // buffer for ListView LVN_GETDISPINFO notification
DispInfoTextW: array [0..LV_DISP_INFO_COUNT-1] of WideString; // it's recommended to keep buffer unchanged DispInfoTextW: array [0..LV_DISP_INFO_COUNT-1] of WideString; // it's recommended to keep buffer unchanged
DispInfoIndex: Integer; // between 2 calls of LVN_GETDISPINFO DispInfoIndex: Integer; // between 2 calls of LVN_GETDISPINFO
IMEComposed: Boolean;
case integer of case integer of
0: (spinValue: Double); 0: (spinValue: Double);
1: ( 1: (