cocoa: preventing memo from getting focus while in design mode

git-svn-id: trunk@61474 -
This commit is contained in:
dmitry 2019-06-25 13:00:19 +00:00
parent 8466836623
commit 4f5ad5142a
2 changed files with 10 additions and 1 deletions

View File

@ -109,8 +109,11 @@ type
keyCaptured: Boolean;
wantReturns: Boolean;
preventInput: Boolean;
procedure dealloc; override;
function acceptsFirstResponder: LCLObjCBoolean; override;
function canBecomeKeyView: Boolean; override;
function undoManager: NSUndoManager; override;
function lclGetCallback: ICommonCallback; override;
procedure lclClearCallback; override;
@ -995,7 +998,12 @@ end;
function TCocoaTextView.acceptsFirstResponder: LCLObjCBoolean;
begin
Result := True;
Result := not preventInput;
end;
function TCocoaTextView.canBecomeKeyView: Boolean;
begin
Result := not preventInput;
end;
function TCocoaTextView.undoManager: NSUndoManager;

View File

@ -1444,6 +1444,7 @@ begin
TextViewSetAllignment(txt, TCustomMemo(AWinControl).Alignment);
txt.wantReturns := TCustomMemo(AWinControl).WantReturns;
txt.callback.SetTabSuppress(not TCustomMemo(AWinControl).WantTabs);
txt.preventInput := csDesigning in TCustomMemo(AWinControl).ComponentState;
Result := TLCLIntfHandle(scr);
end;