On Tue, 3 Jan 2012 15:28:07 -0800 (PST) HansBKK <[email protected]> wrote:
> On Tuesday, January 3, 2012 11:05:49 PM UTC+7, Terry wrote: > > - I don't think it's possible to support single and double click > actions without using a timer, which Edward doesn't want, which I > understand, as they do scary things to code execution pathways > > I have no idea about this, nor why new code would need to do anything > different - Leo seems to currently be distinguishing between single and > double-click just fine? Only if single click just selects the node, in which case you don't notice the fact that *both* the single and double click actions are taken. Right now the only other thing I can think of that a single click might do is start editing of a selected node (there's a flag for that), and without a timer to see if the click was actually the first of two, you can't have both single and double click actions. Not worth the complexity unless there's a more important use case, although I did have timer code working at one point. > Allow the user to add to the contextmenu.py list, and also to override or > delete the default ones (currently "baked in") as desired in myLeoSettings. > Allow for filtering commands out based on presence/absence of a list of @ > directives (ideally allowing user-defined custom ones?). > > If not too difficult (blue-sky flag), allow custom scripts to be included, > ideally via full-command strings as well. > > Ideally also allow these to be applied to URLs, parsing the protocol > (http/ftp) vs file and file extensions (maybe even mime types) So it seems like there's two things here, 1 have a @setting, probably a @data node, where the user can list a bunch of 'full-commands' to be listed on the context menu. That wouldn't be too hard 2 make sure the functionality of plugins is exported as commands - a mix of documentation and wrapper functions 3 (because lists are always longer than you expect :-) I'm not sure how this relates to single/double click actions. On the context menu you pick the item you want - the system doesn't have to guess which has priority. I think the act-on-node machinery allows a plug-in to act *and* pass on to subsequent plug-ins, or act and not pass on. As an aside, this and another post recently have shown that some people view Leo's 'full-commands' as a way of extending / scripting Leo. I think the other post used them to construct an outline, something I'd never have thought of. While the commands are fine for things like key-bindings, Alt-X do-something, and maybe a list of commands on the context menu, as in (1) above, they're always going to be limited. They don't have conditional constructs and can't do things like inserting a list of choices based on context as opposed to just offering themselves. If you really want to shape Leo to your needs, Python is the way to go. Not that there's anything wrong with extending Leo with lists of commands, it's a tribute to Leo's flexibility that you can do that. Cheers -Terry -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
