Important hint for working with unfinished/problematic packages: Do not install this package, create the components needed from it at runtime. This avoids the crash of the IDE which is very likely in case of faulty packages because an installed packaged is part of the IDE.
So, I took your code, loaded the unit2.pas into an external editor and modified it like this:
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject); // <-- added
private
ColumnCombo1: TColumnCombo; // <--- moved to "private" section
end;
procedure TForm1.FormCreate(Sender: TObject); // <-- added
begin
ColumnCombo1 := TColumnCombo.Create(self);
with ColumnCombo1 do
begin
Parent := self; <---- IMPORTANT: every control must have a parent
Left := 64; <--- all these property values are taken from the lfm file.
Top := 40;
Width := 225;
ShowColSeparators := True;
Items.Add('row1col1'#9'row1col2');
Items.Add('row2col1'#9'row2col2');
Items.Add('row3col1longname'#9'row3col2');
Text := 'row1col1'#9'row1col2';
end;
end;
Then I loaded the lfm file and deleted the ColomnCombo1 part and added a line for the OnCreate handler. This is my lfm file afterwards:
object Form1: TForm1
Left = 977
Height = 177
Top = 467
Width = 320
Caption = 'Form1'
OnCreate = FormCreate
LCLVersion = '2.1.0.0'
end
Then you can load the project into Lazarus and test without risk of crashing the IDE.
When running the project I get a crash in the for loop of TColumnCombo.DrawItemEvent as already marked by you:
xl:=ARect.Left + FOffsets[i]*FCharWidth;
A List-out-of-bounds error happens when the index of a list etc is equal to or larger than the count of list items. In the problematic statement there a list FOffsets. Set a breakpoint on this line, run the project again, and when the program stops, move the mouse over the "FOffsets". In the popup window you can see, among other lines, that the "FCOUNT = 0". This means that the list is empty, and thus you cannot access any of its elements.
The easiest way to resolve this issue is to add another condition to the introductory "if ... then exit" of the DrawitemEvent procedure in which the crash happens.
if (Index < 0) or not (Control is TCustomComboBox) or (FOffsets.Count = 0) {added} then
Exit;
Exiting this routine immediately can be too drastic, but here it happens that it is called again when the FOffsets have been set.