Object name property for controls?

Started by roy_043, May 28, 2014, 12:21:52 AM

Previous topic - Next topic

roy_043

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:
Code (autolisp) Select
(defun Dialog_Control_ColumnFit (control / objectName)
  (cond
    ((= (dcl-Control-GetObjectName control) "Grid")
      ...
    )
    ((= (dcl-Control-GetObjectName control) "ListView")
      ...
    )
  )
  ...
)

owenwengerd

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 (dcl-Control-GetProperties).
Owen Wengerd (Outside The Box) / ManuSoft

roy_043

In that case I will add an argument to the function to indicate the control type. Thank you Owen.