Timeshift BUG |
Post Reply |
Author | |
gmail
Groupie Joined: 24 February 2008 Status: Offline Points: 45 |
Post Options
Thanks(0)
Posted: 27 March 2009 at 2:36pm |
You have a bug in CXTPCalendarControl. If we use:
scale->SetTimeshift(60); // one hour timeshift everything works fine *but* tooltips still shows time like there was no timeshift (in my example - 18h instead of 19h). What is more, day and week view shows correct timeshift but month view doesn't care about timeshift? What is the solution for this? |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
I don't see solution without fixing the code but you can use custom tooltip - here you can do may things yourself - on app level - like here:
INT_PTR CXTPCalendarControl_Custom::OnToolHitTest(CPoint point, TOOLINFO* pTI) const{ if (m_nToolTipMode == ctmCustom){ XTP_CALENDAR_HITTESTINFO hitTest; if ( ((CXTPCalendarControl*)this)->GetActiveView()->HitTest(point, &hitTest)){ if (hitTest.pViewEvent){ pTI->hwnd = m_hWnd; // Handle to a windowpTI->uId = (UINT_PTR)m_hWnd; // Handle to a child windowpTI->uFlags |= TTF_IDISHWND | TTF_NOTBUTTON; CString strToolText; strToolText.Format(_T( "[ID = 0x%08X] (%s - %s) %s"),hitTest.pViewEvent->GetEvent()->GetEventID(), hitTest.pViewEvent->FormatEventTime(hitTest.pViewEvent->GetEvent()->GetStartTime()), hitTest.pViewEvent->FormatEventTime(hitTest.pViewEvent->GetEvent()->GetEndTime()), hitTest.pViewEvent->GetEvent()->GetSubject() ); int nBuffSize = strToolText.GetLength()*2 +10;TCHAR* pBuffer = (TCHAR*)malloc(nBuffSize); STRCPY_S(pBuffer, nBuffSize, (LPCTSTR)strToolText); pTI->lpszText = pBuffer; return 333;} } } return CXTPCalendarControl::OnToolHitTest(point, pTI);} |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
btw - CXTPCalendarDayViewTimeScale::SetTimeshift(int nMinutes) only for DayView mode - where you have vertical time scale.
I also like to have more detials - is it the bug in Office2007Theme mode or not - pleased try both
Could you make same case without call SetTimeshift function directly but use some TimeZone settings in Options?
Again in both Theme modes please.
Having it I can fix very soon and give you needed code to update your source until you will have official release 13.1
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Well I analyze the problem and found that you are using the function you not suppose to call directly. This function used internally to create second timescale for alternative time zone. So tooltips and time label in event's details (in string or clock icon modes show original entry. If you apply timeshift - you will see you event e.g. 18:00 - 19:00 .... as event in another time scale.
There is nothing to fix here. If you want to use second timescale - use options - timezone - control. Don't call SetTimeshift - use next timezone with 1 hour shift instead!
|
|
gmail
Groupie Joined: 24 February 2008 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
I've already tried that but the main problem with your solution is that I cannot hide the first (original) timescale if I use the second one (I only need one timescale visible at a time)? How to hide the original timescale then?
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Do you tried to use
AFX_INLINE void CXTPCalendarDayViewTimeScale::SetVisible(BOOL bVisible) { m_bVisible = bVisible; }
CXTPCalendarDayView* pDayView = DYNAMIC_DOWNCAST(CXTPCalendarDayView, GetCalendarCtrl().GetDayView() ); if (pDayView) { pDayView->GetTimeScale(# of your scale)->SetVisible(FALSE); }NO - LOOKS LIKE USELESS FUNCTION. Check XTPCalendarDayViewTimeScale - may be we can fix it for 13.1
|
|
gmail
Groupie Joined: 24 February 2008 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
Yes I have tried it in my CXTPOverridenCalendarView::OnInitialUpdate() function like so:
CXTPCalendarDayView* pDayView=DYNAMIC_DOWNCAST(CXTPCalendarDayView,GetCalendarCtrl().GetDayView()); pDayView->GetTimeScale(1)->SetVisible(FALSE); It doesn't work (first timescale is still visible). What is more function GetTimeScale(1)->GetVisible() returns FALSE as if timescale is hidden? How to resolve this issue? |
|
gmail
Groupie Joined: 24 February 2008 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
I see you've altered your post before I replied. Although I cannot imagine why you're implementing useless functions in your code, I've inspected XTPCalendarDayViewTimeScale.h and XTPCalendarDayViewTimeScale.cpp and I see you gotta a point there. So, what would be the best way to alter these files to HIDE timescale? Thanks for replying.
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
I don't know - many people created this Components. I guess this feature was in somebody plan but did not finished. We can do it now as somebody need this - looks like before nobody asked about it. To alterate - check void CXTPCalendarDayViewTimeScale::Draw(CDC* pDC)
|
|
gmail
Groupie Joined: 24 February 2008 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
This is strange - it seems that Draw(CDC *pDC) function never gets called (I breakpointed to it while executing, and none of the breakpoints fired off)?
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
because you use some Theme drawing - check it. Switch to non Office2007 theme and see
|
|
gmail
Groupie Joined: 24 February 2008 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
Yes, I use Office2007 theme and I will continue to use it. So, the question now is how to hide timescale with Office2007 theme applied?
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
OK - check CXTPCalendarThemeOffice2007::CTODayView:: functions which deal with drawing in Office2007 mode for DayView.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |