[Jaffa Software]

WimpWorks Editors

Introduction

WimpWorks can, in addition to WEMs, have additional editors (eg. the subroutine editor) integrated into it at runtime. This document describes how to produce new editors for WimpWorks.

New editors consist of an application directory installed within !WimpWorks.Resources.Editors.

Format of an Editor

An Editor is an application (a directory starting with an exclamation mark - '!') containing at least three files:

!Run

This file is run when WimpWorks is started and should be used to inform WimpWorks how much memory this editor takes up. The amount will depend on the number of variables, size of code etc. An example file is:


| !Run file for !ButtonBar, a WWv2 Editor
| © Jaffa Software 1997. All rights reserved.

Set WimpWorks$ButtonBar$Dir <Obey$Dir>
IconSprites <WimpWorks$ButtonBar$Dir>.!Sprites
If "<WimpWorks$Dir>"<>"" Then Run <WimpWorks$Dir>.Resources.AddSlot -plus 4K

!RunImage

This is the main file which contains subroutines called by the main WimpWorks editor, the subroutines are described below (for an editor called !ButtonBar):

In all the above functions curApp$ contains the full filename of the current project, and curEdit% contains the current editor number, ie. yours. Your current editor number is also your item number within editMenu% (the "Editors" menu). WWv2Version% contains the version of WimpWorks * 100 (eg. 220) in versions 2.20 and above.

There is also a stub routine which can be REDEFINEd to point to your own parser, note the original should still be called otherwise the internal commands will not be updated.


DEF FN__parser(line$, temp$)
  ' line$ - The actual line being parsed, this should not be processed,
  '         but any operations on temp$ should be mirrored on
  '         this exactly the same way.
  ' temp$ - Contains the line being parsed with all the text
  '         between any "s replaced with spaces. This string
  '         should be used to search for text in.
=FNoldPrser(temp$,line$)

!Sprites

This file is technically optional, however should be included as then your editor will look attractive within a directory display.