diff --git a/designer/utslvcldebuger.tsf b/designer/utslvcldebuger.tsf index b9c0a28..4428296 100644 --- a/designer/utslvcldebuger.tsf +++ b/designer/utslvcldebuger.tsf @@ -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; diff --git a/funcext/tvclib/utslmemo.tsf b/funcext/tvclib/utslmemo.tsf index d784dbe..356a483 100644 --- a/funcext/tvclib/utslmemo.tsf +++ b/funcext/tvclib/utslmemo.tsf @@ -7,7 +7,7 @@ unit UTslMemo; {$define linuxpop} {$endif} interface -uses utslvclauxiliary,utslvclgdi,utslvclstdctl; +uses utslvclauxiliary,utslvclmemstruct,utslvclgdi,utslvclstdctl; type TMemoLineItem=class() //编辑字符串行对象 function Create(s); begin @@ -3931,6 +3931,7 @@ type TSynCustomMemo = class(TCustomMemo) function Create(AOwner);//构造 begin inherited; + FCOMPOSITIONFORM := new tagCOMPOSITIONFORM(nil); FTabChar := " "; end function Recycling();override; //回收 @@ -4048,7 +4049,37 @@ type TSynCustomMemo = class(TCustomMemo) property Highlighter:thighlighter read FHighlighter write SetHighlighter; //语法高亮 property Completion read FCompletion write SetCompletion; //自动完成 property TabChar read FTabChar write SetTabChar; + + public //输入法相关 + 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} private + FCOMPOSITIONFORM; FHighlighter; FCompletion; FTabChar; @@ -4305,6 +4336,7 @@ type TSynMemoNorm = class(TsynCustomMemo) // FSheetTabFlage; end Implementation + function CreateATslMemoUndoItem(AReason,AStart,AEnd,ChangeText,SelMode); begin return new TTslMemoUndoItem(AReason,AStart,AEnd,ChangeText,SelMode); diff --git a/funcext/tvclib/utslvclmemstruct.tsf b/funcext/tvclib/utslvclmemstruct.tsf index 5827ade..4a1a6de 100644 --- a/funcext/tvclib/utslvclmemstruct.tsf +++ b/funcext/tvclib/utslvclmemstruct.tsf @@ -1412,6 +1412,30 @@ type Ttagmoduleentry32=class(tslcstructureobj) property szmodule index "szmodule" read _getvalue_ write _setvalue_; property szexepath index "szexepath" read _getvalue_ write _setvalue_; end +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 implementation (* diff --git a/funcext/tvclib/utslvclstdctl.tsf b/funcext/tvclib/utslvclstdctl.tsf index c47330f..62a076e 100644 --- a/funcext/tvclib/utslvclstdctl.tsf +++ b/funcext/tvclib/utslvclstdctl.tsf @@ -4059,12 +4059,12 @@ type TCustomComboBoxbase=class(TCustomControl) if csDesigning in ComponentState then return; x := e.xpos; y := e.ypos; - if x>1 and y>1 then return ShowDropDown(true); - return ; + //if x>1 and y>1 then return ShowDropDown(true); if x>FBtnRect[0]and xFBtnRect[1]and y