Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [nebula-dev] How to receive ok event only in CDateTime widget?

Hallo Wim,

Thanks for the proposal.
I am aware of delayed databinding, but you might be interested to hear that I have found another workaround in the meantime:

I have "slipped in" an intermediate model between the CDateTime instance and my wrapping widget.
The model is hosted by a class derived from CDateTime that overrides the postClose() method and registers a KeyAdapter; in both cases, the model's value is updated with the actual selection.
That way, the wrapping widget can bind to the model's value and fire change events only when the user commits the popup or enters a key stroke.

This works, but is only a workaround in the end.
It might be more desirable to support that concept natively by the CDateTime widget itself when it runs in graphical mode.

Another option could have been to register a a selection listener on the green commit button in the toolbar of the picker; however, that button is not accessible from "outside" (with good reasons).

What do you think?

Best,
  MP

Am Mo., 15. März 2021 um 18:09 Uhr schrieb Wim Jongman <wim.jongman@xxxxxxxxx>:
>
> Hi Matthias,
>
> Another option is to throttle the selection. Databinding has support for that.
> [...]


Back to the top