Einhugur TimeControl for dektop Bug

@Björn_Eiríksson

I don’t know if what I am seeing is platform specific or OS version specific… (though i hope the control behaves teh same everywhere - particular after it is fixed! :wink: )

I’m on MacOS 12.3.1 using API 1 code in 2019r1.1.

When the control does not have the focus if I click on the up-down arrows:

  1. It Gets the focus
  2. change event fires even though nothing has changed.
  3. and sets the selection to the first subfield

Obviously 2 is not correct behavior!!!

So what should happen?
Getting the focus Is OK but on the same click on the arrows it should either:

  1. increment or decrement either the most significant or least significant time subfield, depending on which arrow was clicked AND THEN fire the change event
    OR
  2. Not change anything and not fire the change event.

Since clicking on an up-down arrow control and nothing changing is a bit disconcerting, I would say 1 is the best behavior…
Though I vacillate if it should change the most or least significant time subfield being displayed and set the selection the.

But either 1 or 2 is better than firing the change event when there is no value change.

-Karen

mmm sorry i just implemented this control couple days ago, i don’t see why this is a problem if the event is triggered not neceraly, it’s a side effect behaviour, not a problem and it could easily be dealt with.

If your code (and you) expects a change event to only fire when there is change and it fires when there is none, it can make debugging interesting… And I say that from experience! :wink:

But in any case a change event should NOT fire if there is no change… if it does, there is a bug by definition.

-Karen
-Karen

1 Like

i happen to be currently working with calendar and time, so i tested it, would hardly describe this as ‘bug’, since it is what arrows usually do, change value. we can’t call every quirks as bugs.

The point is the arrows do not change the value on the first click if the control does not already have the focus, but the change event still fires.

It may be a bug that does not matter to you… but it is a bug… Change means change.

-Karen

2 Likes

I think it is a bug if you get change without any change.

1 Like

So this sounds like the bug is that the value isn’t changing. Buttons don’t need focus to be used on macOS, so a non-focused arrow-button click should change the time value in my opinion.

Edit: Oh but with time control, you have to select the section to change. Nevermind meeee.

I posted fix for this now.

The fix is currently only on the Xojo Beta program zone (hopefully you have access to that ??’). Reason is that the new version exposes Beta information, so I cannot release anywhere but there until next version of Xojo comes.

Thanks Bjorn, I have it.

-karen