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

Re: Snippets - !Makro



In message <586042bc64tim@xxxxxxxxx>
          Tim Hill <tim@xxxxxxxxx> wrote:

> In article <2be7116058.fjgraute@xxxxxxxxx>, Fred Graute
> <fjgraute@xxxxxxxxx> wrote:
> >  - Dragging a file to an insert button currently assigns the macro to a
> >    button with a name of '<untitled>'. It might be better if it opened
> >    the Edit dialogue for that button so that the name can be entered
> >    immediately.
> 
> Pre-filled with the name of the file dragged there?

Ta! Good idea.

> >  - Change the file format to: BBGGRR <tab> name <tab> string Having
> >    each macro on a single line seems tidier to me (parsing is a bit
> >    more complicated though). The BBGGRR at the start of the line would
> >    be the colour to use for the text on the button.
> 
> For consistency with things like RISC OS colour pickers and CSS, wouldn't
> RRGGBB be more usual?  

Yes, it would. I just used the format that's required in the button's
validation string. My suggestions were just things that occurred to me
without giving much thought to how it would be implemented or even if
would work.

Here's something else that occurred to me and that people might find
useful.

Many of the current makros are used to insert bits of HTML. Most don't
seem to use the facilities offered by GSTrans so having to escape the
text just so GSTrans doesn't alter it is cumbersome.

There is also the limit of 256 characters meaning that larger chunks of
HTML would need to be split into multiple makros.

Fortunately, Makro allows *commands to be executed and that provides a
way around the 2 problems above. Instead of a button click inserting the
HTML code directly have it run a *command:

 *Message StrongED_ExecCmds InsertFile("<filename>")

This will cause a message to be sent to StrongED telling it to insert
the file <filename> at the cursor position. Tested it with a 20k file
which worked fine, and much faster than going through the keyboard
buffer.

There is one limitation: it will normally only work with the first
running instance of StrongED. Probably not a problem for most, I guess
I'm one of the few that runs multiple copies of StrongED simultaneously.

Cheers,
Fred.

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