DesktopDateTimePicker.MouseDown does not respond

I add a MouseDown Event, Populate it, and run… nothing.

I add a Break Command at the beginning of the Event and run… nothing !

This display:
image

I clicked in days #, Month #, Year #, everywhere I can including Up and Down. The MouseDown Event is ignored.

I will try Focus, but this is strange.

Why do you want to use the MouseDown-Event?

2 Likes

That is a good question.

I have an URL with a date at its end.

The DesktopDateTimePicker opend at the correct date (today), biut do not update the date in the URL. A click in the Control would update that URL.

Now, as I write above, I used Got Focus and the date is updated (with a small change in the Code I used in MouseDown).

But it is surprising to find a ëBlind Event”.

I do not checked if there is an Open Event :wink:

There is the DesktopDateTimePicker.DateChanged event.

there are a lot of desktopcontrols that have standard events that does nothing and are never called
since api2 this happens a lot.
there has been a copy-paste in the documentation from api1 and has never been corrected.
you can add an issue with no problem !

1 Like

It works fine, bt at application startup, I prefer not change the date since the, date I need is today and the Control already have it.

But for other days, of course, I use it for updating the URL.

Amule does not have an Edit Menu (lazyness), and I never tried to use Copy/Cut or Paste there.

Maybe it is difficult to avoid the add of certains Events in Controls.

Once more: I was surprised. My first time.

MouseDown would be the wrong event anyway. You would rather use the Opening event for the initial value and DateChanged for any subsequent changes.

Who know what happens in a brain with ony 5 sleep times a day ? :wink:

Yes, you are right.

#78073 - DesktopDateTimePicker can’t make MouseDown/MouseUp work

In this case it was assumed that clicking on some date in the graphical version of the DateTimePicker should commit to that selection and I’m not convinced that is the expected behavior. As a user I would assume that I could tentatively select one date or another until I finalized my decision. Simply adding a ‘Select’ button next to the Picker would solve the issue.

I don’t see anywhere that this was assumed. I just reported that I can’t make MouseDown/MouseUp work.

The graphical interface updates itself showing a blue indication on the clicked date (for me using dark mode). Depends on the developer/client needs if they want to instantly commit the change or not.

If the MouseDown and MouseUp events are present, they should work. Otherwise they should be removed.

But DateChanged would be the correct event for @Emile_Schwarz’s logic since the user may make changes with the keyboard that would not trigger a properly functioning MouseDown event.

I was referring to issue #78073 that you referred to. The problem described there is that one cannot click on the current date to commit to that selection as the DateChanged event doesn’t fire. But I for one wouldn’t even suppose that one could; from a user’s perspective I would rather expect a button to confirm my selection.

So even if one could catch the MouseDown event, using it to confirm a date selection would be unexpected behavior (that should generally be avoided).

Every developer/client have different needs.

For example: macOS does not offer a button to confirm the selection. Because Xojo wants to offer native controls, the graphical interface is very limited (compared with Windows for example).

Yes, I was referring to other things within the ticket, and even created a different ticket for other thing.

I guess it was strange for me that you reference something extra from the ticket that is not part of what OP needs/wants on this thread.

The main problem for OP is that DesktopDateTimePicker offers MouseUp and MouseDown and they don’t work. Xojo should remove them as available options or make them work for whatever the developer needs.

:+1:t2:

If, for some reason, it is a known issue that will take a time until removal, docs must be VERY clear about the useless state of such legacy.

1 Like

If Xojo do not want to implement correctly MousDown/MouseUp, removing them will lead to peoeple asking for them.
A solution would be to disable them: preent in the Menu, but not selectable. Of course, if possible.
And wrote something accordingly in the Documentation (preyin for developers to read it). :wink:

Not sure if these events presence is ‘accidental and unintended’ just as DesktopSearchField MouseUp/MouseDown:

https://tracker.xojo.com/xojoinc/xojo/-/issues/76756#note_582790

DesktopSearchField: the MouseDown, MouseDrag, and MouseUp events have been removed, as they were not meant to be exposed.

1 Like