cocoa: fix the visibility of ListBox #25362, based on patch provided by accSone

git-svn-id: trunk@43494 -
This commit is contained in:
dmitry 2013-11-28 04:40:50 +00:00
parent 03aca40d68
commit a137955dff
2 changed files with 17 additions and 8 deletions

View File

@ -123,7 +123,9 @@ begin
Result := TCocoaScrollView.alloc.initWithFrame(NSNullRect);
if Assigned(p) then p.addSubView(Result);
Result.lclSetFrame(r);
Result.setHidden(p.isHidden);
Result.setDocumentView(AView);
AView.setHidden(false);
SetViewDefaults(Result);
end;

View File

@ -881,22 +881,29 @@ var
list : TCocoaListView;
scroll : TCocoaScrollView;
begin
list:=NSView(TCocoaListView.alloc).lclInitWithCreateParams(AParams);
list.callback:=TLCLCommonCallback.Create(list, AWinControl);
list.list:=TCocoaStringList.Create(list);
list := NSView(TCocoaListView.alloc).lclInitWithCreateParams(AParams);
if not Assigned(list) then
begin
Result := 0;
Exit;
end;
list.callback := TLCLCommonCallback.Create(list, AWinControl);
list.list := TCocoaStringList.Create(list);
list.addTableColumn(NSTableColumn.alloc.init);
list.setHeaderView(nil);
list.setDataSource(list);
if not Assigned(list) then begin
Result:=0;
scroll := EmbedInScrollView(list);
if not Assigned(scroll) then
begin
list.dealloc;
Result := 0;
Exit;
end;
scroll:=EmbedInScrollView(list);
scroll.callback:=list.callback;
scroll.callback := list.callback;
scroll.setHasVerticalScroller(true);
scroll.setAutohidesScrollers(true);
Result:=TLCLIntfHandle(scroll);
Result := TLCLIntfHandle(scroll);
end;
class function TCocoaWSCustomListBox.GetStrings(const ACustomListBox: TCustomListBox):TStrings;