Tableview does not work properly (under XE5)

Hi,

the TTMSFMXNativeNSTableView does not seem to work like it should. Just put a TTMSFMXNativeNSTableView on a blank form, add GetColumnHeader, GetNumberOfColumns, GetNumberOfItems and GetValueForItem to it with content, e.g.:

procedure TForm1.tvTreeGetColumnHeader(Sender: TObject; AColumn: Integer;
var AHeader: string);
begin
AHeader := 'Column '+inttostr(AColumn);
end;

procedure TForm1.tvTreeGetNumberOfColumns(Sender: TObject;
var ANumberOfColumns: Integer);
begin
ANumberOfColumns := 2;
end;

procedure TForm1.tvTreeGetNumberOfItems(Sender: TObject;
var ANumberOfItems: Integer);
begin
ANumberOfItems := 50;
end;

procedure TForm1.tvTreeGetValueForItem(Sender: TObject; AColumn,
AItem: Integer; var AValueForItem: TValue);
begin
AValueForItem := random(100);
end;

The Items are not painted unless you do not resize the form. If you rearrange the Columns it the old content is painted as well as the new one until resizing the form.

Your TreeView Demo is also affected. If you click on a column in order to rearrange the text disappears and appears if you resize the whole form.

Clicking on a row returns a discardEventsMatchingMask:beforeEvent: ignores event parameter. Rebuild your application on Tiger to enable this API to work correctly.

Hi, 


We are aware of this issue in XE5, yet with the same code it works in XE4 so it makes us think that the issue is in XE5 rather than in our component, but that needs to be investigated. If you have the ability to work in XE4, I suggest to work in XE4.

Kind Regards, 
Pieter

Pieter Scheldeman2013-09-19 02:31:10

Thanks for the response, i only have XE5. I guess i found the possible reason(s) and i will keep you informed.

The same issue occurs on OS X Lion 10.7.5 when TTMSFMXNativeNSTableView is compiled in XE6. The list appears to be empty when shown and it becomes malformed after a resize.



Help please.

Hi, 


Could you perhaps send us your sample so we can investigate this here?

Kind Regards, 
Pieter

It's a very trivial example [download here]

When compiled in XE6 it works on OS X 10.9.3 (Mavericks)



However on OS X 10.7.5 (Lion) it becomes this




Can you perhaps try with the following code in the FormCreate


  TMSFMXNativeNSTableView.GetView.setWantsLayer(False);

Kind Regards, 
Pieter

Sorry this doesn't help. The old problem remains and new visual artifacts appear:



Any other ideas please?

Hi, 


Can you perhaps try with the following line:

  TMSFMXNativeNSTableView1.TableView.setWantsLayer(false);

 or a combination of this line and the previous line.
We needed to add this line because the TableView was drawing incorrect on newer Mac OS X versions.

Kind Regards, 
Pieter

Tried these two lines alone and in combination, unfortunately it still does not work on older Mac OS X versions. Is there any other workaround to try?

procedure TForm1.FormCreate(Sender: TObject);
begin
  TMSFMXNativeNSTableView.TableView.setWantsLayer(False);
  TMSFMXNativeNSTableView.GetView.setWantsLayer(False);
end;

Hi, 


We are able to reproduce this here on 10.7.5, but unfortunately we are unable to find any relevant information. It is unclear why it does not work on older Mac OS X versions. The NSTableView uses the view-based implementation instead of the cell-based implementation that is introduced in 10.7. It could be an underlying FireMonkey issue in combination with an older Mac OS X version.

Kind Regards, 
Pieter