Up-Down Controls

Post Reply
User avatar
Robert
Posts: 1024
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Up-Down Controls

Post by Robert »

If the <Shift> key is depressed the Up arrow makes the value MAX(INTEGER), and the Down arrow makes it MIN(INTEGER).

I remember discussing (in fact, I think I was the one who suggested it) using the <Ctrl> to multiply / divide the value by 10, but did we discuss this jump to limit value option?

It has broken one of my applications!

(And why does the divide round up for negative values, rather than using the Component Pascal DIV logic?)
User avatar
Robert
Posts: 1024
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: Up-Down Controls

Post by Robert »

The previous discussion of this topic was issue #98 (viewtopic.php?f=50&t=366).

The revised behaviour when the <Shift> key is used was introduced on 31-Jan-2016.
Josef Templ wrote:See changes at: http://redmine.blackboxframework.org/pr ... 71a1e69abf.
As an alternative to setting the max/min value by means of clipping at max/min I have added the <Shift> key for setting max/min directly.
- Josef
I did not notice then that this change would break one of my applications.
Is anyone using this new feature?
Can we consider reverting it?

(If we do remove it I would prefer that the <Ctrl> key behaviour was to clip at max/min, but that is a secondary concern for me.)
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: Up-Down Controls

Post by Josef Templ »

Robert wrote:If the <Shift> key is depressed the Up arrow makes the value MAX(INTEGER), and the Down arrow makes it MIN(INTEGER).

I remember discussing (in fact, I think I was the one who suggested it) using the <Ctrl> to multiply / divide the value by 10, but did we discuss this jump to limit value option?

It has broken one of my applications!

(And why does the divide round up for negative values, rather than using the Component Pascal DIV logic?)
Just for our understanding: How can the shift interclick in an up/down field break an application?

The "round up" is there as a principle of least surprise. Ctrl-AD removes the right-most digit.
A simple rule that is also explainable to non-CP programmers, i.e. normal users.
Imagine that you have to explain that -12 Ctrl-AD yields -2 to a non programmer.
Even C programmers will not understand it. Most users would probably report an application error.

The Controls are part of a GUI and as such should not show anything of the underlying digital hardware.
If the up/down field had an application-specific min/max attribute, it would of course give sense to jump to that
with shift or some other mechanism.
Jumping to MIN(INTEGER) etc. is actually making a low-level detail of the underlying digital
hardware visible to the user. It breaks the abstraction. But it is a minor detail.
I have never used this feature.

- Josef
User avatar
Robert
Posts: 1024
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: Up-Down Controls

Post by Robert »

Josef Templ wrote:The "round up" is there as a principle of least surprise. Ctrl-AD removes the right-most digit.
A simple rule that is also explainable to non-CP programmers, i.e. normal users.
Imagine that you have to explain that -12 Ctrl-AD yields -2 to a non programmer.
Even C programmers will not understand it. Most users would probably report an application error.
Ok. In fact my original (private) code did this; I had forgotten. I use negative numbers relatively infrequently, so I think this a minor matter. I am not asking for a change.

Josef Templ wrote:The Controls are part of a GUI and as such should not show anything of the underlying digital hardware...
Ok. I only use this as a convenient way to input MIN/MAX INTEGER when I am thinking about low-level details, so can accept that this may be unwelcome to the general user.

Regarding interclicking. I have an ordered list (generally fairly short, ie less than two dozen). For example "Apples, Bread, Cake, Donuts, Eggs, Fish" numbered 0, 1, 2, 3, 4, & 5.
If I (the user) select 2, "Cake" is displayed. If I UpArrow to 3, "Donut"s are displayed. But if I <Shift> UpArrow from 2 to 3 "Cake" is still displayed because I have shifted its position in the list up from position 2 to 3. This mechanism allows me to reorder the list, in this case to "Apples, Bread, Donuts, Cake, Eggs, Fish".
Post Reply