Page 1 of 1

IDE Options stored in PB File: icon file

Posted: Sat Feb 04, 2017 11:20 pm
by IdeasVacuum
Of the options stored, one is the app's icon:
UseIcon = ..\..\My.ico
However the full path is not stored, so if the .pb file is moved to another folder, the compiler complains that it "can't find the icon file". The simple solution is to store the full path.

Re: IDE Options stored in PB File: icon file

Posted: Sun Feb 05, 2017 12:31 am
by Sicro
If the full path is saved instead of the relative path and you move the pb file to another directory, the same problem persists.

Re: IDE Options stored in PB File: icon file

Posted: Sun Feb 05, 2017 1:05 am
by Dude
Sicro wrote:If the full path is saved instead of the relative path and you move the pb file to another directory, the same problem persists.
:?: No it won't. If I tell it that my icon is stored as D:\MyIcon.ico, then my PB file will get the icon from D:\MyIcon.ico no matter where I move my PB file.

Re: IDE Options stored in PB File: icon file

Posted: Sun Feb 05, 2017 6:34 am
by Keya
Dude wrote:
Sicro wrote:If the full path is saved instead of the relative path and you move the pb file to another directory, the same problem persists.
:?: No it won't. If I tell it that my icon is stored as D:\MyIcon.ico, then my PB file will get the icon from D:\MyIcon.ico no matter where I move my PB file.
It will if the icon is stored anywhere in the project directory (which would be fairly common) that gets renamed.

A best-of-both-worlds solution might be: the IDE could easily detect if the file is within the project directory ... if it is, use a relative path eg. "icons\MyIcon.ico", if not use the full external path "d:\common\icons\MyIcon.ico".

Re: IDE Options stored in PB File: icon file

Posted: Sun Feb 05, 2017 6:51 am
by Dude
The IDE should just use what's specified, so if it's a relative path, like "\icons\app.ico" with no leading drive qualifier, then just prefix the path with the PB source file path. Otherwise, if the specified path is absolute like "d:\icons\app.ico", then just use that and totally ignore the PB source file path.

[Edit] Oops, just realized that's what Keya said. :oops:

Re: IDE Options stored in PB File: icon file

Posted: Mon Feb 06, 2017 7:32 pm
by Sicro
Yes, Keya, that's exactly what I wanted to write, but apparently it was already too late for me.