Hi,
I think Grid_SetCellStyle in combination with 30 and 31 (ACI- colours and RBG- colours) does not work correctly on AutoCAD 2013: There is no dialog (acad_truecolordlg) to choose a colour if clicked on the cell. If the same LISP-code is used on the base of AutoCAD 2012, it works correctly.
I use the Current Build [7.0.0.8]
Sincerely,
HIPPODAMOS
I could not reproduce the problem in AutoCAD 2013 x64 using the GRID sample.
Hi Owen,
thank You for Your response!
On the base of AutoCAD 2013 I use OpenDCL.x64.19.arx in the version 7.0.0.8.
In our source-code is a line like this: (dcl_Grid_SetCellStyle manage_sc_hatch_select_grd_prop intRow 1 (if (< reaAcad 16.0) 30 31)), which configures the style of a cell using dcl_Grid_SetCellStyl with the value 30 if an earlier AutoCAD- base is used and configures the style of the cell with the value 31, if AutoCAD in the version 16.0 or later is used.
On the base of AutoCAD 2012 and OpenDCL.x64.18.arx the user gets this dialog, if he clicks on the cell:
(http://imageshack.us/a/img32/1248/choosecolour.jpg) (http://imageshack.us/photo/my-images/32/choosecolour.jpg/)
On the base of AutoCAD 2013 and OpenDCL.x64.19.arx the user gets no dialog, if he clicks on the cell.
Sincerely,
HIPPODAMOS
Unfortunately I cannot fix the problem if I can't reproduce it. Have you tested with the GRID sample by adding a row of style 30 or 31? Are you not seeing the [...] button at all? Does anything at all happen when you click on it?
QuoteHave you tested with the GRID sample by adding a row of style 30 or 31?
(http://imageshack.us/a/img442/4484/gridsample.jpg) (http://imageshack.us/photo/my-images/442/gridsample.jpg/)
I´m sorry. Which grid sample do You mean?
Edit: I´ve found a grid sample in the "Studio-folder"
The file is GRID.lsp in your OpenDCL Studio samples folder (Program Files\OpenDCL Studio\<language>\Samples). Just drag and drop it onto your AutoCAD window to run it.
Thank You. I´ve just found it in the same moment as You posted your last message.
This sample was written by Fred Tomke. Isn´t it?
I know this style.
Hi Owen,
this sample is different. It uses dcl_Grid_SetItemStyle instead of dcl_Grid_SetCellStyle.
I think, there is a problem with dcl_Grid_SetCellStyle.
Sincerely,
HIPPODAMOS
Quote from: HIPPODAMOS on September 27, 2012, 09:23:20 AM
This sample was written by Fred Tomke. Isn´t it?
Yes, Fred wrote the German language translations of the sample files.
Quote from: HIPPODAMOS on September 27, 2012, 09:42:30 AM
I think, there is a problem with dcl_Grid_SetCellStyle.
The functions are identical -- dcl_Grid_SetItemStyle is the deprecated name. Please answer my questions.
QuoteHave you tested with the GRID sample by adding a row of style 30 or 31? Are you not seeing the [...] button at all? Does anything at all happen when you click on it?
The sample works.
But there are differences between dcl_Grid_SetItemStyle and dcl_Grid_SetCellStyle
In the sample, where dcl_Grid_SetItemStyle is used, there is a [...] button and the dialog appears if clicked on the button..
If dcl_Grid_SetCellStyle is used, there is no [...] button on the base of AutoCAD 2012, but the the dialog appears at once.
If dcl_Grid_SetCellStyle is used, there is no [...] button on the base of AutoCAD 2013 and nothing happens.
Quote from: HIPPODAMOS on September 27, 2012, 03:19:14 PM
But there are differences between dcl_Grid_SetItemStyle and dcl_Grid_SetCellStyle
You are mistaken. If the sample works and your application does not, then there is another reason. Please construct a simple .odcl and .lsp sample that demonstrates the problem so I can try to reproduce it here.
You are right.
I´ve replaced dcl_Grid_SetItemStyle with dcl_Grid_SetCellStyle in Your sample grid.lsp. Both versions work correct on the base of AutoCAD 2013: (see red mark)
(http://imageshack.us/a/img268/646/dclgridsetcellstyle.jpg) (http://imageshack.us/photo/my-images/268/dclgridsetcellstyle.jpg/)
The problem in our source code must have a different cause.
Hi, I can blow out the dust: There was a workaround in the past to solve a certain behaviour. It is new to me that the color cell style will show an ellipse button. If I remember right, in earlier releases 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. I'm sure this change has its reasons.
But in this special case this change has also consequences for the code HIPPODAMOS has mentioned. I can describe it best using the toggle cell style which worked similar in the function HIPPODAMOS noted (it growed up on my dunghill in the past: I didn't debug it yet with OpenDCL 7 but I hope it is still working this way :-\ ): 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.
With OpneDCL 7 this workaround suppresses the ellipses button of the color styled cell. And that makes it imagine that the color cell wouldn't work properly. But indeed it does, if I remove the workaround. So I will do.
Hope that helps,
Regards, Fred
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.
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
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
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, 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?
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, 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.
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
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