Grid_SetCellStyle 30 and 31 buggy on AutoCAD 2013?

Started by HIPPODAMOS, September 26, 2012, 08:42:43 AM

Previous topic - Next topic

owenwengerd

Hmm, I'm not sure if the behavior is by design or not. I did change the code to end editing when the dialog is closed (or when a simple combo selection is made), so that is definitely by design.

However, if in previous versions only one click on a color cell immediately opened the color dialog, there may be a new bug that now requires the second click on the button. This makes me wonder how past versions behaved if a color cell became current via some method other than a left click.

Fred Tomke

Okay - but we should decide one way that I don't need to change my code each time   ;D .
I've found out that now the user has urgently to select another cell or control to make sure color cell editing will be finished to update the preview. For comboboxes I always define an OnMouseMove event within OnBeginLabelEdit at runtime to call OnEndLabelEdit after collapsing the dropdown. There I remove the OnMouseMove event at runtime. But I'm not sure if I should apply this design to the color cell, too.

I go to bed now.
Bye, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

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

HIPPODAMOS

Quote... the color dialog came up immediately, once the user has clicked the cell. Now he has to click twice: one to "activate" the cell and one on the ellipse button to open the color dialog. ...

But in this special case this change has also consequences for the code ... ... When a user has switched a toggle styled cell, the OnBeginCellEdit is fired, but not OnEndCellEdit. OnEndCellEdit will only be fired once the cell looses the focus (for instance the user selects another cell). But that's too late for me: I need a callback immediately. That's why I called (dcl_Grid_CancelCellEdit myGrid), so OnEndCellEdit will be fired. In this dialog it was very important that any cell value change was recognized by the program because it should cause a redraw of block previews just in time.

Hi Fred,

that's it!  You have solved the problem! Thank You very much for Your help!

Best regards,

HIPPODAMOS

Fred Tomke

Hi, Owen, will you change the workflow of color cells that the ellipse button will not be shown and the color dialog will be opened immediately when clicking on this cell? It would be interesting how to finish my code.

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

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

owenwengerd

Fred, I'm planning to fix anything that was unintentionally changed, but I need to know what is the correct behavior. What should happen when a color cell becomes active not by a left click, but by some other means? Do you know which build this changed?

Fred Tomke

Hi, Owen, I only have a 6.2.0.5. In this release there it was so that the color dialog came up immediately after clicking on this cell. When activating without clicking this cell nothing will happen. But when hitting space bar, color dialog comes up. In my experiences  it is Windows-conform.

The earliest release we have noticed the changed behaviour was 7.0.0.7.
Can I find the runtime releases in between anywhere?

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

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

owenwengerd

Fred, I looked at the SVN log and found that it was changed in Alpha 6. You are correct, there was no button at all in earlier builds. According to my comments, the change was part of a redesign to address several bug reports related to grid editing. Unfortunately there is no easy way to query bug reports closed within a specified date range, so I can't find the actual bugs in question. I don't know whether the color cell types were changed because of the bugs, or because while fixing the bugs I noticed that color cells work differently than other cell types, and decided to change them to be consistent with other cell types.

Do I understand you correctly that you already changed your code to handle the new behavior? If so, how did you manage to trigger the color dialog immediately?

I think it is best to leave the current design in place if possible, because it makes the cell editing code much cleaner and easier to maintain. Even with the new design, I want to make sure there is some way to prevent the requirement to click the button separately whenever possible. That may need to be addressed somehow in the OpenDCL code.

In any case, I would like to hear more about the problem with the check box style cell. With the updated grid cell editing design, cell edit controls that are "immediate acting" should now fire EndLabelEdit immediately; if not, that is a bug. The overriding goal is to make cell editing consistent and predictable, so that behaviors are well defined and easy to identify when they do not work as intended.

Fred Tomke

Hi, Owen,

Quote from: owenwengerd on September 30, 2012, 07:21:52 PM
Do I understand you correctly that you already changed your code to handle the new behavior? If so, how did you manage to trigger the color dialog immediately?
Yes, I did. When the user clicks on the cell with color style, OnBeginLabelEdit will be fired. I query the cell style and if it is 1 (toggle) or 31 (rgb) then I call CancelCellEdit, so EndLabelEdit will be fired. In that case I call acad_truecolordlg and handle its result.

Quote from: owenwengerd on September 30, 2012, 07:21:52 PM
In any case, I would like to hear more about the problem with the check box style cell.
As mentioned above I cancel edit mode in the BeginLabelEdit event, so EndLabelEdit will be called. I debugged it in OpenDCL 7 yet to test whether I could remove it or not.

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

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

Fred Tomke

QuoteAs mentioned above I cancel edit mode in the BeginLabelEdit event, so EndLabelEdit will be called. I debugged it in OpenDCL 7 yet to test whether I could remove it or not.
I've used the wrong time: I did not debug it yet.

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

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