Grid questions

Started by Fred Tomke, May 08, 2008, 07:25:23 AM

Previous topic - Next topic

Fred Tomke

Hello,

I have three problems with a grid. Use the attached project and lisp with A14.

1. 4 of 6 switchable icons do not work. The only difference is that the preset icons are not the first which were defined in setitemstyle-method. An example: when I use (dcl_grid_setitemstyle grid row col 3 4 5) and I continue with (dcl_control_setitemimage control row col 4) the images can be switched, but not when using (dcl_control_setitemimage control row col 5).

2. I can preset ACI color in the rgb-style cell using (dcl_Grid_SetItemStyle grid row col 31 83). Then the right color will be shown. But no text is shown. When I add the text later then an rgb color 0,0,0 will be set. How can I avoid that? Or better: how can I make sure that the color number is shown as text, too? In this cell ACI, RGB and color books shall be selectable. That's why cell style 20 and 30 are not good in this case.

3. How to preset a lineweight value?

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

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

Fred Tomke

Workaround for number 1:

Assign the item style 3 with the switchable icons ordered by the current state: the first icon must be the icon which shall be shown during initialization:


(setq lstPic (list 1 2)); 1 = true, 2 = false
(setq lstPic (if (= uCurrentValue :vlax-true) (vl-sort lstPic '<) (vl-sort lstPic '>))) ; uCurrentValue is the current property's value
(dcl_Grid_SetItemStyle layer_sc_layer_props_grd_props intRow 1 3 (car lstPic) (last lstPic))
(dcl_Grid_SetItemImage layer_sc_layer_props_grd_props intRow 1 (car lstPic))


Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

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

Fred Tomke

Ok, Owen told me to use GetItemCheck and SetItemCheck for my first problem:


(setq lstPic (list 1 2)); 1 = true, 2 = false
(dcl_Grid_SetItemStyle layer_sc_layer_props_grd_props intRow 1 3 (car lstPic) (last lstPic))
(dcl_Grid_SetItemCheck layer_sc_layer_props_grd_props intRow 1 (if (= (last lstItem) :vlax-true) 0 1))


That works very fine!

Thanks, Owen!   ;D
Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

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

owenwengerd

Setting a true color cell's text resets its image index, but it should work as you expect if you set the text first, then the image index. The logic for converting a color value into displayable text is contained within the "editor" for the cell (in this case the true color dialog), so it is only used when interactively editing the cell contents.

For lineweight cells, the image index specifies the lineweight in hundredths.  That is, a lineweight of 1.00 millimemeters is specified as an image index of 100.
Owen Wengerd (Outside The Box) / ManuSoft

Fred Tomke

Thanks Owen,

lineweight preselection works very well but I have to have it in mind to set the text (0.53 mm) at first and only after that I have to use setitemstyle with the lineweight value.

Yes, the preselection of ACI colors works very well now. Are there any experiences in preselect colors from color books?

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

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