|
Thanks for your interest.
This control could be ported to ActiveX without too much difficulty. However, currently I have no time to do this myself.
Some other CPian might be interested in the task though.
Thanks,
Matt Gullett
|
|
|
|
|
It has been a year since your reply that you MS Outlook style calendar control is not activeX. Has anyone gone and done it? I personally don't know how but would love to see if this can be changed to ActiveX.
Waiting patiently.
soupy
|
|
|
|
|
me too....
|
|
|
|
|
Greate, Cool, Nice,
Nearly what I am looking for, Really nice UI. I only need the Week numbers, on the left of the weeks....
Maybe in next version....
Quinzy
|
|
|
|
|
Thanks for the feedback!
I will add this to the list of features for the next release. Work seems to be slowing down a bit right now, so I might be able to get to it in the next week or two.
|
|
|
|
|
if select multiple month and select show non month dates, it shows the nonmonth
dates only for the first and last month, but not for the month in between.
Otherwise very nice control
|
|
|
|
|
That's funny, I came here wanting to report the same problem, but as I saw the screenshots, I saw the light:
The non-months days are useful to see the dates outside the displayed ones. Since we are in multiple month mode (ie. rows or cols > 1), we can see these dates (between displayed months), so they don't need to be shown.
It is a bit confusing at first, but it is logical once you think about it.
Regards.
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/
|
|
|
|
|
Hmm, good eyesight !
Good logic too , still in this mode it seems logical to show them.
Just to be more intuitive (it came to mind first, did not it).
Any way it looks like a great control nevertheless.
|
|
|
|
|
Sorry for the delay. I have not been very active on CP lately due to my work load and I did not get an email notification until Philippe Lhoste posted a reply to yours.
This behaviour is by design. (I copied it from the way MS Outlook works.) I will make a note in the code and when (if) I get back to this, I will make a style for enabling/disabling this behaviour.
Thanks,
Matt Gullett
|
|
|
|
|
Hi,
I saw a date picker control last day. You can see it at http://www.aircom.org. It looks like yours. I remember it because it is beautiful but I have not compared features yet.
Robert
|
|
|
|
|
From the author (Matt Gullett)
Thanks to feedback from Pierre Meindre and Rainer Mangold, I have updated the control to better support international languages other than English. The changes I have madded deal with first-day-of-week issues and the names of days-of-week. I have also corrected a few other minor issues and added a feature to disable display of non-month days.
I have emailed the changes to submit@codeproject.com and hopefully they will be up in a few days. Until then, if you want this version, email me and I will email the updated version to you.
Thanks,
Matt Gullett
|
|
|
|
|
It's me that "pointed out some international issues" but I don't mind the confusion.
You did an excellent job, your calendar is wonderful and now totally internationalized (as far as French systems are involved).
On a French system, two days have the same initial (mardi & mercredi), but we are used to it so it is OK (the sequence is always the same )
There is a very little problem with the demo, which surprised the first time. The IDC_FIRST_DAY_OF_WEEK control is initialized with DDX with the value set in the CMiniCalendarDlg constructor, before the CFPSMiniCalendarCtrl is called, therefore before the right value is set. However, of course, the calendar display is right. But when we hit Update, the display change because of the difference.
I am not sure how to change this (if needed), my MFC is a bit rusty.
Regards.
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/
|
|
|
|
|
Sorry for mixing you up with someone else. I will update the article in the next day or so.
"On a French system, two days have the same initial (mardi & mercredi), but we are used to it so it is OK (the sequence is always the same )"
I am interested to know, is there a better way to do this. Could the control be improved in this manner? If so, any suggestions on how to do it.
"There is a very little problem with the demo, which surprised the first time. The IDC_FIRST_DAY_OF_WEEK control is initialized with DDX with the value set in the CMiniCalendarDlg constructor, before the CFPSMiniCalendarCtrl is called, therefore before the right value is set. However, of course, the calendar display is right. But when we hit Update, the display change because of the difference.
I am not sure how to change this (if needed), my MFC is a bit rusty."
Sorry about that, this should only be an issue with the demo app. If you use the control in your own app you should not have this problem since there is probably no reason to allow the user to control the first-day-of week. Even if you do provide the user with this capability, the following can be used to correct it.
The way to correct this would be to copy the code from CFPSMiniCalendarCtrl constructor to the CMiniCalendarDlg construcotr. Specifically, the code used to auto determine first day of week. I will update the demo and article in the next couple of days.
Thanks for the feedback, it is greatly appreciated.
Matt Gullett
|
|
|
|
|
Matt Gullett wrote:
>"On a French system, two days have the same initial (mardi & mercredi), but we are used to it so it is OK (the sequence is always the same )"
>I am interested to know, is there a better way to do this. Could the control be improved in this manner? If so, any suggestions on how to do it.
If I may suggest :
Since the columns in the calendar are wide enough to accomodate two-digit day numbers (!), what about simply writing the names of the days with two letters, the first letter in uppercase, and the second one in lowercase ? This would provide a way to distinguish easily between French weekdays "mardi" and "mercredi", simply by writing : "Ma" and "Me".
BTW, this is the full week, in two-letter French names :
Lu ( lundi : monday )
Ma ( mardi : tuesday )
Me ( mercredi : wednesday )
Je ( jeudi : thursday )
Ve ( vendredi : friday )
Sa ( samedi : saturday )
Di ( dimanche : sunday )
And you also could display English weekday names with two letters : Su Mo Tu We Th Fr Sa, although I don't know if English speaking people are more used to two-letter or one-letter weekday names...
|
|
|
|
|
Of course, there is the Month Calendar control, but I bet it does less stuff, and it needs a recent ComCtl32.dll (>= 4.70).
I know, from your other article, that your project don't aim at other languages.
But perhaps it can be easy to pick up the localized date names (month, initial of day of week) from Windows.
What is missing too is to specify the day that starts the week. In France (in Europe?), the week starts on Mondays, not on Sundays. I don't know if this function must be generic (any day) or binary (M or S).
If ever I get some free time, I will look into these improvements, unless somebody else do it earlier (which is probable .
OK, I bite the bullet, you need to #include <locale.h> and call setlocale("", LC_TIME); before the COleDateTime dtTemp; declaration in the constructor. It seems the locale is set by default to "C" (if I understand the quickly read MSDN doc.), not to user choice. Using an empty string as locale name allows to select the current one.
You still have to fetch the day names (initials are currently hard-coded), and somehow determine the initial day of week, or at least let the user defines it.
Thank you.
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
|
|
|
|
|
"Of course, there is the Month Calendar control, but I bet it does less stuff, and it needs a recent ComCtl32.dll (>= 4.70)."
This control does do less and does not look the way I wanted it to.
"I know, from your other article, that your project don't aim at other languages."
This is true but whenever possible I try to support multi-languages.
"But perhaps it can be easy to pick up the localized date names (month, initial of day of week) from Windows."
Actually, the localized month name should already be there I used the COleDateTime::Format function to get the name of each month. The problem is probably related to the setlocale issue you mentioned.
"What is missing too is to specify the day that starts the week. In France (in Europe?), the week starts on Mondays, not on Sundays. I don't know if this function must be generic (any day) or binary (M or S)."
My ignorance prevented me from realizing that Sunday is not the first day of week in other countries. Is there a programatic way to automatically determine the first day of week? If you can tell me how to do this, I will gladly update the code to do this. I will also go ahead and create a way to set this programatically (ie. SetFirstDayOfWeek).
"...you need to #include and call setlocale("", LC_TIME); before the COleDateTime dtTemp; declaration in the constructor. It seems the locale is set by default to "C" (if I understand the quickly read MSDN doc.), not to user choice. Using an empty string as locale name allows to select the current one."
I will make this change ASAP and send the update to Chris.
"You still have to fetch the day names (initials are currently hard-coded), and somehow determine the initial day of week, or at least let the user defines it."
Again, you are correct. I will update the code ASAP. I believe I can get the proper initial by using COleDateTime::Format("%A").Left(1) (or basically that code.)
I appreciate the feedback and hope to make the needed changes quickly. As soon as I send the update to Chris, I will notify you (through this forum.) If you would like for me to email you the updated code (it may take Chris some time to update the article), just let me know.
Thanks,
Matt Gullett
|
|
|
|
|
Once again, thanks for the info.
I have updated the code so that day-of-week abbreviations are not hard coded. They are automatically set when calling SetFirstDayOfWeek (although they can be overidden later using SetDayOfWeekName.)
I added the setlocal call to the constructor as you indicated.
The default for SetFirstDayOfWeek (in constructor) is 1 or sunday. I could not quickly find any info on how to determine the first day of week from the current local or regional settings. I will keep looking.
I modified the demo app so you can try the SetFirstDayOfWeek function through the demo.
I will submit the changes to Chris in the next couple of minutes. It will probably take a day or two for him to update the article. If you want, I will email the changes to you, just send me your email address.
Thanks,
Matt Gullett
|
|
|
|
|
Matt Gullett wrote:
The default for SetFirstDayOfWeek (in constructor) is 1 or sunday. I could not quickly find any info on how to determine the first day of week from the current local or regional settings. I will keep looking.
Win32 SDK
int GetLocaleInfo(
LCID Locale, // locale identifier
LCTYPE LCType, // information type
LPTSTR lpLCData, // information buffer
int cchData // size of buffer
);
should do the job. Specify LCType as LOCALE_IFIRSTDAYOFWEEK.
I didn't test that, just picked it up in MSDN-Library.
Rainer
|
|
|
|
|
Well, I should have waited before modifying your code as I've started to
adapt it for internationalization too...
Anyway, thanks Matt for sharing this nice piece of code !
One thing that I've added and can be usefull is the ability to hide/display
the "NonMonthDay", i.e. the days displayed in gray in the first and last
months displayed.
I've just added a BOOL member to CFPSMiniCalendarCtrl named m_bExludeNonMonthDay
and tested it's value in the DrawDays method:
for (int iRow = 1; iRow <= 6; iRow++)
{
int iX = iStartX;
for (int iDayOfWeek = 1; iDayOfWeek <= 7; iDayOfWeek++)
{
if (dt.GetMonth() == dtStart.GetMonth() ||
((dt > dtStart && iMonthCol == m_iCols && iMonthRow == m_iRows) ||
(dt < dtStart && iMonthCol == 1 && iMonthRow == 1))
&& !m_bExludeNonMonthDay)
Regards,
Pierre Meindre
|
|
|
|
|
This looks like an outstanding piece of work. Well done.
Jerry
|
|
|
|
|
Matt this is a cool UI control.
Normski. - Professional Windows Programmer
|
|
|
|
|
I agree
|
|
|
|
|
I agree too!
It reminds me that VC is still alive.
|
|
|
|
|
I guess that if you're never change the programming tools ( i.e. same compiler), the ActiveX is without goal. Nice work. Keep on.
|
|
|
|
|