Restored from previous forum. Originally posted by PB.
Hi Fred,
As per Eric's request, can the SpinGadget increase its value when the top arrow
is clicked, instead of decreasing it like it currently does?
Also, I was thinking it would be good if when using SetGadgetText on it, that
it automatically sets SetGadgetState as well, so the progammer doesn't have to
do it? Like this:
SetGadgetText(#sg,"5") : SetGadgetValue(#sg,5) ; Current way.
SetGadgetText(#sg,"5") ; New way would internally do SetGadgetValue to match "5".
Lastly, if you currently use SetGadgetText on the SpinGadget, then an infinite
loop of events occur because SetGadgetText creates a "change" event for the
field... so perhaps this gadget should not create a "change" event when using
the SetGadgetText command?
PB - Registered PureBasic Coder
SpinGadget tweaks
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by ebs.
PB (and Fred),
Thanks for adding this to the wishlist. I agree that only one SetGadgetXXXX function is necessary. However, I'm wondering if it wouldn't be better to eliminate SetGadgetText and just use SetGadgetState to set both the state and text values (just the opposite of what you suggested). If SetGadgetText was removed, would this eliminate the infinite event loop?
Regards,
Eric
PB (and Fred),
Thanks for adding this to the wishlist. I agree that only one SetGadgetXXXX function is necessary. However, I'm wondering if it wouldn't be better to eliminate SetGadgetText and just use SetGadgetState to set both the state and text values (just the opposite of what you suggested). If SetGadgetText was removed, would this eliminate the infinite event loop?
Regards,
Eric
Hi Fred,
As per Eric's request, can the SpinGadget increase its value when the top arrow
is clicked, instead of decreasing it like it currently does?
Also, I was thinking it would be good if when using SetGadgetText on it, that
it automatically sets SetGadgetState as well, so the progammer doesn't have to
do it? Like this:
SetGadgetText(#sg,"5") : SetGadgetValue(#sg,5) ; Current way.
SetGadgetText(#sg,"5") ; New way would internally do SetGadgetValue to match "5".
Lastly, if you currently use SetGadgetText on the SpinGadget, then an infinite
loop of events occur because SetGadgetText creates a "change" event for the
field... so perhaps this gadget should not create a "change" event when using
the SetGadgetText command?
PB - Registered PureBasic Coder
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> I'm wondering if it wouldn't be better to eliminate SetGadgetText and just use
> SetGadgetState to set both the state and text values
Theoretically either way would be fine, as Fred could code it so that either way
doesn't generate a "change" event when applying it to the gadget. I thought I had
a preference for using SetGadgetText over SetGadgetState, but I can't remember what
it was right now...
PB - Registered PureBasic Coder
> I'm wondering if it wouldn't be better to eliminate SetGadgetText and just use
> SetGadgetState to set both the state and text values
Theoretically either way would be fine, as Fred could code it so that either way
doesn't generate a "change" event when applying it to the gadget. I thought I had
a preference for using SetGadgetText over SetGadgetState, but I can't remember what
it was right now...
PB - Registered PureBasic Coder