OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: roy_043 on May 28, 2014, 12:21:52 AM

Title: Object name property for controls?
Post by: roy_043 on May 28, 2014, 12:21:52 AM
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")
      ...
    )
  )
  ...
)
Title: Re: Object name property for controls?
Post by: owenwengerd on May 28, 2014, 07:35:41 AM
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 (http://www.opendcl.com/HelpFiles/index.php?page=Reference/Method/Control/GetProperties.htm)).
Title: Re: Object name property for controls?
Post by: roy_043 on May 28, 2014, 08:42:35 AM
In that case I will add an argument to the function to indicate the control type. Thank you Owen.