[Gambas-user] Custom controls in gambas IDE

Bruce adamnt42 at gmail.com
Mon Feb 22 22:17:45 CET 2021


On 23/2/21 5:54 am, Bruce Steers wrote:
> On Mon, 22 Feb 2021 at 18:17, Benoît Minisini <g4mba5 at gmail.com> wrote:
> 
>> Le 22/02/2021 à 17:23, Bruce Steers a écrit :
>>>
>>> Ben , do you like or hate the idea of this?
>>> I've added a "Custom Controls" part to Preferences.
>>>
>>> Controls added to list get loaded when gambas loads so they show correct
>>> in IDE.
>>>
>>> Should I stop or do you think may be a nice addition?
>>>
>>> Here is a movie of it working..
>>> http://bws.org.uk/images/screenrecord-2021-02-22_16.14.34.mp4
>>>
>>> it is WIP still. (need to make it copy the ProjectDir/.info file to
>>> ProjectDir/.hidden/info/classname.info <http://classname.info> to make
>>> it work properly yet)
>>>
>>> Respects
>>> BruceS
>>>
>>
>> Hi,
>>
>> Sorry, I don't like the idea of loading components dynamically in the
>> IDE at all, because :
>>
>> 1) These components cannot be unloaded.
>>
> 
> Does that matter? i plan to use the components i am making in most of my
> projects so i want them loaded.
> It does not properly integrate into gambas, i cannot see the component in
> the control chooser in the IDE unless i add the class to my project.
> It does not show the icon in the chooser unless i add the png to
> .hidden/control.
> But once i have done that the IDE can get the _DrawWith, _Similar , etc
> info and that is great.
> 
> 
>> 2) They can break the IDE.
>>
> 
> Ahh , yes then I fully understand your concerns.
> Not to worry, i'll stop pushing the idea to you ;)
> 
> I think i'll keep the addition on my branch though as I am finding it is a
> really useful feature while i am learning how the layout of custom controls
> work.
> how they look in the IDE as well as how they look at runtime helps me
> understand what is going on much better.
> 
> i will add a "Do not Load components" option to skip the loading all custom
> components before reporting any bugs in future to be sure the bug is not
> this breaking things and add a note on the settings page to tell anyone
> else to do the same (not that anyone uses my fork)
> 
> 
> Thank you for your thoughts.
> BruceS
> 
> 
> 
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> 

A couple of points thatyou may wixh to consider.

1) You should only ;oad the custom control components used by the 
particular project that is active ibn IDE. This is the problem with not 
being able to unload them. If you open a different project in the same 
IDE window that uses different, possibly conflicting, custom components 
then you may get name clashes and thus IDE instability. Regardless of 
that you may also need to look at Preject/Refresh and the Git menu etc 
where the active project is trloaded.

2) have you considered custom control components with multiple controls? 
  I can't see your movie (eyesight problems not technical problems) So I 
cant see how you are specifying the component.

3) some controls (and therefore some custom controls based on them 
actually do do things inside the IDE form designer. For example the 
wizard control or consider a custom "sub-foorm switcher". Just 
suggesting you think about these things in your design of your IDE version.

4) One thing I tried,almost succeeded and lost in a disk crash, was 
"custom editors for custom control propertied" . At the moment they have 
yo be included in the IDE code, for example the little popup editors 
used by the report controls. My idea was to have these property editors 
defined inside the cusyom control component. Yhus not disturbing the 
IDE. I was too busy trying to rebuild our dev box to try to recover what 
I had done (Always back up your dev versions frequently! is all I 
remember now.)

Anyway ymmv
bruce


More information about the User mailing list