Focus ring missing when using Delphi FMX on OSX

I am using the following code to add my own NSTextField to a Delphi FMX form on OSX. A text box has been added and works very well, except that the system value for the focus ring (blue border outside the text box when selected by the user) is missing. (tested with XE8 and OSX10.9, 10.10).

enter image description here

I guess it has something to do with the way Delphi / FMX has implemented TForm under OSX, because that system focus out of focus effect seems attractive out of control. The Delphi form may have some special settings to "prevent" the paint system from making this effect by mistake, and I tried all of the related NSTextField settings without success.

uses MacApi.AppKit;

procedure TForm1.AddNSTextField;
var
  tf: NSTextField;
  vw: NSView;
  r: NSRect;
begin
  vw := (WindowHandleToPlatform(Form1.Handle)).View;
  if Assigned(vw) then
  begin
    r.origin.x := 10;
    r.origin.y := 30;
    r.size.width := 300;
    r.size.height := 22;
    tf := TNSTextField.Wrap(TNSTextField.Wrap(TNSTextField.OCClass.alloc).initWithFrame(r));
    vi.addSubview(tf);
    //tf.setFocusRingType(0); //Also tried to manually set but no use. 
    tf.setStringValue(NSStr('Untitled'));
  end;
end;

      

Can anyone please help? Thank.

+3


source to share


1 answer


Please note this only, all paint effects do not work as expected with XE8 and Mac OS X 10.10 (xcode 6.3). Please advise.



+1


source







All Articles