Bonjour,

Je cherche à développer un nouveau composant.
Voici le code

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
 
TListColumnsLvGeneric = class (TListColumns)
  private
    sqlField  : string;
    nullAutor : boolean;
    function  getSqlField:string;
    procedure setSqlField(arg:string);
    function  getNullAutor:boolean;
    procedure setNullAutor(arg:boolean);
  published
    property sqlFieldName  : string  read getSqlField  write setSqlField;
    property nullAutorized : boolean read getNullAutor write setNullAutor;
  public
    constructor Create(AOwner:TCustomListView);
  end;
 
  TLvGeneric = class (TListView)
  private
    function  getColumns:TListColumnsLvGeneric;
    procedure setListColumns (arg:TListColumnsLvGeneric);
  published
    property LvColumns : TListColumnsLvGeneric read getColumns write setListColumns;
  public
    constructor Create(AOwner: TComponent); override;
  end;
 
  TListViewGeneric = class(TWinControl)
  private
    { Déclarations privées }
    lv        : TLvGeneric;
    btnAdd    : TBitBtn;
    btnEdit   : TBitBtn;
    btnDelete : TBitBtn;
 
    function  getListColumns:TListColumns;
    procedure setListColumns(arg:TListColumns);
    function  getFont:TFont;
    procedure setFont(arg:TFont);
  protected
    { Déclarations protégées }
  public
    { Déclarations publiques }
    constructor Create(AOwner: TComponent); override;
  published
    { Déclarations publiées }
    property Font       : TFont         read getFont        write setFont;
    property LvColumns  : TListColumns  read getListColumns write setListColumns;
  end;
 
procedure Register;
 
implementation
 
procedure Register;
begin
  RegisterComponents('Exemples', [TListViewGeneric]);
end;
 
constructor TListColumnsLvGeneric.Create(AOwner:TCustomListView);
begin
  inherited Create(AOwner);
end;
 
function TListColumnsLvGeneric.getSqlField:string;
begin
  result:= sqlField;
end;
 
procedure TListColumnsLvGeneric.setSqlField(arg:string);
begin
  sqlField:=arg;
end;
 
function TListColumnsLvGeneric.getNullAutor:boolean;
begin
  result:= nullAutor;
end;
 
procedure TListColumnsLvGeneric.setNullAutor(arg:boolean);
begin
  nullAutor:=arg;
end;
 
constructor TLvGeneric.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
end;
 
function TLvGeneric.getColumns:TListColumnsLvGeneric;
begin
  result:= LvColumns;
end;
 
procedure TLvGeneric.setListColumns (arg:TListColumnsLvGeneric);
begin
  LvColumns:= arg;
end;
 
constructor TListViewGeneric.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
end;

Je me trouve devant le problème suivant : Les "nouvelles propriétés" sqlField et nullAutor n'apparaissent pas dans l'inspecteur d'objet...

Si quelqu'un peut m'aider ... Merci d'avance.