Editing the style(s) of text in a field.

Peter Haworth pete at lcsql.com
Wed Feb 26 18:52:23 EST 2014


Hi Alex,
On the un-mixed example, I wonder whether you should set the textstyle to
"plain" or empty?

For the mixed examples, I'd say 4 in both cases but the problem is that
won't always be what users want or expect.  If it's just for your own use,
that's not a problem.  If it's a utility for other users, you might
consider a prefs setting or maybe a warning about what will happen with an
option to cancel.

Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>


On Wed, Feb 26, 2014 at 2:50 PM, Alex Tweedly <alex at tweedly.net> wrote:

> I'm writing some scripts to allow me to edit the style of text in a field,
> and looking for advice / suggestions on what the script *should* do.
>
> (I might be back later to ask *how* can I do ... those things I should do
> :-)
>
> If I select a chunk of the field, and click on the "Bold" button then
>
> I assume that
>
>  - if the chunk is currently 'bold' then it should become 'plain'
>        (or more precisely, the textStyle["bold"] of the chunk should
> change from true to false)
>  - if the chunk is currently 'plain' then it should become 'bold'
>              (or more precisely, the textStyle["bold"] of the chunk should
> change from false to true)
>
> But the question is
>   - if the chunk is currently 'mixed', then which of the following should
> happen ?
>
> 1. n/a. The button should be disabled in that context
>
> 2. no change. Acton didn't make sense.
>
> 3. the chunk should become 'bold'   (for compatability with Open Office
> amongst others)
>
> 4. each char of the chunk should 'flip' boldness (i.e. equivalent to
> selecting each sub-chunk in turn, and then clicking the bold button)
>
> 5, something else.
>
> And a similar question - if the button clicked is the "make the text
> bigger" button, and the text is currently mixed sizes, then should it
>
> 0. There shouldn't be a "bigger" button, there should only be fixed size
> settings (see, for example, OO)
>
> 1. n/a the "bigger" button should be disabled in that context
>
> 2. no change. Acton didn't make sense.
>
> 3. the chunk should become 'bigger' than the first character of the chunk
> 3a. the chunk should become bigger than the average character  (and is
> that average == "mean" or "mode" or ...)
>
> 4. each char of the chunk should increase in size (i.e. equivalent to
> selecting each sub-chunk in turn, and then clicking the 'bigger' button)
>
> 5, something else.
>
> Thanks for any suggestions
> -- Alex.
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list