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

Re: [StrongED] mode file for Impression DDF -- syntax Qs



In message <46a464b953.jim@xxxxxxxxxxxxxx>
          Jim Nagel <stred@xxxxxxxxxxxxxxxx> wrote:

> Fred Graute  wrote on 11 Dec:
>
> >> Many many thanks, Fred.  The "how to create modes" textfile is an
> >> enlightenment for me.  Have never seen that before.  Who wrote it?
>
> > I did. Don't remember exactly when or why, probably as an explanation
> > to someone, and then kept it in case it proved useful later on. It did
> > :-)
> > It only explains just enough to get started with writing a mode.
> > There's a lot more to modes than creating a directory and a basic
> > ModeFile.
>
> Fred, I'm taking you up on something you said yesterday in the thread
> about the "manual at Torrens site gone AWOL".  You said this manual is
> quite out of date anyway and that we might as well ask here.  OK, some
> questions arise from playing with the basic DDF mode you sent.
>
>  - What do the EIGHT-digit (hex) numbers mean?  I'm used to six-digit
> RGB colours in other programs.

The colours can be specified in two ways:

 1 - A number from &0 - &F (0 - 15). These are Wimp colours taken from
     the standard 16 colour palette.

 2 - A 32 bit hex number of the format BbGgRrFF. Where Rr is the red
     component, Gg is green and Bb is blue. The bottom &FF is used by
     StrongED to differentiate RGB colours from Wimp colours.

The Wimp colours are no longer used internally, when the colours file is
read they are translated to RGB colours. When a Colours file is saved
the colours will be in RGB format.

Older Colours file may still contain Wimp colours and the internally
stored default colours are also in Wimp colour format (to save space).

>  - This particular example confuses me in that foreground and
> background colour codes look nearly identical.

I don't really see a problem here. The foreground is Wimp colour 7
(black, RGB &000000FF) and the background is Wimp colour 0 (white, RGB
&FFFFFFFF).

> The Fold command works nicely on the style definitions at the top of a
> DDF file, except that the last fold erroneously hides the beginning of
> the actual text as well.

Folding folds all the lines from start of fold up to and including the
line that matches the FoldEnd expression. You cannot make folding stop
in the middle of a line.

The only way around this to have the last style definition unfolded by
altering the FoldEnd expression to: "}{" \n

>  - Am I right to guess that the syntax in lines 2,3,4 is the same as
> used in the Advanced Search dialogue?

Yes.

>  - If so, the   [\n]   would mean that a newline is optional.  But it
> shouldn't be, because in DDF a "{" followed immediately by a newline
> marks the beginning of a style definition; if it's followed by
> anything else, it's part of the text.

Ah, thanks.

>  - What does   @0   mean?

@0 to @9 are marks and remember the matched position in the text. They
are used to control what's highlighted in a LoF and in Search&Replace
to retain bits of the original text.
See: Manual -> Reference section -> Advanced search -> Marks

> When I make changes, does iconbar "Rescan > Modes" pick them up, or
> does that routine deal only with stuff in !StrongED.Defaults.Modes?

There is no need to use "Rescan > Modes" when you alter a ModeFile, only
when you create a new mode. Changes made will be applied when saving the
ModeFile but the option 'Reload all modefiles when one is changed' in
Global Choices -> Edit must be ticked (it is by default).

> I ask because when I took the aforementioned [] away from \n and then
> did Rescan, the folding behaviour did not change.

You will need to unfold and fold the text again to see any changes in
folding, Ctrl-KpPlus to unfold then Ctrl-KpMin to fold.

> If I want to maintain consistent behaviour on the copies of StrongEd
> running on the three RiscOS machines here, where should I store this
> sort of stuff?  (Userprefs, choices, defaults, etc)

Don't know, I've never used StrongED in a network configuration.
Suggestions welcome!

Cheers,
Fred.

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

--
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxxxxx
List archives at http://www.Torrens.org.uk/RO/StrongED/index.html