mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 01:29:55 +02:00
cocoa: returning callback object for the secured field. Issue #0034773
git-svn-id: branches/fixes_2_0@59956 -
This commit is contained in:
parent
fd8caba208
commit
a9797882f4
@ -84,6 +84,8 @@ type
|
||||
callback: ICommonCallback;
|
||||
function acceptsFirstResponder: LCLObjCBoolean; override;
|
||||
procedure resetCursorRects; override;
|
||||
function lclGetCallback: ICommonCallback; override;
|
||||
procedure lclClearCallback; override;
|
||||
// key
|
||||
procedure keyUp(event: NSEvent); override;
|
||||
// mouse
|
||||
@ -97,7 +99,6 @@ type
|
||||
procedure mouseMoved(event: NSEvent); override;
|
||||
end;
|
||||
|
||||
|
||||
{ TCocoaTextView }
|
||||
|
||||
TCocoaTextView = objcclass(NSTextView, NSTextDelegateProtocol, NSTextViewDelegateProtocol)
|
||||
@ -137,6 +138,14 @@ type
|
||||
procedure lclExpectedKeys(var wantTabs, wantArrows, wantReturn, wantAll: Boolean); override;
|
||||
end;
|
||||
|
||||
{ TCococaFieldEditorExt }
|
||||
|
||||
TCococaFieldEditorExt = objccategory(NSTextView)
|
||||
// this override should take care of any Cocoa editors possible
|
||||
// for example NSSecureTextView used with TCocoaSecureField aka NSSecureTextField
|
||||
function lclGetCallback: ICommonCallback; reintroduce;
|
||||
end;
|
||||
|
||||
{ TCocoaFieldEditor }
|
||||
|
||||
TCocoaFieldEditor = objcclass(NSTextView)
|
||||
@ -414,6 +423,18 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TCococaFieldEditorExt }
|
||||
|
||||
function TCococaFieldEditorExt.lclGetCallback: ICommonCallback;
|
||||
begin
|
||||
if isFieldEditor and Assigned(delegate) then
|
||||
begin
|
||||
Result := NSObject(delegate).lclGetCallback;
|
||||
end
|
||||
else
|
||||
Result := inherited lclGetCallback;
|
||||
end;
|
||||
|
||||
{ TCocoaSpinEditStepper }
|
||||
|
||||
function TCocoaSpinEditStepper.acceptsFirstMouse(event: NSEvent): LCLObjCBoolean;
|
||||
@ -979,6 +1000,16 @@ begin
|
||||
inherited resetCursorRects;
|
||||
end;
|
||||
|
||||
function TCocoaSecureTextField.lclGetCallback: ICommonCallback;
|
||||
begin
|
||||
Result := callback;
|
||||
end;
|
||||
|
||||
procedure TCocoaSecureTextField.lclClearCallback;
|
||||
begin
|
||||
callback := nil;
|
||||
end;
|
||||
|
||||
procedure TCocoaSecureTextField.keyUp(event: NSEvent);
|
||||
var
|
||||
res : Boolean;
|
||||
|
Loading…
Reference in New Issue
Block a user