[Gambas-user] Write a new component: Firmata (Second attempt)

Matias De lellis mati86dl at gmail.com
Tue Mar 27 17:34:07 CEST 2018


Hi Benoît,

2018-03-27 12:16 GMT-03:00 Benoît Minisini <g4mba5 at gmail.com>:

> Le 27/03/2018 à 17:03, Matias De lellis a écrit :
>
>>
>> I attach a test version of the component. It has a Led class - Which is
>> literally a copy of 'SwitchButton' - which is shown in the toolbar, but
>> when I put the control on the form, I can not get it to show the Switch. It
>> show the component icon.. :disapointed:
>>
>
> The IDE can only display the controls it uses itself. For every other
> control, it will display a frame with the control icon inside (it does not
> know how to draw the control).
>

Can not use the same drawing area routine? What is the limitation if it is
the same code?


> Otherwise, you can define the "_DrawWith" constant to tell the IDE which
> standard control it can use instead to draw the new control.
>

I know the property, but there is no control that correctly represents what
I want.


> I don't want the IDE to dynamically load components just to draw them,
> because it's a security risk, and a potential source of errors.
>

Ohh.. Maybe understand this.. But in this case, limit the possibilities of
the component.. I want to make new controls that represent electronic
components, or everyday elements like a water tank representing the water
level, and should adapt to the properties configured in the ide..

>
>
>> Please.. keep in mind that it is just an example, I do not want to show
>> the SwitchButton. I want to draw a led considering a color, and this seemed
>> like a good starting point... :wink:
>>
>> Can you please check if I'm missing something?
>>
>> p.s:
>> 2nd doubt: Is there any way to install the component for the user to
>> test.? $home/.local/gambas??
>>
>
> No. You can do that with library projects, not component projects.
>

Ok.


>
> See components like what device drivers are for the Linux kernel.
>
> If your control is well written, we can put it in the 'gb.form' component.
> That way, the IDE, as it uses that component, will be able to draw it.
>

Oh.. No..
This component depends on the serial communication, and can not be added by
default.. :wink:



> Regards,
>
> --
> Benoît Minisini
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20180327/1890510c/attachment.html>


More information about the User mailing list