mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 12:30:36 +02:00
cocoa: Implements spinedit.OnChange
git-svn-id: trunk@49588 -
This commit is contained in:
parent
df9663860c
commit
29edd0c013
@ -62,6 +62,7 @@ type
|
||||
procedure DidBecomeKeyNotification;
|
||||
procedure DidResignKeyNotification;
|
||||
procedure SendOnChange;
|
||||
procedure SendOnTextChanged;
|
||||
// non event methods
|
||||
function DeliverMessage(Msg: Cardinal; WParam: WParam; LParam: LParam): LResult;
|
||||
function GetPropStorage: TStringList;
|
||||
@ -3640,6 +3641,8 @@ begin
|
||||
lNSStr := CocoaUtils.NSStringUtf8(lStr);
|
||||
Edit.setStringValue(lNSStr);
|
||||
lNSStr.release;
|
||||
// This implements OnChange for both user and code changes
|
||||
if callback <> nil then callback.SendOnTextChanged();
|
||||
end;
|
||||
|
||||
function TCocoaSpinEdit.acceptsFirstResponder: Boolean;
|
||||
@ -3786,6 +3789,8 @@ begin
|
||||
lNSStr := CocoaUtils.NSStringUtf8(lStr);
|
||||
setStringValue(lNSStr);
|
||||
lNSStr.release;
|
||||
// This implements OnChange for both user and code changes
|
||||
if callback <> nil then callback.SendOnTextChanged();
|
||||
end;
|
||||
|
||||
function TCocoaSpinEdit.GetFieldEditor: TCocoaFieldEditor;
|
||||
|
@ -62,6 +62,7 @@ type
|
||||
procedure DidBecomeKeyNotification; virtual;
|
||||
procedure DidResignKeyNotification; virtual;
|
||||
procedure SendOnChange; virtual;
|
||||
procedure SendOnTextChanged; virtual; // text controls (like spin) respond to OnChange for this event, but not for SendOnChange
|
||||
|
||||
function DeliverMessage(var Msg): LRESULT; virtual; overload;
|
||||
function DeliverMessage(Msg: Cardinal; WParam: WParam; LParam: LParam): LResult; virtual; overload;
|
||||
@ -981,19 +982,24 @@ end;
|
||||
|
||||
procedure TLCLCommonCallback.DidBecomeKeyNotification;
|
||||
begin
|
||||
LCLSendActivateMsg(Target, WA_ACTIVE, false);
|
||||
LCLSendSetFocusMsg(Target);
|
||||
LCLSendActivateMsg(Target, WA_ACTIVE, false);
|
||||
LCLSendSetFocusMsg(Target);
|
||||
end;
|
||||
|
||||
procedure TLCLCommonCallback.DidResignKeyNotification;
|
||||
begin
|
||||
LCLSendActivateMsg(Target, WA_INACTIVE, false);
|
||||
LCLSendKillFocusMsg(Target);
|
||||
LCLSendActivateMsg(Target, WA_INACTIVE, false);
|
||||
LCLSendKillFocusMsg(Target);
|
||||
end;
|
||||
|
||||
procedure TLCLCommonCallback.SendOnChange;
|
||||
begin
|
||||
SendSimpleMessage(Target, LM_CHANGED);
|
||||
SendSimpleMessage(Target, LM_CHANGED);
|
||||
end;
|
||||
|
||||
procedure TLCLCommonCallback.SendOnTextChanged;
|
||||
begin
|
||||
SendSimpleMessage(Target, CM_TEXTCHANGED);
|
||||
end;
|
||||
|
||||
function TLCLCommonCallback.DeliverMessage(var Msg): LRESULT;
|
||||
|
Loading…
Reference in New Issue
Block a user