Grid_SetCellStyle 30 and 31 buggy on AutoCAD 2013?

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

Previous topic - Next topic

HIPPODAMOS

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

owenwengerd

I could not reproduce the problem in AutoCAD 2013 x64 using the GRID sample.

HIPPODAMOS

#2
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:




On the base of AutoCAD 2013 and OpenDCL.x64.19.arx the user gets no dialog, if he clicks on the cell.

Sincerely,

HIPPODAMOS



owenwengerd

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?

HIPPODAMOS

#4
QuoteHave you tested with the GRID sample by adding a row of style 30 or 31?




I´m sorry. Which grid sample do You mean?


Edit: I´ve found a grid sample in the "Studio-folder"

owenwengerd

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.

HIPPODAMOS

Thank You. I´ve just found it in the same moment as You posted your last message.

HIPPODAMOS

This sample was written by Fred Tomke. Isn´t it?

I know this style.

HIPPODAMOS

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

owenwengerd

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.

owenwengerd

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.

HIPPODAMOS

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.

owenwengerd

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.

HIPPODAMOS

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)



The problem in our source code must have a different cause.

Fred Tomke

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
Fred Tomke
Dipl.-Ing. (FH) Landespflege

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