Please Add IsGadgetDisabled

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Please Add IsGadgetDisabled

Post by fsw »

Please Add IsGadgetDisabled (or what ever name you like) as a PB native command.

Thanks
fsw
ozzie
Enthusiast
Enthusiast
Posts: 443
Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:

Post by ozzie »

+1

I'm writing for Windows, Mac and Linux, so Windows-only solutions are not suitable.
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Use Set/GetGadgetData ?

Post by USCode »

Maybe it would be more appropriate to be able to use GetGadgetState with a couple new #PB_... flags to represent if the gadget is enabled or disabled?

Alternatively, if you set the gadget as enabled/disabled you could also then set a custom flag using the SetGadgetData function, then use GetGadgetData to retrieve the value to see if it's currently enabled/disabled.
(assuming you're not already using that data for some other feature)
User avatar
Michael Vogel
Addict
Addict
Posts: 2798
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Please Add IsGadgetDisabled

Post by Michael Vogel »

fsw wrote:Please Add IsGadgetDisabled (or what ever name you like) as a PB native command.

Thanks
fsw
Wouldn't be an internal PB function for IsGadgetEnabled executed a little bit faster than IsGadgetDisabled?
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Please Add IsGadgetDisabled

Post by netmaestro »

A disabled gadget should take longer to report its status, it only makes sense as it's going to be using a walker.
BERESHEIT
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Please Add IsGadgetDisabled

Post by ts-soft »

Some more GetGadgetState like:

Code: Select all

GetGadgetState(Gadget, #PB_IsGadgetDisabled)
GetGadgetState(Gadget, #PB_IsGadgetHidden)
GetGadgetState(Gadget, #PB_IsGadgetByBullFrogDesign) ;-)
would usefull!
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2137
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: Please Add IsGadgetDisabled

Post by Andre »

@ts-soft: +1 :mrgreen:
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
uwekel
Enthusiast
Enthusiast
Posts: 740
Joined: Sat Dec 03, 2011 5:54 pm
Location: Oldenburg (Germany)

Re: Please Add IsGadgetDisabled

Post by uwekel »

+1
That's what i needed today.
PB 5.70 LTS (x64) - Debian Testing, Gnome 3.30.2
User avatar
STARGÅTE
Addict
Addict
Posts: 2227
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Please Add IsGadgetDisabled

Post by STARGÅTE »

State is for the items only, I prefer Attribute:

GetGadgetAttribute(Gadget, #PB_Gadget_Disabled)
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Please Add IsGadgetDisabled

Post by c4s »

+1 for disabled and visible state.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Olby
Enthusiast
Enthusiast
Posts: 461
Joined: Mon Jan 12, 2009 10:33 am
Contact:

Re: Please Add IsGadgetDisabled

Post by Olby »

+1
Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)
User avatar
Josh
Addict
Addict
Posts: 1183
Joined: Sat Feb 13, 2010 3:45 pm

Re: Please Add IsGadgetDisabled

Post by Josh »

Why not only DisableGadget with a return value?

Code: Select all

If DisableGadget(#Gadget) = #True
  ...
EndIf
sorry for my bad english
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Please Add IsGadgetDisabled

Post by c4s »

@Josh
What if you only want to get the state of he gadget and not actually disable it? Also this would introduce some kind of "meta behavior" which isn't really clear and should be avoided if possible - similar as currently having to use FileSize() to check if a file exists or is a directory.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
User avatar
Josh
Addict
Addict
Posts: 1183
Joined: Sat Feb 13, 2010 3:45 pm

Re: Please Add IsGadgetDisabled

Post by Josh »

c4s,

can't see the problem from our side. If such a construct is a problem for fred, is a other problem :mrgreen:

SET a property:
DisableGadget (#Gadget, Status)

GET a property:
If DisableGadget (#Gadget)
...
EndIf
sorry for my bad english
Post Reply