fixed conf custom comps

git-svn-id: trunk@4006 -
This commit is contained in:
mattias 2003-04-03 07:03:10 +00:00
parent abc3dd3ed8
commit 8597713da9

View File

@ -118,11 +118,11 @@ end;
procedure TFrmComponentMan.Button1CLICK(Sender: TObject); procedure TFrmComponentMan.Button1CLICK(Sender: TObject);
var var
I, J: Integer; I, J, NewCompCnt: Integer;
Found: Boolean; Found: Boolean;
MyObj: TRComponent; MyObj: TRComponent;
begin begin
DlgLoad.InitialDir := FLazPath+'components/custom'; DlgLoad.InitialDir := AppendPathDelim(FLazPath)+'components/custom';
if DlgLoad.Execute then begin if DlgLoad.Execute then begin
// load in and parse the source // load in and parse the source
try try
@ -133,17 +133,23 @@ begin
exit; exit;
end; end;
//MessageDlg('Found '+inttostr(CountComponents), mtInformation,[mbOk],0); NewCompCnt:=CountComponents;
if CountComponents > 30 then begin //MessageDlg('Found '+inttostr(NewCompCnt), mtInformation,[mbOk],0);
if NewCompCnt > 30 then begin
// just to save face if something goes wrong... // just to save face if something goes wrong...
MessageDlg('More than 30 components is not supported.', mtError, [mbCancel],0); MessageDlg('More than 30 components is not supported.', mtError, [mbCancel],0);
exit; exit;
end; end;
if NewCompCnt<1 then begin
MessageDlg('No components found.', mtError, [mbCancel],0);
exit;
end;
if FrmAddComponent=nil then if FrmAddComponent=nil then
FrmAddComponent := TFrmAddComponent.Create(Self); FrmAddComponent := TFrmAddComponent.Create(Self);
FrmAddComponent.ListCompAdd.Clear; FrmAddComponent.ListCompAdd.Clear;
for I := 1 to CountComponents do begin for I := 1 to NewCompCnt do begin
//MessageDlg(GetComponent(I),mtInformation,[mbOk],0); //MessageDlg(GetComponent(I),mtInformation,[mbOk],0);
// only add if not already in the list // only add if not already in the list
Found := False; Found := False;
@ -470,8 +476,7 @@ begin
// found one! // found one!
Count := Count + 1; Count := Count + 1;
if Count = I then begin if Count = I then begin
TempStr := copy(MyFile[J],1,pos('=',MyFile[j])-1); TempStr := Trim(copy(MyFile[J],1,pos('=',MyFile[j])-1));
trim(TempStr);
Result := TempStr; Result := TempStr;
exit; exit;
end; end;