Cześć, piszę sobie komponent, który pochodzi od TPanel. Kładę na niego ComboBox, SpinEdit i drawGrid.
Oto część konstruktura z "debugowaniem"
constructor TJuhasScheduler.Create(AOwner: TComponent);
var
i: integer;
y, m, d: word; //year month day
f: TextFile;
begin
assignFile(f, 'C:\kom.txt');
rewrite(f);
writeln(f, 'Tworzę');
closeFile(f);
inherited Create(AOwner);
append(f);
writeln(f, 'Utworzyłem');
closeFile(f);
//setting main panel h and w
self.width:=100;
self.height:=100;
append(f);
writeln(f, 'Zmieniłem wielkości');
closeFile(f);
//creating ComboBox
append(f);
writeln(f, 'Tworzę MonthCombo');
closeFile(f);
FMonthCombo:=TComboBox.Create(Self);
append(f);
writeln(f, 'Utworzyłem, ustawiam parenta');
closeFile(f);
FMonthCombo.Parent:=self;
append(f);
writeln(f, 'Ustawiłem, ustawiam położenie i wielkości');
closeFile(f);
FMonthCombo.Top:=5; FMonthCombo.Left:=5;
FMonthCombo.Width:=60;
append(f);
writeln(f, 'Ustawiłem, wypełniam miesiącami');
closeFile(f);
for i:=1 to 12 do FMonthCombo.Items.Add(LongMonthNames[i]); //setting month names to comboItems
OK i do tego momentu się wykonuje.
Następnie podczas kładzenia komponentu na formę dostaję komunikat błędu:
Control '' has no parent window.
O co chodzi?
dopisane
Rozkminiłem, że być może chodzi o coś z Canvasem.
Bo generalnie, ani nie mogę napisać tekstu na gridzie, ani nie mogę dodać elementów do ComboBoxa.