This repository has been archived on 2024-12-25. You can view files and clone it, but cannot push or open issues or pull requests.
OldPascalProjects/Graphics/Controls/cc15_ListView.pas
2024-03-10 20:32:51 +03:00

23 lines
991 B
ObjectPascal
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Модуль Controls - замена графического окна элементом "ListView"
uses Controls,GraphWPF;
type My = class
public
auto property Поле1: integer;
auto property Поле2: integer;
constructor (п1,п2: integer) := (Поле1,Поле2) := (п1,п2);
end;
begin
Window.Title := 'Модуль Controls - замена графического окна элементом "ListView"';
LeftPanel(150,Colors.Orange);
var l := SetMainControl.AsListView;
// Заполнение объектами класса, у которых есть публичные свойства
l.Fill(Arr(new My(2,5),new My(4,6)));
Button('Очистить список').Click := procedure -> l.Clear;
Button('Заполнить данными').Click := procedure -> l.Fill(|('Иванов',20),('Петров',19)|);
Button('Заполнить заголовки').Click := procedure -> l.SetHeaders('Фамилия','Возраст');
end.