Make date input field with separators Topic is solved

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
praudmur
Earned a small fee
Earned a small fee
Posts: 16
Joined: Sat Sep 18, 2021 7:55 am

Make date input field with separators

Post by praudmur »

Hello!
I'd like to make a date input field but currently I see no possibility to achieve what I want with wxWidgets. Maybe I'm missing something?

I want my date field to be like this one:
digits.jpg
digits.jpg (15.58 KiB) Viewed 7527 times
Digits are separated by "." which cannot be erased.

wxDatePickerCtrl does exactly that but it has one problem - it cannot have an empty value.
If I set it to be "wxDP_ALLOWNONE" style, then checkbox is unchecked by default and it's not convenient at all to check this box for each entry. Also I don't have control over this checkbox via code. And also I'd like each date to be valid.

So I am ready to change wxDatePickerCtrl for a simple text input(I don't need a date picker menu anyway). Is there a native wxWidgets way to set text separators like on the picture above?
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Make date input field with separators

Post by doublemax »

Currently there is no control in wxWidgets that does this.

There is however an old proposal that never made it into the code, because it doesn't work properly under GTK:
http://trac.wxwidgets.org/ticket/14535

Allegedly it works under Windows (i've never tested it).
Use the source, Luke!
praudmur
Earned a small fee
Earned a small fee
Posts: 16
Joined: Sat Sep 18, 2021 7:55 am

Re: Make date input field with separators

Post by praudmur »

doublemax wrote: Sun Sep 19, 2021 9:38 pm Currently there is no control in wxWidgets that does this.

There is however an old proposal that never made it into the code, because it doesn't work properly under GTK:
http://trac.wxwidgets.org/ticket/14535

Allegedly it works under Windows (i've never tested it).
thanks!
Post Reply