Page 1 of 1

Gadget events

Posted: Wed Mar 16, 2016 9:55 am
by Danilo
Would be nice if all gadgets get a small comment/section about supported events,
and a small note if it does not support any events.

For example, help for SplitterGadget and ButtonGadget do not say anything about
any events at all.
It's guesswork: Does the SplitterGadget support any event on all systems, or does
it work by accident on my system? According to the documentation it has no events.

I expect the SplitterGadget to fire #PB_EventType_Change if the user changes the splitter.
It fires an event #PB_Event_Gadget, and EventType() is always 0.
0 is #PB_EventType_LeftClick on my system.

A bit confusing, and I think proper documentation could (and should) help here.

Thanks!

Re: Gadget events

Posted: Wed Mar 16, 2016 10:09 am
by Little John
Danilo wrote:For example, help for SplitterGadget and ButtonGadget do not say anything about
any events at all.
It's guesswork: Does the SplitterGadget support any event on all systems, or does
it work by accident on my system? According to the documentation it has no events.
Hi Danilo,

I think this is the explanation:
[u]freak[/u] wrote:Gadgets that only have a single type of event return 0 from EventType() and are not mentioned on the EventType() page. Just like the ButtonGadget() which has only the "pressed" event.
Anyway, I absolutely agree with you that this should be documented clearly and completely in the manual.

Re: Gadget events

Posted: Wed Mar 16, 2016 10:23 am
by Danilo
Little John wrote:I think this is the explanation:
[u]freak[/u] wrote:Gadgets that only have a single type of event return 0 from EventType() and are not mentioned on the EventType() page. Just like the ButtonGadget() which has only the "pressed" event.
Thanks. Okay, according to that quote ButtonGadget fires an event. ;)

But what about the following?
- TextGadget
- SplitterGadget
- IPAddressGadget
- TrackbarGadget
- OptionGadget
- HyperlinkGadget
- ShortcutGadget
- ScrollAreaGadget

Does the ScrollAreaGadget fire an event when scrolled, or not?
To be honest, I don't know. Need to test it on all systems to make sure
I can really use it for cross-platform PB apps. It's not documented, so
it's not supported.
If it's documented it is clear. I would even recommend to create a new section 'Events'
for all gadgets. Sections like 'Remarks', 'Example', 'Return Value' ... and 'Supported Events'.

Re: Gadget events

Posted: Sat Jul 09, 2016 10:49 pm
by Andre
I support this request. But it must be done by Fred/freak with the needed (internal) knowledge... :)