2021년 4월 28일 수요일

Delphi 10.4.2 TControlList 이해를 돕기위한 초간단 예제

델파이에서 애플의 테이블뷰를 구현 할 수 있게 되었습니다.

새로운 폼을 하나 만들고 ControlList를 alClient 로 올려놓고

ControlList 의 Item (prototype) 영역에 Label을 하나 올려 놓습니다.

간단하게하기위해 자료 컨테이너는 iMemo: TStringList 로 지정하고

아래 소스처럼 초기값을 넣습니다.

ComtrolList1.ItemHeight := 22;

procedure TForm2.ControlList1BeforeDrawItem(AIndex: Integer; ACanvas: TCanvas;
  ARect: TRect; AState: TOwnerDrawState);
begin
  Label1.Caption:= iMemo[Aindex];
end;
procedure TForm2.FormActivate(Sender: TObject);
begin
  iMemo:= TStringList.Create;
  iMemo.CommaText:= 'Hello, World,1,2,3,4,5,6,7,8,9';
  ControlList1.ItemCount:= iMemo.Count;
end;
procedure TForm2.FormDeactivate(Sender: TObject);
begin
  iMemo.Free;
end;

결과화면



 


댓글 없음:

tensorflow gpu 사용하기에서

 tensorflow 설치시 주의해야 한다. # Anything above 2.10 is not supported on the GPU on Windows Native python - m pip install "tensorflow<2.11...