Better autocompletion constants...

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Caronte3D
Enthusiast
Enthusiast
Posts: 248
Joined: Fri Jan 22, 2016 5:33 pm
Location: Spain

Better autocompletion constants...

Post by Caronte3D »

Hi! :D
When you are writing a gadget declaration, would be nice if only show the constants valids for that gadget.

Example:

If you start to write: "#PB" in the second parameter of: "SetGadgetColor(#Gadget, ColorType, Color)" I expect to get only these:

#PB_Gadget_FrontColor
#PB_Gadget_BackColor
#PB_Gadget_LineColor
#PB_Gadget_TitleFrontColor
#PB_Gadget_TitleBackColor
#PB_Gadget_GrayTextColor

This would be a huge time saver to users like me with poor memory :D because they must be looking at the help over and over again.

Thanks!
BarryG
Addict
Addict
Posts: 1810
Joined: Thu Apr 18, 2019 8:17 am

Re: Better autocompletion constants...

Post by BarryG »

Good idea! But this would only be possible for built-in constants (not custom ones). Still, that's not a major issue.

And not just for gadgets, but for windows: OpenWindow(win,x,y,w,h,title$,auto-complete-flags-go-here).

And for whatever other commands use built-in constants.
acreis
Enthusiast
Enthusiast
Posts: 156
Joined: Fri Jun 01, 2012 12:20 am

Re: Better autocompletion constants...

Post by acreis »

Excellent idea, this can be possible for user constants too:

Code: Select all


   Enumeration  MyMetricsConstants
  
  #MILLIMITER
  #CENTIMETER
  #DECIMETER
  #METER
  
EndEnumeration

Procedure ConvertMilesToMetric(Distance.d, unit.MyMetricsConstants)
  
  ;smart code here
  
EndProcedure

User avatar
ChrisR
Enthusiast
Enthusiast
Posts: 450
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Better autocompletion constants...

Post by ChrisR »

Good idea, it would be really useful and a big time saver.
It could also be for Set(Get)GadgetAttribute, GadgetState,... <-- edit: I wrote without reading it all, it is already written by BarryG, above
davido
Addict
Addict
Posts: 1859
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: Better autocompletion constants...

Post by davido »

+1
DE AA EB
Post Reply