IDE Options stored in PB File: icon file

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

IDE Options stored in PB File: icon file

Post 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.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Sicro
Enthusiast
Enthusiast
Posts: 559
Joined: Wed Jun 25, 2014 5:25 pm
Location: Germany
Contact:

Re: IDE Options stored in PB File: icon file

Post 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.
Image
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: IDE Options stored in PB File: icon file

Post 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.
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: IDE Options stored in PB File: icon file

Post 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".
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: IDE Options stored in PB File: icon file

Post 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:
User avatar
Sicro
Enthusiast
Enthusiast
Posts: 559
Joined: Wed Jun 25, 2014 5:25 pm
Location: Germany
Contact:

Re: IDE Options stored in PB File: icon file

Post by Sicro »

Yes, Keya, that's exactly what I wanted to write, but apparently it was already too late for me.
Image
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
Post Reply