Started by zeeboy ·
2009-06-19 19:07 UTC ·
5 replies · SMF topic #824
zeeboy
2009-06-19 19:07 UTC
(dcl_ComboBox_FindLineWeight psCreateNewLayer_cmbbxLayerLineweight -3) is returning nil for me. It should return the Default LineWeight according to the help file.
Any suggestions?
Thanks!
owenwengerd
2009-06-20 02:50 UTC
That's a documentation error. The "Default" lineweight has a value equal to whatever the default lineweight is, so a value of -3 will never be found in the list. I will correct the documentation by removing -3 from the table.
fred_tomke
2009-06-20 09:17 UTC
author=owenwengerd link=topic=824.msg4085#msg4085 date=1245466204 wrote:
I will correct the documentation by removing -3 from the table.
That would be bad. Why shouldn't it be possible to select the value -3 for Default as it could be selected from the dropdown in the layer properties manager?
Fred
owenwengerd
2009-06-20 19:20 UTC
Fred, the Default value is still there, and it can still be selected either by the user or by SetCurSel.
fred_tomke
2009-06-21 11:38 UTC
author=owenwengerd link=topic=824.msg4087#msg4087 date=1245525622 wrote:
Fred, the Default value is still there, and it can still be selected either by the user or by SetCurSel.
Ok, then I must have misunderstood you.
Fred
owenwengerd
2009-06-21 11:50 UTC
It may help to understand what is going on behind the scenes. Each item in the color and lineweight combo boxes automatically gets item data assigned that represents the actual color or lineweight for that item. In the case of "Default" lineweight, the item data is the actual default lineweight (as set by the LWDEFAULT system variable). FindColor and FindLineWeight just scan through the list searching for item data that matches the target value. Therefore, FindLineWeight will not find any item data with a value of -3, however if LWDEFAULT is 25, then (FindLineWeight 25) will find the Default item because it appears earlier in the list than the "0.25 mm" lineweight.