author=owenwengerd link=topic=2305.msg11601#msg11601 date=1441213063 wrote:
Under what conditions would that occur?
The original code assumes that the scale of the Hatch Control can be missing from ComboBox2. In that case ComboBox2 will display the first available scale in the list instead of the actual scale of the Hatch Control. But the Hatch Controls are not updated accordingly. I find this inconsistent. But of course all this is academic in a way. The programmer should ensure that the Hatch Controls have the same scale which should be present in the scale list.
Original code:
(defun c:Hatches/Hatch#OnInitialize (/ scale idx)
(setq scale (rtos (dcl-Control-GetHatchScale Hatches/Hatch/Hatch1) 2 0))
(setq idx (dcl-ComboBox-FindString Hatches/Hatch/ComboBox2 scale))
(if (< idx 0) (setq idx 0))
(dcl-ComboBox-SetCurSel Hatches/Hatch/ComboBox2 idx)
)