From 610acd9c4d9e205c392e21746938c4f2740f3712 Mon Sep 17 00:00:00 2001 From: dmitry Date: Fri, 5 Jun 2009 16:50:21 +0000 Subject: [PATCH] added overridable TCarbonMemo creation options git-svn-id: trunk@20451 - --- lcl/interfaces/carbon/carbonedits.pp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lcl/interfaces/carbon/carbonedits.pp b/lcl/interfaces/carbon/carbonedits.pp index f612575c5c..a420180823 100644 --- a/lcl/interfaces/carbon/carbonedits.pp +++ b/lcl/interfaces/carbon/carbonedits.pp @@ -173,6 +173,7 @@ type procedure CreateWidget(const AParams: TCreateParams); override; procedure DestroyWidget; override; procedure GetLineOffset(AIndex: Integer; out AStart, AEnd: TXNOffset); + function GetCreationOptions: TXNFrameOptions; virtual; public procedure TextDidChange; override; function GetTextObject: TXNObject; @@ -1387,15 +1388,10 @@ end; procedure TCarbonMemo.CreateWidget(const AParams: TCreateParams); var Control: ControlRef; - Options: OptionBits; R: HIRect; begin - Options := kTXNMonostyledTextMask // disable more font styles - or kTXNDontDrawSelectionWhenInactiveMask // hide selection, when inactive - or kOutputTextInUnicodeEncodingMask; - R := ParamsToHIRect(AParams); - if OSError(HITextViewCreate(@R, 0, Options, Control), + if OSError(HITextViewCreate(@R, 0, GetCreationOptions, Control), Self, SCreateWidget, 'HITextViewCreate') then RaiseCreateWidgetError(LCLObject); Widget := Control; @@ -1489,6 +1485,13 @@ begin end; end; +function TCarbonMemo.GetCreationOptions: TXNFrameOptions; +begin + Result := kTXNMonostyledTextMask // disable more font styles + or kTXNDontDrawSelectionWhenInactiveMask // hide selection, when inactive + or kOutputTextInUnicodeEncodingMask +end; + {------------------------------------------------------------------------------ Method: TCarbonMemo.TextDidChange