HippoEDIT forum

General Category => Scripting, Scripts and Macros => Topic started by: alex on September 12, 2009, 01:54:49 PM

Title: Scripting brief specification
Post by: alex on September 12, 2009, 01:54:49 PM
Hi All,

I have done some analysis, and I think we can already discuss here some architectural basis of new scripting engine for HippoEDIT.

Which functionality is planned:

Objects:

Rest would come later, based on your suggestions and my investigations.
That would be very useful to get a proposal of built-in objects architecture (object names, methods etc). Also please comment on method/event names because it would not be possible to change this after implementation.

From scripting models, as far as I have checked them, best is which used in emeditor (also done with Windows Scripting) but some parts, I think, can be designed better.

I would extend this post with details, as far some part would became clear.

Best regards,
Alex.
Title: Re: Scripting brief specification
Post by: Stefan on October 07, 2009, 11:51:10 AM
Looks good, as far as i understand.


>Rest would come later, based on your suggestions
I don't know what you wanna hear or need, so here just some thought:

Methods:
 bAnswer = Yes/No
 bConfirm = OK/Cancel
 get/set HE Settings like HE.Setting.Get(SelectionMode), HE.Settings.Set(LineNumbers=0),
            HE.Settings.Set(colorscheme=blue)
 HTMLDialog as extension for simple MsgBox and for complex UI (comes later, i know)
 fileSave( string sFileName ). Save document as sFileName or ask for file name if sFileName is empty.
 FileDelete( string sFileName )
 execute( CleanUp.vbs ), execute( comspec /c delete  string sFileName)
 runTool( compiler )
 TabNew/TabClose
 TabSetAsCurrentActive

Events:
 onFileLoad/close (or is this part of onCommand ?)
 onFocus/Focus loose (tab and/or app)
 onKey (key is pressed)
 onMouse move / click


>to get a proposal of built-in objects architecture (object names, methods etc).
You ask for an collection of commands needed?
Like that  we would need things like 'GetLineCount' or 'get/set Pos of Line/Column' ?

.
Title: Re: Scripting brief specification
Post by: alex on October 07, 2009, 02:50:53 PM
FileDelete, and execute I think this is part of scripting engine functionality and should not be done in HE (FSO maybe).  Not sure.

onCommand is event before executing command. So you can cancel standard processing and replace it by your own.
So onFileLoad is Ok.

When I ask about objects methods, I mean object oriented architecture of HE.
So, you have Application object - it has onFileLoad event, OpenFile method etc...
You have a Document object - it has onFileSave (maybe can be also done as Application event), InsertText, GetText etc...

So to not have a global list of everything but separated by objects. Like here (http://www.emeditor.com/help/macro/). But maybe it is too early to talk about this :)