On Mon, 20 Mar 2006 13:54:30 +0100
Tomas Gregorovic <[EMAIL PROTECTED]> wrote:

> Hi,
> I'm trying to improve the Configure Installed Package dialog by viewing 
> some info about packages like author, description and in future register 
> components list.
> 
> The problem is that this info is shown only for installed packages and 
> doesn't work for the others.
> So it is possible to get this info for non-installed packages? And how?
> 
> I have following code, the full code is attached:
> 
> FSelectedPkg: TLazPackage;
> 
> procedure TInstallPkgSetDialog.UpdatePackageInfo(List: TListBox);
> var
>   PkgName: String;
>   PkgID: TLazPackageID;
> begin
>   if List = nil then Exit;
>   PkgName := '';
>   if List.ItemIndex >= 0 then
>     PkgName := List.Items[List.ItemIndex];
> 
>   if PkgName = '' then Exit;
>   if Assigned(FSelectedPkg) then
>     if PkgName = FSelectedPkg.IDAsString then Exit;
>    
>   PkgInfoMemo.Clear;
>   PkgID := TLazPackageID.Create;
>   try
>     PkgID.StringToID(PkgName);
>     FSelectedPkg := PackageGraph.FindPackageWithID(PkgID);
> 
>     if FSelectedPkg <> nil then
>     begin
>       with PkgInfoMemo.Lines do
>       begin
>         Add(lisPckOptsAuthor + ': ' + FSelectedPkg.Author);
>         Add(lisPckOptsDescriptionAbstract + ': ' + 
> FSelectedPkg.Description);
>       end;
>     end;
>   finally
>     PkgId.Free;
>   end;
> end;

Thanks. Applied.

I fixed the gtk TListBox.ItemIndex with MutliSelect and added reading the
.lpk files for not loaded packages.

Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to