mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 10:39:20 +02:00
cocoa: preventing memo from getting focus while in design mode
git-svn-id: trunk@61474 -
This commit is contained in:
parent
8466836623
commit
4f5ad5142a
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user