Print Page | Close Window

[solved] DatePickerDemo. Notification doesn't work

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=23115
Printed Date: 29 October 2020 at 2:55am


Topic: [solved] DatePickerDemo. Notification doesn't work
Posted By: jmarcosf
Subject: [solved] DatePickerDemo. Notification doesn't work
Date Posted: 03 September 2016 at 8:29am
Why in the sample DatePickerDemo Dialog does not receive XTP_NC_DATEPICKER_BUTTON_CLICK messages when coming from Combo CDatePickerCombo class?
Is it a bug?

Thanks!



Replies:
Posted By: olebed
Date Posted: 03 September 2016 at 10:12am
Hello jmarcosf,

Thank you for bringing this to our attention. There is really error in file 
Samples\Calendar\DatePickerDemo\DatePickerDemoDlg.cpp line ~196
   ON_NOTIFY(XTP_NC_DATEPICKER_BUTTON_CLICK, 1000, OnButtonPressed)

File Resource.h  has  two the same IDs 1000
#define IDC_CUSTOM1                     1000
#define IDC_DATEPICKER                  1000
So IDC_CUSTOM1 hides IDC_DATEPICKER  and  CDatePickerDemoDlg::OnButtonPressed  doesn't get XTP_NC_DATEPICKER_BUTTON_CLICK notification.
Solution is removing IDC_CUSTOM1 from Resource.h and change ON_NOTIFY() declaration to

   ON_NOTIFY(XTP_NC_DATEPICKER_BUTTON_CLICK, IDC_DATEPICKER, OnButtonPressed)

I have fixed this in sample application.

Regards,
 Oleksandr Lebed


Posted By: jmarcosf
Date Posted: 03 September 2016 at 3:17pm
Making that modifications doesn't really solve the problem.
It still continues without printing any TRACE as the blue buttons from the main DatePickerControl does.
Besides, IDC_DATEPICKER is the resource id of this main DatePickerControl but, on the fly generated controls when yo click popup controls do not have this ID. I think that is the real problem. According to the source, popup controls are always created with resource id 0.

By adding the next line, the messages from first popup control is showed but not the ones coming from the combo box.
ON_NOTIFY(XTP_NC_DATEPICKER_BUTTON_CLICK, 0, OnButtonPressed)


Posted By: olebed
Date Posted: 04 September 2016 at 2:13am
Sorry, I forgot that you ask about CDatePickerCombo class Ermm



Print Page | Close Window