OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Fred Tomke on March 09, 2009, 07:24:36 AM

Title: OpenButton in FileDialog
Post by: Fred Tomke on March 09, 2009, 07:24:36 AM
Hello, I've attached a sample.


I have a similar filedialog in the same project, but for writing. In that dialog the form closes when I click on save, but why not in the form to open a d81 file? Does anybody have any idea, what am I doing wrong?

Fred
Title: Re: OpenButton in FileDialog
Post by: owenwengerd on March 09, 2009, 08:17:11 AM
The function c:lvman_sc_gaeb_import_OnCancelClose must return NIL if you want the dialog to close.
Title: Re: OpenButton in FileDialog
Post by: Fred Tomke on March 09, 2009, 09:17:13 AM
Thank you, Owen. Normally, I should have known this.

On the other hand it discovers an other problem:

When I press ENTER when the text box with the number of lines has the focus, OnCancelClose will be fired and this argument ESCWasPressed = 0. In this case I want to prevent the form from closing. When I select a file and I press the open button, OnCancelClose will be fired and ESCWasPressed = 0. But in this case I want the form to get closed. How can I make a difference? Ok, you'll say: Trigger OnReturnPressed of the textbox. I've done it and it works: ESC closes the form, Open button closes the form, Enter in textboxe does not close the form. But do I hit Enter when the ListView currently has the focus, the form will be closed. Although I have activated the OnReturnPressed event for ListView, this event won't be fired (see new attachment). Which conditions have to be true that the ListView fires the activated OnReturnPressed event?

Fred
Title: Re: OpenButton in FileDialog
Post by: owenwengerd on March 09, 2009, 10:50:49 AM
I think there are still a lot of issues with the List View control. In this case, I found that the control was set to send all keyboard messages to the dialog manager instead of processing them itself. I've uploaded changed the code so that the keyboard input goes to the list view control; please test this and check for any unexpected side effects.
Title: Re: OpenButton in FileDialog
Post by: Fred Tomke on March 09, 2009, 10:56:29 AM
Hi, Owen, thank you, I will do as soon as the kids are in bed.

Fred
Title: Re: OpenButton in FileDialog
Post by: Fred Tomke on March 09, 2009, 12:57:41 PM
Hello Owen, I had a quick test, luckily pressing ENTER in the ListView does not cause any longer closing the form (and OnCancelClose is not being fired) any longer. Very nice. I had short tests with selctions and drag&drop and it still seems to work. My short test cannot replace long time tests, but I'm full of hope that it might be resolved  :) Great thanks!

Fred
Title: Re: OpenButton in FileDialog
Post by: owenwengerd on March 09, 2009, 01:39:12 PM
Good to hear. I've since enhanced it slightly so that the new behavior is activated only when there are events defined for either KeyUp, KeyDown, or ReturnPressed.
Title: Re: OpenButton in FileDialog
Post by: Fred Tomke on March 09, 2009, 02:22:26 PM
Ah, good to know - I was just going to deactivate the OnReturnPressed event at the listview. It should be documented? I don't know whether there will be some additional changes in future.

Fred
Title: Re: OpenButton in FileDialog
Post by: owenwengerd on March 09, 2009, 03:49:58 PM
It is now documented here. ;)
Title: Re: OpenButton in FileDialog
Post by: Fred Tomke on March 10, 2009, 12:49:47 AM
Should this behavior be transmitted to the textbox to make it uniformly?
Title: Re: OpenButton in FileDialog
Post by: owenwengerd on March 10, 2009, 12:59:47 AM
Yes, good idea, I will do that.