How does the DatePicker or TimePicker work?

asked Jan 28 in GUI Development by Jonathan Turner
Hi, I am trying to understand how the DatePicker and TimePicker templates work, specifically how the properties Day, Month and Year (or Hour, Minute and Second) are updated with the selected date or time.  I can see that there is a property called "OnChange" of type slot, which receives a postsignal from the onEndSlide slot method. The comment nedt to the 'postsignal' instruction reads "// Notify the owner of the date picker, that the user has selected another date." (for the date picker).

But where is the code which actually updates the values of Day, Month and Year with the user selected values?

1 Answer

0 votes
answered Jan 28 by Paul Banach

Hello Jonathan,

the properties Day, Month, etc. don't store any values in memory. As such they are not updated. Instead the properties implement the OnGet methods. They implement code to 'return' the correct value according to the selection made in the scroll list. For example, the OnGetHour method in Time Picker implementes following code:

Each time your application queries the value of the property Hour, the code is execututed returning the value coresponding to the scroll list position.

Does it help you further?

Best regards

Paul Banach

commented Jan 28 by Jonathan Turner
Hello Paul,

Thank you for your reply - it helps me very much!  I understand much better now...

Best regards,


Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint