dealing with button pickks on a modeless, while user is in an acad command

Started by jmaeding, October 20, 2011, 10:22:44 AM

Previous topic - Next topic

jmaeding

I have a few modeless dialogs my progs use.
If the user is in the middle of some other lisp function, and they pick a button on the modeless, the code for the modeless cannot run, as that would interrupt the other function running - right?
Is there any way to allow the modeless code to run for that button in a graceful way?
Let's assume i have code for both the original command the user is running, as well as the dialog and callbacks.
Does the synchronous or asynchronous property of the button have anything to do with it?

I say button, but really what is going on is the user is switching the value of a dropdown list while in another command.  I guess I could disable the modeless at start of command to prevent this, but the error catching of the command must be perfect to re-enable the modeless when done, rather fragile.

Currently, I have to save the state of the dropdown, then check its state whenever commands are run that rely on it.  The problem is that when the user changes the dropdown while within another command, its code does not run, but the user thinks it worked because the dropdown shows the new value.

owenwengerd

In general, I would design a modeless dialog so that UI elements are disabled while they won't work.  In your case, editor reactors should reliably capture command and lisp state changes, but my first choice would be to use a document reactor to monitor document locking (and in addition, respond appropriately to the form's EnteringNoDocState event).  Of course the best solution would be a combo that doesn't need to execute any event handlers, but that isn't always possible.
Owen Wengerd (Outside The Box) / ManuSoft

jmaeding

thanks for the reply Owen, I'll probably have to disable the controls on the modeless as they do trigger other things to happen normally.

While I talking, I am seeing the need for various genric add in functions my lisps need, that .net does well.
Given that you can make a lispfunction with .net, I keep thinking someone will make a library of lisp fucntions with .net and sell it.  Might not sell for much, but things like a decent directory selector and color dialog with truecolor tab would be useful. thx

Fred Tomke

Hello,

Quotedecent directory selector
How about dcl_SelectFolder?

Quotecolor dialog with truecolor tab
How about (acad_truecolordlg ...)?

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

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