Amended Firemonkey Windows & MacOS Platform Edit & Memo Chinese input will cancel the original selection of the text after the BUG

Source: Internet
Author: User

Problem: Firemonkey The original selected text after Edit & Memo Chinese input on Windows & MacOS Platform

Applicable version: Delphi 10.1.2 & 10.2.1

Post-correction effect:

Fix code:

Please place FMX. Edit.Style.pas Copy to your project directory, and then modify the following code:

proceduretstylededit.imestateupdated;varCombinedtext:string;beginCombinedtext:=Ftextservice.combinedtext; Ftextlayout.text:=Combinedtext;  Setcaretposition (getorigincaretposition);  Model.settextwithoutvalidation (Combinedtext); ifFprompt <>Nil  Thenfprompt.visible:=Combinedtext.isempty;{+++>}{$IF Defined (IOS) or Defined (ANDROID)} //Add this line, correct the Chinese input will cancel the original selected text of the BUG by Aone (2017.11.17)  ifModel.sellength >0  Then  beginmodel.disablenotify; Trymodel.sellength:=0; finallymodel.enablenotify; End;  Updateselectionpointpositions; End;{+++>}{$ENDIF} //Add this line, correct the Chinese input will cancel the original selected text of the BUG by Aone (2017.11.17)linkobserversvaluemodified (self.observers);  dochangetracking; dotyping;End;

Please place FMX. Memo.Style.pas Copy to your project directory, and then modify the following code:

proceduretstyledmemo.imestateupdated;...    Slightly... SelectionChanged:= fselectedor(Fselstart <> Lcaret)or(Fselend <>Lcaret); CaretPosition:=Lcaret;{+++>}{$IF Defined (IOS) or Defined (ANDROID)} //Add this line, correct the Chinese input will cancel the original selected text of the BUG by Aone (2017.11.17)Fselstart: =Lcaret; Fselected:=False; Fselend:=Fselstart; Updateselectioninmodel;{+++>}{$ENDIF} //Add this line, correct the Chinese input will cancel the original selected text of the BUG by Aone (2017.11.17)    ifSelectionChanged Thenupdateselectionpointpositions; ifTextChanged Thenlinkobserversvaluemodified (self.observers); End;End;

Amended Firemonkey Windows & MacOS Platform Edit & Memo Chinese input will cancel the original selection of the text after the BUG

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.