[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Allow missing components (or detect them in project)
[Thread Prev] | [Thread Next]
- Subject: Re: Allow missing components (or detect them in project)
- From: Bruce Steers <bsteers4@xxxxxxxxx>
- Date: Mon, 12 Jan 2026 13:52:28 +0000
- To: user@xxxxxxxxxxxxxxxxxxxxxx
On Mon, 12 Jan 2026 at 12:18, Benoît Minisini < benoit.minisini@xxxxxxxxxxxxxxxx> wrote: > Le 12/01/2026 à 12:32, Bruce Steers a écrit : > > > > Sorry I might not have been clear. > > > > The thing is I DO have gb.settings in the program, but a modified > > version included in the source code. > > I copied the gb.settings/.src folder contents (Settings.class/ > > _Settings_Keys.class) into my project so i could make some changes > > So although the gb.settings "component" is not added in the components > > page my program does actually have the gb.settings "components" and > > gb.form.mdi works okay. > > The only issue is when th IDE thinks gb.settings must be added to > > the.project file components list and thus breaks things. (every time i > > open the project properties page) > > > > My initial issue was with Settings.class more than gb.form.mdi requiring > > it because there was no way to initialize the default settings file with > > a set name. > > The problem was the application file is called UseEdit.gambas but i have > > a symlink to it called useedit. running the symlink changed case of the > > settings file too as the program gets a different Application.Name > > running via symlink. > > > > A Static Property like Settings.DefaultName in Settings.class would be > > useful that if set before any Settings[] call forces your choice of name > > (in my case LCase useedit) > > > > I added 2 useful Static properties to the Settings.class file.. > > > > '' Force the default settings file name (Provide just the name, default > > path will be used and extension .conf) > > Static Property ForceName As String Use $sForceName > > I can add that one (but not with that name I think). > > > > > '' Force settings file to be new on load and deleted on exit (for > testing) > > Static Property TestNew As Boolean Use $bTestNew > > But not that one. You must implement it yourself. > > > > > So in my program before any Settings[] calls i use the following... > > Settings.ForceName = "useedit" > > Then my setting file is always Settings.DefaultDir &/ "useedit.conf" > > regardless of Application.Name > > > > And for development purposes the Settings.TestNew option changes the > > filename used to useedit-tmp.conf and ensures no old one is loaded and > > any new one is deleted. > > Then I can simply quickly test my program still loads in a "new install" > > scenario having no settings without messing about in the ~/.config/ > > gambas/ folder. > > > > But back on point, I have many programs that have gambas components > > added to their .src folder and de-selected from the project config. > > So it would be useful to have a way to let the IDE know that a component > > IS still included just not the usual way and would fix the issue for > > other similar scenarios. > > > > I disagree. You must do that only by using inheritance on the already > exported classes of the component. Not by copying the entire source code > of the component inside your project which creates some sort of a mess. > > Components are supposed to be run inside their own project because they > rely on being separated by the interpreter from the project and the > other components at runtime. > > Or you don't use the Gambas components, and copy all source code inside > your project. But you still have the problem of not having the sometimes > required separation. > > Note that the dependencies between components will be sooner or later > managed at runtime and not at compile time (i.e. the required components > of a component will be loaded at runtime, whatever is checked in the > main project). > > Regards, > > -- > Benoît Minisini. Eek. that last part sounds scary. Sometimes Inheritance is just not enough. For example my Keystroke macro recorder for TextEditor only works because i create a fake Key.class called MKey.class and use a direct copy of the View_Keypress() event modified to use MKey.class not Key.class. This cannot be done via Inheritance because the View_Keypress event contains Private variables not accessible with Inheritance. (although i'm sure gb.form.editor isn't a dependency for anything) I think if you start automatically adding components with no option to bypass the automation you will break many existing programs. I'm sure i'm not the only one who has imported components so they can implement their own modifications rather than trying to get you to do it in the main version. You are right though, i have just re-visited 3 of my programs that have imported gb.settings and easily converted them to use inheritance instead. But I can't see a way to use inheritance with my TextEditor keystroke recorder :( Hopefully all will be okay :) Sorry for the noise. Respects BruceS
| Re: Allow missing components (or detect them in project) | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |
| Allow missing components (or detect them in project) | Bruce Steers <bsteers4@xxxxxxxxx> |
| Re: Allow missing components (or detect them in project) | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |
| Re: Allow missing components (or detect them in project) | Bruce Steers <bsteers4@xxxxxxxxx> |
| Re: Allow missing components (or detect them in project) | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |