question about Checkbox

Started by Iulian, March 22, 2010, 06:24:16 AM

Previous topic - Next topic

c2k

I have attached a zip file with an .odcl and a .lsp.

What I find is you have to run it and tick some check boxes, then close it.  And do it all over again. After a few times it starts messing up.  I can't figure out any certain way to make it mess up, it just eventually happens.  Sometimes I can't seem to get it to mess up for a long time.

I did find that if you open the .lsp code in the vlide, and then reload it from there it seems to mess up right away.  I have definitely noticed it more when I am working on the lisp.  Hope that helps in some way.
**CHRIS
Windows 7 64-bit
AutoCAD Revit MEP Suite 2010

owenwengerd

In the sample project, your main function loads and shows the dialog before it defines the event handler functions. Try moving your event handler function definitions in front of the code that displays the dialog. Let me know whether that resolves your problem.

c2k

I changed the code as suggested and tried again.  I am still seeing the problem.  First time I ran it I checked box 2, pressed text button 2, & closed the dialog.  Ran it again, and check box 1 was checked.  I attached the revised lisp so you can confirm I did what you wanted.
**CHRIS
Windows 7 64-bit
AutoCAD Revit MEP Suite 2010

owenwengerd

I have a theory. Are you starting the command by typing it, then pressing the space bar? If so, try it again but press and hold the space bar, then wait to release it until the dialog is completely displayed. Now when you release it, the check box gets checked because it has focus and "space bar up" translates to toggling the check box state. Is that what you're seeing? You can test the theory by using the <Enter> key instead of the space bar when starting the command.

owenwengerd

I've added code to ignore the space bar if it wasn't pressed while the check box control had input focus. This should fix the problem in the next build if I'm correct about the cause.

c2k

You are correct.  Using enter seems to work fine... holding space until the dialog is visible seems to work fine.
I look forward to the next build  ;D Thank you Owen.
**CHRIS
Windows 7 64-bit
AutoCAD Revit MEP Suite 2010