Hi, I am trying to use the wxdatepicker, but actually show week numbers when the dropdown is shown (wxWidgets 3.0.4 with Windows 10). Although the wxCalendarCtrl nicely shows the week numbers, I don't seem to be able to get it up-and-running for the wxDatePickerCtrl. Microsoft docuumentation does show that it should be possible, but I'm not sure where I should change parameters.
Any help is very much appreciated.
wxDatePicker week numbers
Re: wxDatePicker week numbers
Where do you see that? I don't see anything here: https://msdn.microsoft.com/en-us/librar ... 00%29.aspxtimo123 wrote:Microsoft docuumentation does show that it should be possible, but I'm not sure where I should change parameters..
I should work with the generic implementation:
Code: Select all
#include "wx/datectrl.h"
#include "wx/generic/datectrl.h"
#include "wx/calctrl.h"
///
wxDatePickerCtrlGeneric *dp = new wxDatePickerCtrlGeneric(panel, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DEFAULT );
dp->GetCalendar()->SetWindowStyleFlag( wxCAL_SHOW_WEEK_NUMBERS );
Use the source, Luke!
Re: wxDatePicker week numbers
That's awesome! Thanks a lot. There was some logic to set the style in the DTN_DROPDOWN notification message. I tried, but had a hard time resizing the window correctly. This is much nicer of course.
Timo
Timo