界面库

将输入法相关代码已入到底层库
This commit is contained in:
JianjunLiu
2023-05-11 14:42:09 +08:00
parent 6f0bb71708
commit 759e06ea4a
4 changed files with 61 additions and 57 deletions
+1 -53
View File
@@ -64,7 +64,6 @@ type TFTSLScriptcustomMemo=class(TSYNmemoNorm)
FChangedFlag := false;
FChangedLock := false;
Lineinterval := 3;
FCOMPOSITIONFORM := new tagCOMPOSITIONFORM(nil);
font := array("height":18,"width":9,"escapement":0,"orientation":0,"weight":400,"italic":0,"underline":0,"strikeout":0,
"charset":0,"outprecision":0,"clipprecision":0,"quality":1,"pitchandfamily":1,"facename":"Courier New","color":0);
//134
@@ -79,33 +78,6 @@ type TFTSLScriptcustomMemo=class(TSYNmemoNorm)
if HandleAllocated()then calldatafunction(FOnCaretChanged,self(true),new tuieventbase(0,0,0,0));
//echo tostn(self.CaretXY);
end
function WMIMESTARTCOMPOSITION(o,e):WM_IME_STARTCOMPOSITION;virtual;
begin
ime := ImmGetContext(self.Handle);
FCOMPOSITIONFORM.ptcurrentpos.cx := 200;
FCOMPOSITIONFORM.ptcurrentpos.cy := 200;
ImmSetCompositionWindow(ime,FCOMPOSITIONFORM._getptr_());
ImmReleaseContext(self.Handle,ime);
end
{$ifdef linux}
function ImmReleaseContext();
begin
end;
function ImmGetContext();
begin
end;
function ImmSetCompositionWindow();
begin
end;
function ImmSetStatusWindowPos();
begin
end;
{$else}
function ImmReleaseContext(h:pointer;ime:pointer):integer;stdcall;external "Imm32.dll" name "ImmReleaseContext";
function ImmGetContext(h:pointer):pointer;stdcall;external "Imm32.dll" name "ImmGetContext";
function ImmSetCompositionWindow(h:pointer;s:pointer):integer;stdcall;external "Imm32.dll" name "ImmSetCompositionWindow";
function ImmSetStatusWindowPos(h:pointer;s:pointer):integer;stdcall;external "Imm32.dll" name "ImmSetStatusWindowPos";
{$endif}
function InvalidateLines(FirstLine,LastLine:integer);override;
begin
if not HandleAllocated()then return;
@@ -306,34 +278,10 @@ type TFTSLScriptcustomMemo=class(TSYNmemoNorm)
FOnTextChanged;
FOnTextSetFocus;
FQuckKeys;
FCOMPOSITIONFORM;
FOnCaretChanged;
end
implementation
type tagCOMPOSITIONFORM=class(tslcstructureobj)
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array(
("dwstyle","int",4),
("ptcurrentpos","intptr",0),
("rcarea","int[4]",array(0,0,0,0))),nil,nil,1);
return SSTRUCT;
end
public
function create()
begin
inherited create(getstruct(),ptr);
FPonter := new TCPoint();
_setvalue_("ptcurrentpos",FPonter._getptr_());
end
property dwstyle index "dwstyle" read _getvalue_ write _setvalue_;
property ptcurrentpos read FPonter;
property rcarea index "rcarea" read _getvalue_ write _setvalue_;
private
FPonter;
end
type TTslDebuga=class(TCustomControl)
private //成员变量
frunbtncall;