FieldFormatter: Working group

FlexibleLearning.com admin at FlexibleLearning.com
Fri Oct 4 05:04:25 EDT 2013


In many ways LiveCode is more a language than a program. It provides the
tools to build software, and sometimes you have to build your own tools for
it. For example 'shell' is supported, but *you* have to know about 'shell'
to apply it. So LiveCode stradles two worlds: raw coding and purpose-built
applications like Excel in that you get the raw power with actually a good
range of shortcuts, but it cannot do everything for everyone 'out of the
box'... You need to apply what is available, and sometimes what is available
is basic widgets from which you construct bigger widgets.

The fieldFormatter is a case in point. It applies what is available in the
engine to provide shortcuts that, given a bit of time and knowledge, you
might do for yourself. Dynamic field formatting based on text input is not,
however, a 'simple task' as it requires separating what is entered from what
is displayed and this is not native functionality. If it were, LiveCode
would be a very different beast... you would be writing all the code to
generate, display and manage your own field objects. I for one am happy not
to go there!

Hugh Senior
FLCo




> From: tbodine <lvhdgc7 at gmail.com>
>
> That sounds outstanding!
> -- Tom Bodine


> From: Vaughn Clement <vclement at gmail.com>

> Hi Hugh
>
> This is really a breath of fresh air in that LC is starting to grow up. I
> have been saying for awhile that LiveCode will evolve or go away. It may
> take developers to move the stake forward in the way other software
> languages have come of age. I believe that when the developers
> start adding
> externals and plugins to LC it will start to be a better product. I
> understand that there are currently some externals out there, but there is
> a ton of new capability that can still be added. For example, I
> spent weeks
> learning how to do programming tasks that should be built into LiveCode in
> the properties  dialog. It was all the things your offering in your
> properties in this email. This should not require hours of coding to get
> such a simple task done. Plus you also covered things that I did not take
> time to add like the comma for thousands. That should also be a properties
> item in LiveCode just like the numeric settings.
>
>
> Thank you
>
> Vaughn Clement


> On Thu, Oct 3, 2013 at 5:07 AM, FlexibleLearning.com <
> admin at flexiblelearning.com> wrote:
>
> > A new field formatting palette and frontscript library is nearing
> > completion. The properties palette, syntax and integration are
> all in place
> > and working.
> >
> > - What is its purpose?
> > In short it separates data from display. Field contents can,
> for example, be
> > displayed as currency (or any other arbitrary unit of measure),
> percentage,
> > dateTime, time duration or 'privatised', with numeric fields
> additionally
> > owning their own numberFormat, negative color, and thousands
> separator. The
> > underlying 'text' (or data) is unchanged; as soon as the field
> loses focus
> > or as soon as we programmatically change any of the properties,
> the field
> > contents change to reflect the new property settings.
> >
> > - How do we use it?
> > Either using the properties palette or by script, we can
> > 'set the percentage of fld n to true' : so 0.2 can be displayed as 20%
> > 'set the numeric of fld n to true/false' : so only numbers can
> be entered
> > 'set the displayChars of fld n to "$" : so 10 can be displayed as $10
> > 'set the numericFormat of fld n to 0.00' : so 10 can be
> displayed as $10.00
> > 'set the showThousands of fld n to true' : so 1250 can be displayed as
> > $1,250.00
> > 'set the privateChars of fld n to "......"' : so pa55w0rd can
> be displayed
> > as privatised text
> > 'set the defaultText of fld n to "Enter a date here..."' : so
> empty fields
> > can display gray text help
> > 'set the dhms of fld n to true' : so 70.38 can be displayed as 01 : 10.4
> > 'set the isUSformat of fld n to false' : so 3/6/13 can be displayed as 3
> > June 2013
> > 'set the dateTimeFormat of fld n to "yyyy-MMM-dd"' : so 3/6/13 can be
> > displayed as 2013-Jun-03
> > [.../...] etc
> > then
> > 'put the rawtext of fld n into tQty' : so we can get the data
> rather than
> > the field contents
> > 'set the rawtext of fld "total" to tQty * tCost' : so we can
> manipulate the
> > data and retain formatted displays.
> > [.../...] etc.
> >
> > It should all 'just happen' intuitively.
> >
> > It works with both the LC and MC IDE development environments,
> so clicking
> > twice on a field will show the new palette along with the existing IDE
> > palettes.
> >
> > - What is needed?
> > A small group of (preferably seasoned) developers to
> > [1] review the palette UI
> > [2] check integration and functionality
> > [3] critique and make suggestions, especially about the
> property names and
> > further functionality
> > [4] discuss, propose and share with a cc to others involved
> > [5] thrash the cr*p out of it :)
> >
> > If interested, please let me know off-list. I agree with
> Richard G and am
> > hoping this concept will become mainstream, but it has to 'go with the
> > flow'
> > and be a seamless extension to the existing 'feel' of LiveCode. Longer
> > term,
> > I'd like it or something similar to be available at engine
> level, but this
> > is something we can all use now.
> >
> > Best regards,
> >
> > Hugh Senior
> > FLCo





More information about the Use-livecode mailing list