Started by roy_043 ·
2017-02-08 16:48 UTC ·
4 replies · SMF topic #2481
roy_043
2017-02-08 16:48 UTC
I am trying to understand the DwgList.lsp sample.
The ComboBox1 control does not have any active events, yet if I change the current selection the DWGList1 control is updated. How does this work?
Aside:
The name of one of the event-handlers is still based on the old naming scheme:
c:DwgListForm_DwgList1_OnDblClicked
owenwengerd
2017-02-10 00:48 UTC
I'm not sure I understand the question, but I suppose the behavior is hard-wired into the control.
owenwengerd
2017-02-10 01:36 UTC
I checked source code, and the behavior is indeed hardwired. The folder combo searches for a DwgList control on the same form, then sends change notifications to the first one it finds.
P.S. I've fixed the event name in the sample. Thanks for pointing it out!
roy_043
2017-02-10 20:50 UTC
Thanks for your explanation Owen.
I would like to suggest an improvement for the c:DwgList/DwgListForm/cmdUP#OnClicked function.
Currently using the 'Up' button causes all parents except the current, to be dropped from the combo list. Which is confusing and also means you are then restricted to a single drive. Using dcl-ComboBox-AddPath instead of dcl-ComboBox-Dir can fix this.
(defun c:DwgList/DwgListForm/cmdUP#OnClicked ( / sPath)
(setq sPath (strcat (dcl-ComboBox-GetDir DwgList/DwgListForm/ComboBox1) "\\.."))
; (dcl-ComboBox-Dir DwgList/DwgListForm/ComboBox1 sPath)
(dcl-ComboBox-AddPath DwgList/DwgListForm/ComboBox1 sPath)
(dcl-DWGList-Dir DwgList/DwgListForm/DwgList1 sPath)
(princ)
)
owenwengerd
2017-02-12 03:23 UTC
I've updated the sample (including a few other improvements) for the next update. Thanks!