[Pas2js] textinputwidget and number of available input boxes on a line

Michael Van Canneyt michael at freepascal.org
Sun Oct 4 14:17:59 CEST 2020



On Sun, 4 Oct 2020, Mgr. Janusz Chmiel wrote:

> When I have shown The online forms to my sighted mother, she has found, that
> in some cases, text labels can fit on A line, but there is no some input box
> to fill out on some lines. Is it possible to add auto formatting option, so
> even if somebody would create 40 or more input boxes with text labels, that
> all input boxes could be visually available when using htmlwidgets unit?
> The most sad reality is The fact, that when I Am using screen reader on
> Android device or on standard deskto computer, I have no chance to
> determine, that some editable field could not fit on some line.. By other
> words. My mother could see all textual labels, but some inptut editable
> fields were not presented thanks to lack of free space on A line.
> If it would be possible to include some automatic formattting routines to
> The htmlwidgets unit, it would be excellent.

That will not happen.

As I wrote in other mails: When programming the browser, 
layout must happen through CSS.

When you program for the browser, you must embrace the browser, and not try
to import concepts that were developed in the early 90s for a limited range of
hardware.

Modern programs must run on a variety of devices, and for this
reason, CSS offers a lot of possibilities to adapt to various screen sizes.

And for this reason, there is no 'formatting' in the basic HTML webwidgets.

If you need good formatting that works on various screen sizes, you really
should be using a framework like Bootstrap, Materialize, Foundation, UIKit etc.

Personally I use bootstrap, that is why there are some webwidget classes that
work together with bootstrap formatting, but nothing stops people from
writing classes that work with other CSS frameworks , or even write their
own.

I realize that this means you must take an additional hurdle, but I believe
that in the end you will make better programs because of it.

You will go a long way if you use the bootstrap components: the TRowWidget
and TColumnWidget will allow you to position your widgets in a consistent
manner, and bootstrap will then make sure it looks good. If you take the
time to study some of the bootstrap CSS classes and apply them to your
widgets, your programs will look good for sighted people as well.

It's really not so difficult, but it requires you let go of old habits.
(and as we all know, old habits die hard)

Michael.


More information about the Pas2js mailing list