Object name property for controls?

Started by roy_043 · 2014-05-28 07:21 UTC · 2 replies · SMF topic #2144

If you want to create a function for several controls (in my case Grid and List View) is there a way to distinguish the control using some property similar to the ObjectName for CAD objects?

Example:
(defun Dialog_Control_ColumnFit (control / objectName)
  (cond
    ((= (dcl-Control-GetObjectName control) "Grid")
      ...
    )
    ((= (dcl-Control-GetObjectName control) "ListView")
      ...
    )
  )
  ...
)
There is no direct way unfortunately. To just distinguish between several possible control types, one workaround is to check for the existence of a control-specific property in the list returned by ({2}).
In that case I will add an argument to the function to indicate the control type. Thank you Owen.