From 312917e49c8a5beefa10f843f50b5bb4d36eed5b Mon Sep 17 00:00:00 2001 From: skalogryz Date: Wed, 23 Mar 2016 02:05:57 +0000 Subject: [PATCH] richmemo: workaround for SelStart not scrolling into the memo view. Activated with compiling the package with -dRMCARBONSELSTART option git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4584 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/richmemo/carbon/carbonrichmemo.pas | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/components/richmemo/carbon/carbonrichmemo.pas b/components/richmemo/carbon/carbonrichmemo.pas index 288f76347..70e00555d 100644 --- a/components/richmemo/carbon/carbonrichmemo.pas +++ b/components/richmemo/carbon/carbonrichmemo.pas @@ -82,6 +82,10 @@ type class procedure InDelText(const AWinControl: TWinControl; const TextUTF8: String; DstStart, DstLen: Integer); override; class function LoadRichText(const AWinControl: TWinControl; Src: TStream): Boolean; override; class function SaveRichText(const AWinControl: TWinControl; Dst: TStream): Boolean; override; + + {$ifdef RMCARBONSELSTART} + class procedure SetSelStart(const ACustomEdit: TCustomEdit; NewStart: integer); override; + {$endif} end; implementation @@ -442,6 +446,19 @@ begin CFRelease(data); end; end; +{$ifdef RMCARBONSELSTART} +class procedure TCarbonWSCustomRichMemo.SetSelStart( + const ACustomEdit: TCustomEdit; NewStart: integer); +var + edit : TCarbonRichEdit; +begin + edit := GetValidRichEdit(ACustomEdit); + if Assigned(edit) then begin + edit.SetSelStart(NewStart); + TXNShowSelection( HITextViewGetTXNObject( edit.Widget ), false); + end; +end; +{$ENDIF} { TCarbonRichEdit }