mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-21 02:40:13 +02:00
LCL Carbon: set and kill focus of focused control, on form activation/deactivation
git-svn-id: trunk@16764 -
This commit is contained in:
parent
5c92367f38
commit
18c474eba2
@ -871,6 +871,8 @@ function CarbonWindow_ActivateProc(ANextHandler: EventHandlerCallRef;
|
|||||||
var
|
var
|
||||||
Msg: TLMessage;
|
Msg: TLMessage;
|
||||||
EventKind: UInt32;
|
EventKind: UInt32;
|
||||||
|
Control: ControlRef;
|
||||||
|
FocusWidget: TCarbonControl;
|
||||||
begin
|
begin
|
||||||
{$IFDEF VerboseWindowEvent}
|
{$IFDEF VerboseWindowEvent}
|
||||||
DebugLn('CarbonWindow_ActivateProc ', DbgSName(AWidget.LCLObject));
|
DebugLn('CarbonWindow_ActivateProc ', DbgSName(AWidget.LCLObject));
|
||||||
@ -894,6 +896,20 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
DeliverMessage(AWidget.LCLObject, Msg);
|
DeliverMessage(AWidget.LCLObject, Msg);
|
||||||
|
|
||||||
|
// force set and kill focus of focused control
|
||||||
|
Control := nil;
|
||||||
|
OSError(GetKeyboardFocus(AWidget.Widget, Control), 'CarbonWindow_ActivateProc', SGetKeyboardFocus);
|
||||||
|
if Control <> nil then
|
||||||
|
begin
|
||||||
|
FocusWidget := GetCarbonControl(Control);
|
||||||
|
|
||||||
|
if FocusWidget <> nil then
|
||||||
|
case Msg.msg of
|
||||||
|
LM_ACTIVATE: FocusWidget.FocusSet;
|
||||||
|
LM_DEACTIVATE: FocusWidget.FocusKilled;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user