I have a problem with the Combo Box. I assign a long list of items, pre-alphabetized, and then I may search for a starting string. In code written in Delphi 5 the behavior is as follows: the closest match is shown in the Combo Box edit field. If the list is dropped down, the search point is displayed, with items before and after and the match item in the middle. Good.
The same code compiled by Lazarus 1.6 does not behave this way. The search runs and succeeds, and the match is shown in the edit field. But when the list is dropped down, the top of the list only is shown. The match is nowhere to be seen. Maybe I'm not populating the item list the right way. Below is some code. Any suggestions are appreciated.
procedure TForm1.GetData(Sender: TObject);
var
lines, i, j, lastverb, lastverbplus : Integer;
verbname : string;
begin
fileData := TStringList.Create;
fileData.LoadFromFile('Verb12Data.txt');
lines := fileData.Count;
verbname := '';
if frac(lines / 395) <> 0.0000 then PJVCLMsgDlg1.execute;
lastverb := (lines div 396);
lastverbplus := (lastverb div 395);
lastverb := lastverb + lastverbplus;
for i := 0 to lastverb do begin
j := 395*i;
verbname := fileData[j];
Delete(verbname, 1, 30);
ComboBox1.Items.Add(' ' + verbname);
end;
ComboBox1.Itemindex := 0;
RefreshEBoxes(Sender);
end;
thanks,
Whiffee