[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [StrongED] Re: Rescan



In message <573d00b84dLists@xxxxxxxxxxx>
          "Richard Torrens (lists)" <Lists@xxxxxxxxxxx> wrote:

> In article <4535cc3c57.fjgraute@xxxxxxxxx>,
>    Fred Graute <fjgraute@xxxxxxxxx> wrote:
> > You can force a rescan from an Obey file by using:
> 
> >   Message StrongED_ExecCmds RescanModes()
> 
> > However this only works if there is a StrongED view that has the input
> > focus. The problem here is that recent versions of RISC OS 5 support
> > keyboard shortcuts in the Filer.
> 
> > Because of this, as soon as you click in a Filer window it will gain the
> > input focus and hence StrongED loses it and the command(s) sent to it
> > from the Obey file will be ignored.
> 
> > If you can find a way to execute the Obey file from the keyboard (eg
> > Configure -> Keyboard) or a semenu (eg StrongMen) then it will work.
> 
> As I have found before, a useful answer often raises more questions!
> 
> 
> I have an Obey file (made from saving a LoF) which opens all of the
> ModeFiles in the Archived 4.69f12. This uses MESSAGE and runs as expected
> fron a filer window! It starts
> -----------------
> IfNTask SparkFiler Filer_Run SCSI::SSD.$.Utilities.!SparkFS
> WO_Wait 1
> 
> MESSAGE StrongED_OpenDoc
> SCSI::SSD.$.Network.Torrens.www.stronged/torrens/org.man.-ToDo. StrongHelpMan.se469f10/zip.!StrongED.Defaults.Modes.Ada.ModeFile 1324 1494 1292 1200
> 0 0 -autowrap -mode BaseMode
> -----------------
> So from your reply I'm curious as to why this works?

It works because StrongED_OpenDoc doesn't need a view with input focus,
as it just loads a file into StrongED.

StrongED_ExecCmds however does need a view as it executes functions and
they need a context for things like: wrapwidth, nl type, etc.

> The use of Message is briefly mentioned in StronhgHelp under
> Message StrongED_ExecCmds
> but I do not yet fully understand it.

You can send a UserMessage to StrongED which contains the following:

  StrongED_ExecCmds <list of functions>

Upon receiving such a UserMessage StrongED will apply the given
functions to the view with the input focus.

To do this you'll need to create a (small) Wimp application to build the
required message block and then send it using Wimp_SendMessage. The
format of the UserMessage block is given in the StrongED manual:
Reference section -> List of Messages -> StrongED_ExecCmds

Another way is to use the *command 'Message' which is provided by the
Dialogue module that comes with StrongED. The module will build the
required UserMessage block and broadcast it to all applications. This
allows you to use StrongED_ExecCmds from an Obey file:

  *Message StrongED_ExecCmds <list of functions>


If you have many functions to be applied then you can also use the
StrongED_ExecFile message:

  StrongED_ExecFile <filename>

StrongED will then execute all the functions in the given file.

If the file starts with a line that reads '#!stronged' then it can also
be dragged to a view's 'Script' icon on the toolbar (needs SE 4.70a12).

Cheers,
Fred.

-- 
StrongED Developer
http://www.stronged.iconbar.com/

-- 
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxx
List archives and instructions at
http://stronged.torrens.org/index.html