ProcessEditorEventW suggestions
ProcessEditorEventW suggestions
Hi!
For my plugins, I would find it quite useful if the ProcessEditorEventW function got expanded. Specifically, I need:
- EE_CANCLOSE, which would get called just before EE_CLOSE and with the same arguments. If it returned TRUE (the default value), then normal closing would commence, otherwise the closing would be aborted and the edited file would remain in the editor.
- Split EE_SAVE into "EE_BEFORESAVE" and "EE_AFTERSAVE".
- I don't need that yet, but it would follow that EE_LOAD would also have a BEFORE and AFTER variant.
Any chance of these functions being implemented? I expect the CANCLOSE event should be simple enough. Thanks.
For my plugins, I would find it quite useful if the ProcessEditorEventW function got expanded. Specifically, I need:
- EE_CANCLOSE, which would get called just before EE_CLOSE and with the same arguments. If it returned TRUE (the default value), then normal closing would commence, otherwise the closing would be aborted and the edited file would remain in the editor.
- Split EE_SAVE into "EE_BEFORESAVE" and "EE_AFTERSAVE".
- I don't need that yet, but it would follow that EE_LOAD would also have a BEFORE and AFTER variant.
Any chance of these functions being implemented? I expect the CANCLOSE event should be simple enough. Thanks.
- John Doe
- Бюрократ
- Posts: 13855
- Joined: Wed 27 Apr, 2005 20:42
- Has thanked: 73 times
- Been thanked: 428 times
- Contact:
Re: ProcessEditorEventW suggestions
Consider another approach: what if we had some special option for Editor function?
There are flags like EF_NONMODAL, EF_IMMEDIATERETURN, etc.
Maybe you need new flag EF_RETURN_BEFORE_QUIT?
There are flags like EF_NONMODAL, EF_IMMEDIATERETURN, etc.
Maybe you need new flag EF_RETURN_BEFORE_QUIT?
Re: ProcessEditorEventW suggestions
If I understand it correctly (maybe I don't), then it would not be suitable for my needs. How would it behave? In my opinion, it would only work for modal editors, and I can achieve much the same result for modal editors already.
- John Doe
- Бюрократ
- Posts: 13855
- Joined: Wed 27 Apr, 2005 20:42
- Has thanked: 73 times
- Been thanked: 428 times
- Contact:
Re: ProcessEditorEventW suggestions
It should behave like modal but return BEFORE quit, so you will get access to final editor content.
Re: ProcessEditorEventW suggestions
When I create a non-modal editor, my plugin stores some state information to a list. When a EE_CLOSE event arrives, I first check whether it is my editor which is getting closed, and if it is, I perform some operations before I allow ProcessEditorEventW to quit. Check my new DirSync for details.
Re: ProcessEditorEventW suggestions
My problem lies not in detecting the quit and doing something at the time, but in preventing the quit completely. The only way I can do it now is to copy the editor's file to a new name and open a new editor in ProcessEditorEventW. It works, but it is ugly.
Re: ProcessEditorEventW suggestions
Suppose that I have a file in the editor. I want to provide a function which would filter some lines (think grep). Then the user could edit the filtered lines and eventually quit the editor. At that moment I would recognize that a filter was in effect, so instead of actually quitting I would apply the filtered lines to the original file and show the original file again.
- John Doe
- Бюрократ
- Posts: 13855
- Joined: Wed 27 Apr, 2005 20:42
- Has thanked: 73 times
- Been thanked: 428 times
- Contact:
Re: ProcessEditorEventW suggestions
Then you should not complain about ugliness of your workarounds :-)