Routine not working the same in different versions of Autocad and Bricscad

Started by hmspe, May 13, 2012, 08:52:59 PM

Previous topic - Next topic

hmspe

I've been working on a text input routine that echoes what is typed in a text box on the the screen in real time.  It is working as intended in Bricscad 11.  I tried similar code in Bricscad 12.1 and as I remember it worked OK.  I've upgraded to Bricscad 12.2.6 and the routine appears to exit before I type in the text box.  In Autocad 2010 everything works except backspace -- if I enter several characters then press backspace the textbox updates but the on-screen does not.  Checking Autocad's command history shows >> ; error: too many arguments << at this point.  Pressing backspace a second time updates the text box properly and removes two characters from the on-screen display. 

Could someone try the attached files and verify whether they work in Bricscad 12.2 and in Autocad? It is entirely possible that I've made a mistake in programming, but three different results makes me wonder.  FWIW the other ODCL routines that I have used for about two years that have textboxes are also not working in Bricscad 12.2.6.  I know that there were major changes in Bricscad 12.2 that could have broken ODCL.  Not so sure what's going on in Autocad 2010, but the execution tracing I did does not show any errors in the lisp code.  It looks to me like the wrong number of arguments (or a mal-formed list) are being sent with OnEditChanged every other time backspace is pressed.

To run the demo type   texthook  .  The on-screen text is inserted at (10 10 0) using the default style, height, and rotation.

Thanks for all help and suggestions.   

owenwengerd

It's a bug in rendering the backspace character when calling the OnKeyDown handler. I've fixed it for the next build.
Owen Wengerd (Outside The Box) / ManuSoft


hmspe

Owen:  Thanks for the 7.0.0.5 update.  It fixes the problem in Autocad.  I appreciate the work you've put into OpenDCL.

All:  Still having an issue in Bricscad 12.2.7 and I'm not sure if it is my coding or a Bricscad problem.  My intent is that when the form is loaded that the textbox automatically has focus.  In BC11 and BC 12.1 the code runs correctly.  In BC 12.2.7 I have to manually click on the form then leave the mouse cursor on the form for the textbox to have focus.  I have tried setting focus to the form, setting focus to the textbox, and setting focus to the form first then to the textbox, but still no joy.  If anyone can verify that this is a Bricscad problem or can point out an error in my code I would appreciate the help.

Martin

roy_043

I think this is a Bricscad problem.

I have added a c:TextHook_TextHook_TextBox_OnKillFocus function to your sample and tested in BC V11.4.6 and BC V12.2.7.

BC V11.4.6:
The dialog is displayed and the focus is on the textbox. The KillFocus event does not fire.

BC V12.2.7:
The dialog is displayed but the KillFocus event fires 3 times removing the focus from the textbox.


hmspe

I added an OnKillFocus function that resets the focus to the textbox when OnKillFocus fires.  This makes the test code work in BC12.2.7, but with a lot of screen flashing if the mouse cursor is not over the form.  The firing of OnKillFocus stops if the mouse cursor is over the form.  I have filed a bug report with Bricsys.

owenwengerd

It looks like the latest Bricscad v12 is not sending the WM_ACAD_KEEPFOCUS message. That's definitely a bug.
Owen Wengerd (Outside The Box) / ManuSoft

honkinberry

Note that the latest version of Bricscad (12.2.7) also kills the Member function, firing an exception if the List argument is nil.
It has been fixed and will be part of the next release.

--J

t.moses@gmx.de

Hi, All,

we are also just about to fix missing WM_ACAD_KEEPFOCUS ...
there was also an issue taking focus back to Bricscad, unconditionally;
forced focus switch is just fixed, and WM_ACAD_KEEPFOCUS is now sent;
the original code works fine then ... please check with an upcoming Bricscad update.

Greetings to all, Torsten