#PB_EventType_Focus/LostFocus for all gadgets

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

#PB_EventType_Focus/LostFocus for all gadgets

Post by PB »

Please add this EventType() for all gadgets can be given the
focus by clicking or tabbing to them. Thanks! :) As per this:

http://www.purebasic.fr/english/viewtop ... 22#p432222
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: #PB_EventType_Focus/LostFocus for all gadgets

Post by freak »

If we add this for buttons, then you always need to check EventType() when you receive an event for the button to know if it was a click or focus event. Right now you don't need that because buttons only report the click event. I don't see much use in focus events for buttons (your example is the rare exception), so its not worth it imho.
quidquid Latine dictum sit altum videtur
BorisTheOld
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Apr 24, 2012 5:08 pm
Location: Ontario, Canada

Re: #PB_EventType_Focus/LostFocus for all gadgets

Post by BorisTheOld »

freak wrote:If we add this for buttons, then you always need to check EventType() when you receive an event for the button to know if it was a click or focus event. Right now you don't need that because buttons only report the click event. I don't see much use in focus events for buttons (your example is the rare exception), so its not worth it imho.
That has to be the most bizarre reasoning I ever heard. And just because you can't think of any reason for Button focus events, doesn't mean there aren't any. There have been many requests for extra events, particularly Focus/LostFocus for buttons, so it's reasonable to assume that the requestors know something you don't know.

I think you're being more than a little presumptuous in assuming that you know best what people should, or should not, be doing in their code. In my own case, it was very much worth spending time to write many custom gadgets (based on the Canvas gadget), to gain access to more event types.

Perhaps it would be better if you listened politely to peoples requests, even if you have no intention of implementing what they ask for.
For ten years Caesar ruled with an iron hand, then with a wooden foot, and finally with a piece of string.
~ Spike Milligan
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: #PB_EventType_Focus/LostFocus for all gadgets

Post by netmaestro »

Perhaps it would be better if you listened politely to peoples requests, even if you have no intention of implementing what they ask for.
I won't weigh in on the usefulness or lack thereof for the given feature request, I don't have a dog in this fight. But pique aside, I prefer a response like Freak's to polite silence any day. At least you know what to (or not to) expect.

"Give it to me straight, Doctor! I can take it!"
-Johnny Fever
BERESHEIT
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: #PB_EventType_Focus/LostFocus for all gadgets

Post by PB »

> you always need to check EventType() when you receive an
> event for the button to know if it was a click or focus event

Cool, that's no problem for us a customer at all. :D

> I don't see much use in focus events for buttons (your example
> is the rare exception), so its not worth it imho.

That's a shame, then. :( Keyboard navigation means nothing?
What if I want to change the color of the button that gets the
focus, or its text, or size? There are many examples. Oh well.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: #PB_EventType_Focus/LostFocus for all gadgets

Post by davido »

I do not find freak's replies, to be in any way, impolite.
I find his replies to be Honest; incisive and to the point.

I may not always like the answer, but I know exactly what the situation is. Please keep it that way, freak.

After all a 'spade' really is a 'spade' !
DE AA EB
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: #PB_EventType_Focus/LostFocus for all gadgets

Post by Fangbeast »

That's a shame, then. :( Keyboard navigation means nothing?
What if I want to change the color of the button that gets the
focus, or its text, or size? There are many examples. Oh well.
I was using NetMaestro's MouseHoverEvent source library (I think that's the right name?) to do this sort of thing and use ImageGadgets as pseudo buttons to change the graphic as the mouse hovered over and it looked really nice. I know it can do more than what I used it for.

My home inventory program didn't look too bad at all.

Would like NetMaestro's library to be native so we could do just what you suggested PB. Personal choice of course. NetMaestro's MouseHoverEvent code has come in handy for a few of my programs lately.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: #PB_EventType_Focus/LostFocus for all gadgets

Post by PB »

But I'm talking about getting the focus; not hovering.
Hovering is a totally different kettle of fish altogether.
It was just a wish anyway, as this section is for. :)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: #PB_EventType_Focus/LostFocus for all gadgets

Post by Fangbeast »

PB wrote:But I'm talking about getting the focus; not hovering.
Hovering is a totally different kettle of fish altogether.
It was just a wish anyway, as this section is for. :)
I misunderstood as I thought when the mouse hovered over a gadget, it got the focus and you could detect it. Sorry.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: #PB_EventType_Focus/LostFocus for all gadgets

Post by IdeasVacuum »

IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply