(dcl_ComboBox_FindLineWeight psCreateNewLayer_cmbbxLayerLineweight -3) = nil

Started by zeeboy, June 19, 2009, 12:07:31 PM

Previous topic - Next topic

zeeboy

(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!
don't complain if you're not going to do something about it.

owenwengerd

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

Fred Tomke

Quote from: owenwengerd on June 19, 2009, 07:50:04 PM
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
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

Fred, the Default value is still there, and it can still be selected either by the user or by SetCurSel.
Owen Wengerd (Outside The Box) / ManuSoft

Fred Tomke

Quote from: owenwengerd on June 20, 2009, 12:20:22 PM
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
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

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