mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 12:59:19 +02:00
added overridable TCarbonMemo creation options
git-svn-id: trunk@20451 -
This commit is contained in:
parent
fde74a01fe
commit
610acd9c4d
@ -173,6 +173,7 @@ type
|
|||||||
procedure CreateWidget(const AParams: TCreateParams); override;
|
procedure CreateWidget(const AParams: TCreateParams); override;
|
||||||
procedure DestroyWidget; override;
|
procedure DestroyWidget; override;
|
||||||
procedure GetLineOffset(AIndex: Integer; out AStart, AEnd: TXNOffset);
|
procedure GetLineOffset(AIndex: Integer; out AStart, AEnd: TXNOffset);
|
||||||
|
function GetCreationOptions: TXNFrameOptions; virtual;
|
||||||
public
|
public
|
||||||
procedure TextDidChange; override;
|
procedure TextDidChange; override;
|
||||||
function GetTextObject: TXNObject;
|
function GetTextObject: TXNObject;
|
||||||
@ -1387,15 +1388,10 @@ end;
|
|||||||
procedure TCarbonMemo.CreateWidget(const AParams: TCreateParams);
|
procedure TCarbonMemo.CreateWidget(const AParams: TCreateParams);
|
||||||
var
|
var
|
||||||
Control: ControlRef;
|
Control: ControlRef;
|
||||||
Options: OptionBits;
|
|
||||||
R: HIRect;
|
R: HIRect;
|
||||||
begin
|
begin
|
||||||
Options := kTXNMonostyledTextMask // disable more font styles
|
|
||||||
or kTXNDontDrawSelectionWhenInactiveMask // hide selection, when inactive
|
|
||||||
or kOutputTextInUnicodeEncodingMask;
|
|
||||||
|
|
||||||
R := ParamsToHIRect(AParams);
|
R := ParamsToHIRect(AParams);
|
||||||
if OSError(HITextViewCreate(@R, 0, Options, Control),
|
if OSError(HITextViewCreate(@R, 0, GetCreationOptions, Control),
|
||||||
Self, SCreateWidget, 'HITextViewCreate') then RaiseCreateWidgetError(LCLObject);
|
Self, SCreateWidget, 'HITextViewCreate') then RaiseCreateWidgetError(LCLObject);
|
||||||
|
|
||||||
Widget := Control;
|
Widget := Control;
|
||||||
@ -1489,6 +1485,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
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
|
Method: TCarbonMemo.TextDidChange
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user