Obtain the list controls into form

Started by Emiliano · 2015-02-26 04:33 UTC · 6 replies · SMF topic #2237

I need to make a loop on all the controls within a form.
For each control I would like to determine its name and according to this effect some operations such as. disable it.

I found the "dcl-Form-GetControls", but I have noticed that returns a list of entities.
(entget) returns nil on these entities.

Does anyone have some sample code to disable all the controls on a form except one?
Or any suggestions?

Thanks in advance.
The returned list are not entity handles, but {2}. You can pass these control handles as arguments to any OpenDCL functions that expect control handle arguments.
hello emiliano,
(foreach x (dcl_Form_GetControls "dialogName" "formName") (dcl_Control_SetVisible x T))

best regards
marco
Thanks to your suggestions, I wrote this:


(foreach x (dcl-Form-GetControls FormName) (princ (strcat "\n" (dcl-Control-GetName x))))


and now I can do what I need;-)

Thank You
mmmmmmmmmmmmm

other problem  :'(

How can I check if a control is located in a given TabStrip, or directly in ControlBar?
One way is to use a naming convention that you can use to identify the associated tab. For example, you could use a special prefix for controls on the main form, then identify those controls at runtime by testing for the prefix.
This is a good idea, but I hope not having to edit code.

Thanks for the suggestion.