 |
|
 |
Any thoughts on how I can use this with my outlook 2007. I need to set a recurring calendar event in outlook for 2 days past every Patch tuesday and your project is the closest I have seen. Any thoughts on how I can use this in outlook 2007?
|
|
|
|
 |
|
 |
i wanna use it in a CListCtrl,add two letters (A+T)to mark every date after the datenumber,when click the letters,it will popup a dialog that containing some records which it will show by the datebase,do you have some good advice to achive this purpose?
|
|
|
|
 |
|
 |
Just wanted to let you know that I'm using your great control in a demo for a new date class I have written. Because I'm not using COleDateTime as a base, I couldn't use the other calendar controls here on CP. Yours was perfect, because I could replace the COleDateTime variable with my own date class object. Very much appreciated!
|
|
|
|
 |
|
 |
Is there an ActiveX implementation of this or a similar Calendar control?
|
|
|
|
 |
|
|
 |
|
 |
Hi gurus,
I'm having trouble getting up and running with this control. The bottom line is, I don't know how to insert the resource properly and my Create function is consequently failing. Here's what I did to get it going:
I created a dialog and added a "group box" to the dialog - and changed the class of the group box from the usual CButton to CFPSMiniCalendarCtrl.
I copied these lines of code to my dialog's initDialog function:
CWnd* pWnd = GetDlgItem(IDC_CALENDAR_GOES_HERE);
ASSERT(pWnd);
CRect CalendarRect;
pWnd->GetWindowRect(CalendarRect);
ScreenToClient(CalendarRect);
m_wndCalendar.Create(NULL, NULL, WS_CHILD | WS_VISIBLE | FMC_MULTISELECT | FMC_AUTOSETTINGS | FMC_TODAYBUTTON | FMC_NONEBUTTON, CalendarRect, this, WMID_CALENDAR);
Unfortunately, the Create function fails. Any idea what I'm doing wrong? I would deeply appreciate any help!
Thanks!
Mike
|
|
|
|
 |
|
 |
I need it for my project in c#....
can you help me???
thanks in advance....
|
|
|
|
 |
|
 |
Congratulation!
It's very simple and good looking calendar!!!
It's difficulty if I want to choose 10.06.1992
Can You tell me how can I change the source code that the user can faster choose date on previous years?
Stoil Todorov
|
|
|
|
 |
|
 |
Hi,
Sometimes seletion fails all the time.
Does someone get this problem? and is there any known reason for that?
Thanks for your help.
|
|
|
|
 |
|
 |
This problem seems to be solved with the latest sources.
|
|
|
|
 |
|
 |
Hi,
can anyone tell me where I can get a copy of the latest sources ?
Thanx in advance for your help.
Greetinx
Gismow
|
|
|
|
 |
|
 |
Anyone interested in random selection? It is implemented by me and I can post the code here if people are interested. It features the following:
- randomly select any days individually over an unlimited time range
- max days supported
- can get selected days as CList of COleDateTime, ascending order
- 2 selection "drawing" modes on mouse move: select or toggle (select mode: single click to deselect)
- extra: optional date range limit which works in all selection modes
The stuff is implemented using DWORD bitfields which are allocated on the fly as user selects more days over several months (similar to the special days of CMonthCalCtrl) and stored in a CMap with year-month as key value.
Koen
|
|
|
|
 |
|
 |
Anyone interested in random selection? It is implemented by me and I can post the code here if people are interested. It features the following:
- randomly select any days individually over an unlimited time range
- max days supported
- can get selected days as CList of COleDateTime, ascending order
- 2 selection "drawing" modes on mouse move: select or toggle (select mode: single click to deselect)
- extra: optional date range limit which works in all selection modes
The stuff is implemented using DWORD bitfields which are allocated on the fly as user selects more days over several months (similar to the special days of CMonthCalCtrl) and stored in a CMap with year-month as key value.
Koen Zagers
|
|
|
|
 |
|
 |
Anyone interested in random selection? It is implemented by me and I can post the code here if people are interested. It features the following:
- randomly select any days individually over an unlimited time range
- max days supported
- can get selected days as CList of COleDateTime, ascending order
- 2 selection "drawing" modes on mouse move: select or toggle (select mode: single click to deselect)
- extra: optional date range limit which works in all selection modes
The stuff is implemented using DWORD bitfields which are allocated on the fly as user selects more days over several months (similar to the special days of CMonthCalCtrl) and stored in a CMap with year-month as key value.
Koen Zagers
|
|
|
|
 |
|
 |
To fix add
m_rectToday.SetRectEmpty();
m_rectScrollRight.SetRectEmpty();
m_rectScrollLeft.SetRectEmpty();
m_rectNone.SetRectEmpty();
in
CFPSMiniCalendarCtrl::CFPSMiniCalendarCtrl();
|
|
|
|
 |
|
|
 |
|
 |
Aha, done! After a long hour of tracking, I found out!
To mark a special day (bold font), you make a comparison between the dt object and the day you want to mark, and if they're match, return TRUE. For example:
Today is 14/4/06.
This stuff code:
BOOL CALLBACK IsSpecialDateCallback(COleDateTime &dt)
{
COleDateTime dtNow = COleDateTime::GetCurrentTime();
if (dt.GetDay()==dtNow.GetDay())
return TRUE;
return FALSE;
}
will mark the day 14 of all months as bold. And the rest is up to you!
Hope this helps!
|
|
|
|
 |
|
 |
1. Should destroy the month selection list window before deleting it:
if (m_pHeaderList) {
m_pHeaderList->DestroyWindow ();
delete m_pHeaderList;
m_pHeaderList = NULL;
}
2. When moving between months using the small arrows, the control is very sluggish. It takes appr. 500 milliseconds to step to the next/previous month even in a 1 row * 1 columnn view. Solution: ?
3. The selection is hardly visible. With my default XP colours, the selected days are drawn with white letters over a light gray background. So I've changed it in CFPSMiniCalendarCtrl::DrawDays:
if (IsDateSelected(dt))
{
cBackColor = ::GetSysColor(COLOR_HIGHLIGHT);
cTextColor = ::GetSysColor(COLOR_HIGHLIGHTTEXT);
|
|
|
|
 |
|
 |
As for 2.):
I've changed all RedrawWindow() calls to Invalidate (FALSE).
The control was drawn twice for each step so I've removed the Invalidate (previously RedrawWindow) call from OnLButtonUp.
The main reason the control was sluggish is that the scrolling is not handled in OnLButtonDblClk. I've copied these parts from OnLButtonDown now it works like a charm.
However, if I move the mouse with the button pressed, the control is redrawn for each slightest move or noise. I believe it to be a bug so I've commented the scrolling part out from OnMouseMove.
|
|
|
|
 |
|
 |
Hi Yogurt,
Good fixes, I have included all of them in my code here too.
There are some small misalignments of graphics still, but it is getting there.
|
|
|
|
 |
|
 |
- "Today" is shorter than "None" in some languages. Drawing both buttons according to "Today"s size results in clipping "None". I've calculated text extent for both strings and used the bigger.
- The date string is not "month year" in some languages but "year month". So I've changed the first lines of CFPSMiniCalendarCtrl::DrawHeader to the following:
SYSTEMTIME rST;
::ZeroMemory (&rST, sizeof (rST));
rST.wYear = static_cast<WORD> (iYear);
rST.wMonth = static_cast<WORD> (iMonth);
rST.wDay = 1;
TCHAR strText[256] = _T("");
::GetDateFormat (LOCALE_USER_DEFAULT, DATE_YEARMONTH, &rST, NULL, strText, sizeof (strText) / sizeof (TCHAR));
and all other places accordingly where GetMonthName was used.
- The days cannot be abbreviated simply getting the first letters of their names in some languages. I've changed CFPSMiniCalendarCtrl::SetFirstDayOfWeek as follows:
if (iDayOfWeek > 0 && iDayOfWeek <= 7)
{
m_iFirstDayOfWeek = iDayOfWeek;
TCHAR dayName[256] = _T("");
::GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME1, dayName, sizeof (dayName) / sizeof (TCHAR));
m_arDaysOfWeekNames[(9 - iDayOfWeek) % 7] = dayName;
::GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME2, dayName, sizeof (dayName) / sizeof (TCHAR));
m_arDaysOfWeekNames[(10 - iDayOfWeek) % 7] = dayName;
::GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME3, dayName, sizeof (dayName) / sizeof (TCHAR));
m_arDaysOfWeekNames[(11 - iDayOfWeek) % 7] = dayName;
::GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME4, dayName, sizeof (dayName) / sizeof (TCHAR));
m_arDaysOfWeekNames[(12 - iDayOfWeek) % 7] = dayName;
::GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME5, dayName, sizeof (dayName) / sizeof (TCHAR));
m_arDaysOfWeekNames[(13 - iDayOfWeek) % 7] = dayName;
::GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME6, dayName, sizeof (dayName) / sizeof (TCHAR));
m_arDaysOfWeekNames[(7 - iDayOfWeek) % 7] = dayName;
::GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME7, dayName, sizeof (dayName) / sizeof (TCHAR));
m_arDaysOfWeekNames[(8 - iDayOfWeek) % 7] = dayName;
}
and CFPSMiniCalendarCtrl::ComputeSize to
iWidthByDaysOfWeek = 0;
iDaysOfWeekHeight = 0;
CSize textSize;
for (iX = 0; iX < 7; iX++) {
textSize = pDC->GetTextExtent (m_arDaysOfWeekNames[iX]);
if (iWidthByDaysOfWeek < textSize.cx)
iWidthByDaysOfWeek = textSize.cx;
if (iDaysOfWeekHeight < textSize.cy)
iDaysOfWeekHeight = textSize.cy;
}
|
|
|
|
 |
|
 |
Good fix, however you must also change the nCount-argument to DrawText in DrawDaysOfWeek() to -1.
Otherwise these new day abbrevs will still yield just one character.
|
|
|
|
 |
|
 |
This should not be a big problem, as the code does use some MFC and Windows API internationalization features.
I have pinpointed these potential problems:
1. The default font which is used in the control is hard coded as "Tahoma," which will kill all characters that this font doesn't include.
2. There are calls to setlocale() in the code, that will reset the current locale setting in the user's thread. It will probably be reset to the user locale setting, but it shouldn't do it anyway.
3. The code is written using the non-portable MBCS character system.
4. There are hard coded strings in the code, but not much more than "Today" and "None."
5. The code relies on the ability of the selected font to render latin characters and numbers a-z , A-Z and 0-9.
6. The code relies on the height of at least one of A-Z latin characters to equal or exceed all the other characters that will be displayed
I currently have a fix for problems 1-4, and I am not sure if 5 and 6 are really going to be problems.
Thanks,
John
|
|
|
|
 |
|
 |
Just an update.
As I said, I have patched this code a bit.
I set the font from DEFAULT_GUI_FONT, removed the setlocale() calls, ported to TCHAR character support for UNICODE builds, and moved hard coded strings to resources.
I have now tested the control on English, Swedish and full Japanese systems, and all of them show locally translated calendars.
I can offer to return my patch to Matt, if anyone is interrested.
John
|
|
|
|
 |
|
 |
Sorry for the delay in responding.
I received the first notification several days ago, but it became buired in a deluge of emails. Since then I have been totally slammed at work.
I appreciate the effort and I am glad people are finding this code useful. If you want, you can email me the source code and I will post it onto CP. Please don't be offended if I can't post it quickly, but I will do my best to get it updated within a week or two.
Thanks,
Matt Gullett
|
|
|
|
 |