Topic: File type specific Double-Click event macro (1 of 6), Read 16 times
Conf: VEDIT Suggestions
From: Pauli Lindgren
Date: Monday, February 18, 2008 11:23 AM

I have been using double click event macro with many different file types in addition to the Wildfile search results (search.tmp). For example: Lint results, RCS diff results and my new SearchInc.vdm results list. However, Vedit only allows one double click event macro. So the event macro has to check the filename or extension in order to decide what to do on double click. If a new file type needs to use the event, the event macro has to be edited.

It would be cool if the double click event could be file type specific, like syntax highlight and template event macro are now.

Maybe the easiest way to do this would be just to add a buffer specific ConfigString parameter, for example "DOUBLECLICK_EVENT". The parameter would contain the filename of the macro that is to be called for double click event for this file type. The event macro would then just need to check if this parameter exists and then execute
CallFile(100,DOUBLECLICK_EVENT).

The same method could be used to perform other file type specific operations. For example, you could have a single "Function list" entry in the User menu regardless of what file type you are editing. The entry would just contain something like
CallFile(100,OUTLINER_MACRO).
This would call cfunc.vdm, bfunc.vdm, pfunc.vdm etc, depending on what was saved in the config string for that file type.

--
Pauli


P.S. And the WORD_SEP config string really should be buffer specific and saved with file type specific configuration.

 


Topic: Re: File type specific Double-Click event macro (2 of 6), Read 13 times
Conf: VEDIT Suggestions
From: Ted Green
Date: Monday, February 18, 2008 05:50 PM

At 11:24 AM 2/18/2008, you wrote:
>From: "Pauli Lindgren"
>
>It would be cool if the double click event could be file type specific, like syntax highlight and template event macro are now. ...

OK. Let me think about that this week as I am working on VEDIT.

Ted.

 


Topic: File type specific Double-Click event macro (3 of 6), Read 13 times
Conf: VEDIT Suggestions
From: Christian Ziemski
Date: Tuesday, February 19, 2008 07:48 AM

On 2/18/2008 11:23:04 AM, Pauli Lindgren wrote:
>
>It would be cool if the double click event could be file type
>specific, like syntax highlight and template event
>macro are now.

Good idea.

Just some thoughts:

Why not simply fill an appropriate Reg_Set(116, "...." ) into /vedit/file-cfg/*.CFT configuration file for now?


Anyway: Even if the event macro is used filetype specific, it would be good to have a global one as well.

Perhaps this way:
- Text register 116 for the global doubleclick event macro
- A new text register which could be filled by *.CFT or so.
- A new config() parameter for
-- a) ignore all doubleclick event macros
-- b) use filetype specific one, if any
-- c) use filetype specific one, if any. Else global one.
-- d) always prefer global one.


Christian

 


Topic: File type specific Double-Click event macro (4 of 6), Read 12 times
Conf: VEDIT Suggestions
From: Pauli Lindgren
Date: Tuesday, February 19, 2008 12:17 PM

On 2/19/2008 7:48:22 AM, Christian Ziemski wrote:
>
>Why not simply fill an appropriate Reg_Set(116, "...." ) into
>/vedit/file-cfg/*.CFT configuration file for now?

It does not work. The event macro would be loaded only when you open a file, and then this same double-click event macro would be used for all the files currently open.

And if you save file type specific configuration, any manual changes will be overwritten.

Currently, I check the filename extension inside the event macro and perform different operations when necessary.

>
>
>Anyway: Even if the event macro is used
>filetype specific, it would be good to
>have a global one as well.

I was thinking that when no double-click macro has been specified, the internal double click operation would be used (i.e. highlight the word).

But of course the event macro can do more complex operations, too. For example, my current search116.vdm can highlight a word, line or chapter.

You don't need multiple text registers. It can be done inside the main event macro: if the event macro filename has been given, call it, else perform the global operation.

--
Pauli

 


Topic: Re: File type specific Double-Click event macro (6 of 6), Read 10 times
Conf: VEDIT Suggestions
From: Christian Ziemski
Date: Tuesday, February 19, 2008 02:03 PM

on 19.02.2008 18:54 vedit-suggest Listmanager wrote:
> From: "Pauli Lindgren"
>
> On 2/19/2008 7:48:22 AM, Christian Ziemski wrote:
>> Why not simply fill an appropriate Reg_Set(116, "...." ) into /vedit/file-cfg/*.CFT configuration file for now?
>
> It does not work. [...]

You are correct, I already realized that...

>> Anyway: Even if the event macro is used filetype specific, it would be good to
>> have a global one as well.
>
> I was thinking that when no double-click macro has been specified,
> the internal double click operation would be used (i.e. highlight the
word).

That internal double click may be an additional option/the last fallback.
With my "global" one I meant an user configurable event macro.

> But of course the event macro can do more complex operations, too.
> For example, my current search116.vdm can highlight a word, line or
chapter.
>
> You don't need multiple text registers. It can be done inside the main event macro:
> if the event macro filename has been given, call it, else perform the
global operation.

I'm realizing that I'm a little bit out of training regarding VEDIT...
Hopefully I'm nevertheless allowed to throw in my $0.02 from time to
time. ;-)

Christian

 


Topic: Re: File type specific Double-Click event macro (5 of 6), Read 10 times
Conf: VEDIT Suggestions
From: Christian Ziemski
Date: Tuesday, February 19, 2008 12:49 PM

on 19.02.2008 13:50 I wrote:
>
> Why not simply fill an appropriate Reg_Set(116, "...." ) into /vedit/file-cfg/*.CFT configuration file for now?

Ooops, that's a little bit of nonsense...
That doesn't work when switching between already open files of different
filetypes, only just ofter opening a file.

Christian