Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-05

Package directory at runtime

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Krzysztof

Hi,

I have own component editor which inherit from TComponentEditor. I have connected it to the control. Everything works fine, my form dialog pop up when I double click on control or from context menu. But my form dialog have filelistbox and I want that it point to some subfolder of this control package. How can I do that? I think this is possible because lazarus can do this: when I open some installed package and try to open some file, open dialog point to current opened package.

Regards.

Reply by email

Mattias Gaertner
to Krzysztof
Show quoted text 10 lines
Hi, I have own component editor which inherit from TComponentEditor. I have connected it to the control. Everything works fine, my form dialog pop up when I double click on control or from context menu. But my form dialog have filelistbox and I want that it point to some subfolder of this control package. How can I do that? I think this is possible because lazarus can do this: when I open some installed package and try to open some file, open dialog point to current opened package.

The paths are not compiled in.
The IDE knows the path, because it has a history of lpk files.
See ~/.lazarus/packagefiles.xml

Another possibility is to pass the package path via run / run parameters / environment / user overrides

Mattias

Reply by email

Krzysztof
to Mattias Gaertner

Hmm. Is an easier way? The point is that my package with visual controls, has subcatalog "styles". In design mode, when user open style manager (double click on control) then I would like to display all files in that directory. For the first time I could ask the user for the path to the package, but where then save this path? In Lazarus's home directory?

2012/5/11 Mattias Gaertner :

Show quoted text 31 lines
On Fri, 11 May 2012 16:37:34 +0200 Krzysztof wrote: > Hi, > > I have own component editor which inherit from TComponentEditor. I > have connected it to the control. Everything works fine, my form > dialog pop up when I double click on control or from context menu. But > my form dialog have filelistbox and I want that it point to some > subfolder of this control package. How can I do that? I think this is > possible because lazarus can do this: when I open some installed > package and try to open some file, open dialog point to current opened > package. The paths are not compiled in. The IDE knows the path, because it has a history of lpk files. See ~/.lazarus/packagefiles.xml Another possibility is to pass the package path via run / run parameters / environment / user overrides Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Mattias Gaertner
to Krzysztof
Show quoted text 6 lines
Hmm. Is an easier way? The point is that my package with visual controls, has subcatalog "styles". In design mode, when user open style manager (double click on control) then I would like to display all files in that directory. For the first time I could ask the user for the path to the package, but where then save this path? In Lazarus's home directory?

At designtime you can find the package directory easily:

uses MacroIntf; // package IDEIntf
  Dir:='$PkgDir(YourPkgName)';
  IDEMacros.SubstituteMacros(Dir);

Mattias

Reply by email

Krzysztof
to Mattias Gaertner

That was exactly what I needed! Thanks Mattias

2012/5/11 Mattias Gaertner :

Show quoted text 25 lines
On Fri, 11 May 2012 18:01:32 +0200 Krzysztof wrote: > Hmm. Is an easier way? The point is that my package with visual > controls, has subcatalog "styles". In design mode, when user open > style manager (double click on control) then I would like to display > all files in that directory. For the first time I could ask the user > for the path to the package, but where then save this path? In > Lazarus's home directory? At designtime you can find the package directory easily: uses MacroIntf; // package IDEIntf ?Dir:='$PkgDir(YourPkgName)'; ?IDEMacros.SubstituteMacros(Dir); Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email