Issues with combobox in grid

Started by honkinberry, November 02, 2010, 11:43:51 AM

Previous topic - Next topic

honkinberry

I've got a Grid, composed entirely of Comboboxes (cell style 36).
There's a few complaints from users.  First, when typing in a new value, users must widen the column in order to enter lengthy text -- once the text fills the visible width of the combobox, it will not accept any more input.
Second, the popup list does not have an ability to scroll, so only about 30 values are shown, with the need to type a few letters in order to get it to display values at the bottom of the list.
And lastly, getting some Cx000005 errors at times.  There is a Grid LabelEdit event, which adds the current value to the Cell DropList, not sure if that could be to blame.  So far this behavior has only been reported and replicated on AutoCAD 2007 and 2008.

So with all that, is there a better way to accomplish what I'm after, then using the built-in Grid control with a Type 36 Combobox, or should I be using some ActiveX control?
Many, many thanks for any help!

--J

Fred Tomke

Hi,

the Cx000005 may caused by your code as you've already noted.
Can you create a small sample to demonstrate?
Maybe we could find a way together to solve or to point detailled things which can be added as a change request on SourceForge. And the small sample could help.

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

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

honkinberry

Attached is the sample code.
You can see that when typing a value into the combobox, you can only enter a certain number of characters, and then you have to resize the column in order to enter more characters.

The Cx05 error does seem to be related to my code, fired from Grid.EndLabelEdit.
Notice that it seems rather benign code to me, the memory leak would seem to be in the control:

(defun c:dclGridLabelEdit (Row Column / valx listx)
   (setq valx (dcl_Grid_GetCellText (eval (read (strcat dclform "_Grid1"))) Row Column)
      listx (car (dcl_Grid_GetCellDropList (eval (read (strcat dclform "_Grid1"))) Row Column))
      listx (if (not (member valx listx)) (append listx (list valx)) listx)
   ) ; setq
   (dcl_Grid_SetCellDropList (eval (read (strcat dclform "_Grid1"))) Row Column listx)
) ; GridLabelEdit

--J

owenwengerd

The text length issue turned out to be an easy fix: I just needed to add the CBS_AUTOHSCROLL combo style.  This is now fixed for the next build.  I'd like to see a reproducible case of the EndLabelEdit exception.

honkinberry

thanks for the quick fix!

here's an example of the other issues.

Note that only the first 30 items show up in the dropdown list, with no apparent way to select the others.

If you type in some value, any value, then hit Tab.
Then do that again and again -- it takes about 15 or so tries before I'm able to get it to generate the Cx05.

thanks again for looking at this!

--J

owenwengerd

I could not reproduce either problem on Windows 7 / AutoCAD 2011. I noticed that in the normal combo box form OpenDCL uses the WS_VSCROLL style, but this style is missing for the grid edit control version of the combo box control, so I suspect this is the cause of the problem, it just happens that Windows 7 automatically expands the dropdown so it doesn't need the vertical scroll bar.  I've added the WS_VSCROLL style for the next build, so please test this when the next build is released.  Let me know the Windows and AutoCAD versions needed to reproduce the exception, and I'll have another look.

honkinberry

Windows 7.32, AutoCAD 2008 and 2011.
In 2011, I see only the first 32 entries in the popup list.

Will definitely take a look at next build!

--J