mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 15:40:41 +02:00
LCL-CustomDrawn: Re-enables support for SetFocus in all platforms except Android and adds SetFocus support in the Accessibility code, this changes the focus when the selection is changed with VoiceOver
git-svn-id: trunk@38246 -
This commit is contained in:
parent
78e73fc658
commit
a2c19ec20c
@ -1499,11 +1499,50 @@ begin
|
||||
DebugLn('[TCocoaAccessibleObject.accessibilityIsAttributeSettable]');
|
||||
{$endif}
|
||||
Result := False;
|
||||
|
||||
//
|
||||
// Value - The element’s value. May be settable.
|
||||
//
|
||||
if attribute.isEqualToString(NSAccessibilityValueAttribute) then
|
||||
begin
|
||||
if LCLAcc.AccessibleRole in [larComboBox, larTextEditorMultiline, larTextEditorSingleline] then
|
||||
begin
|
||||
Result := True;
|
||||
end;
|
||||
end
|
||||
//
|
||||
// Always Settable attributes
|
||||
//
|
||||
else if attribute.isEqualToString(NSAccessibilityFocusedAttribute) or
|
||||
attribute.isEqualToString(NSAccessibilitySelectedTextAttribute) or
|
||||
attribute.isEqualToString(NSAccessibilitySelectedTextRangeAttribute) or
|
||||
attribute.isEqualToString(NSAccessibilityVisibleCharacterRangeAttribute) then
|
||||
begin
|
||||
Result := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCocoaAccessibleObject.accessibilitySetValue_forAttribute(value: id;
|
||||
attribute: NSString);
|
||||
begin
|
||||
{$ifdef VerboseCDAccessibility}
|
||||
DebugLn(':>[TCocoaAccessibleObject.accessibilitySetValue_forAttribute]');
|
||||
{$endif}
|
||||
if attribute.isEqualToString(NSAccessibilityFocusedAttribute) then
|
||||
begin
|
||||
{$ifdef VerboseCDAccessibility}
|
||||
DebugLn(':<[TCocoaAccessibleObject.accessibilitySetValue_forAttribute] Control=%s:%s Value=%d',
|
||||
[LCLControl.Name, LCLControl.ClassName, NSNumber(value).intValue()]);
|
||||
{$endif}
|
||||
if not (LCLControl is TWinControl) then Exit;
|
||||
if not NSNumber(value).boolValue() then Exit;
|
||||
if LCLInjectedControl <> nil then LCLInjectedControl.SetFocus()
|
||||
else TWinControl(LCLControl).SetFocus();
|
||||
end
|
||||
else if attribute.isEqualToString(NSAccessibilityValueAttribute) then
|
||||
begin
|
||||
LCLControl.Caption := NSStringToString(value);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCocoaAccessibleObject.accessibilityParameterizedAttributeNames: NSArray;
|
||||
|
@ -5463,8 +5463,9 @@ begin
|
||||
{$endif}
|
||||
Result := 0;
|
||||
// Strangly this breaks the Android Virtual Keyboard =(
|
||||
// Uncomment only when we can guarantee that this doesn't break Android Virtual Keyboard
|
||||
(* if hwnd = 0 then
|
||||
// Remove the ifdef only when we can guarantee that this doesn't break Android Virtual Keyboard
|
||||
{$ifndef CD_Android}
|
||||
if hwnd = 0 then
|
||||
begin
|
||||
Result := GetFocus();
|
||||
Exit;
|
||||
@ -5490,7 +5491,8 @@ begin
|
||||
else
|
||||
begin
|
||||
Result := BackendSetFocus(hWnd);
|
||||
end;*)
|
||||
end;
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
(*function TQtWidgetSet.GetForegroundWindow: HWND;
|
||||
|
Loading…
Reference in New Issue
Block a user