[Gambas-user] gb.web.gui and Canvas

Bruce Steers bsteers4 at gmail.com
Sun Aug 7 14:49:27 CEST 2022


On Sat, 6 Aug 2022 at 23:14, Bruce Steers <bsteers4 at gmail.com> wrote:

>
>
> On Sat, 6 Aug 2022 at 22:31, Bruce Steers <bsteers4 at gmail.com> wrote:
>
>>
>>
>> On Thu, 4 Aug 2022 at 12:56, Bruce Steers <bsteers4 at gmail.com> wrote:
>>
>>>
>>>
>>> On Wed, 3 Aug 2022 at 17:05, Fabien Bodard <gambas.fr at gmail.com> wrote:
>>>
>>>> Hi Bruce,
>>>>
>>>> I've ti do something like that with report
>>>>
>>>> Check ReportPaintBrush class in GB.report2
>>>>
>>>> Best Regards,
>>>>
>>>> Fabien Bodard
>>>>
>>>
>>> Thank you Fab but I don't think I'm up for the task.
>>> I'm pretty sure i could make it all work but pretty unsure of Bens
>>> statement about making a PainBrush class "that mimics paint class" ?
>>> I'm pretty sure I could do something that was far from the correct, not
>>> in the end result but in it's required particular gambas structure.
>>> So I'm thinking wait for Ben to make the structure, then i can start
>>> thinking of decorating :)
>>>
>>> For now I'll just see what I can accomplish in my own environment with
>>> what we have so far.
>>>
>>
>> I maybe up for the task, I have this so far...
>> https://gitlab.com/bsteers4/gambas/-/tree/web-gui-updates
>>
>> https://gitlab.com/bsteers4/gambas/-/tree/web-gui-updates/comp/src/gb.web.gui/.src
>> I looked at Fabs source, i looked to how Paint.class does in in GUI
>> I have the above working, gradients working only at present.
>>
>> How sound is the code Ben?
>> Respects
>>
>
> I condensed the work into one commit on another branch so all changes can
> be viewed at once.
> https://gitlab.com/bsteers4/gambas/-/tree/web-gui-brush
>
> https://gitlab.com/bsteers4/gambas/-/commit/c57ab3a25c48ae7f1acfe27bd3231c86328d4752
> Respects
> BruceS
>

Added RadialGradient too now, all seems to work lovely in the test program.
https://gitlab.com/bsteers4/gambas/-/commits/web-gui-brush
(merge request in draft mode submitted)
(i wonder if it takes longer to examine my code than it does to write your
own version from scratch?? 🤔 )


Still want/intend to implement....

Images (Patterns) for PaintBrush, being able to use either an existing
loaded image id or load from URL.

a Pant.StrokeText() / Paint.FillText() method and be able to use PaintBrush
on them, gonna look cool i think :)
https://www.w3schools.com/tags/canvas_filltext.asp

A way to get proper mouse up events from DrawingArea so hand drawn buttons
are possible.
Currently mouse up and mouse down events only trigger if mouse if over
object. so if mouse is moved off the object and released no mouseup event
triggers leaving it in MouseDown state, kinda stops it being able to be
used as a button.
Perhaps a MakeButton flag or something that places the canvas inside a
<button> </button> tag might work?  (i'm just guessing)
Unless somebody knows the secret ?

Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220807/627bcc2e/attachment.htm>


More information about the User mailing list