Page 1 of 1

Better autocompletion constants...

Posted: Sat Sep 25, 2021 8:15 am
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!

Re: Better autocompletion constants...

Posted: Sat Sep 25, 2021 8:26 am
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.

Re: Better autocompletion constants...

Posted: Sat Sep 25, 2021 11:22 am
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


Re: Better autocompletion constants...

Posted: Sat Sep 25, 2021 1:01 pm
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

Re: Better autocompletion constants...

Posted: Sat Sep 25, 2021 6:21 pm
by davido
+1