Print Page | Close Window

Timeshift BUG

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=13833
Printed Date: 27 November 2024 at 3:11am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Timeshift BUG
Posted By: gmail
Subject: Timeshift BUG
Date 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?



Replies:
Posted By: mdoubson
Date Posted: 28 March 2009 at 8:17pm
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 window

pTI->uId = (UINT_PTR)m_hWnd; // Handle to a child window

pTI->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);

}



-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date Posted: 28 March 2009 at 8:48pm
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


-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date Posted: 29 March 2009 at 2:05am
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!
 
see https://forum.codejock.com/uploads/temp/20090329_021249_DoubleTimeScale.jpg - https://forum.codejock.com/uploads/temp/20090329_021249_DoubleTimeScale.jpg
 
 


-------------
Mark Doubson, Ph.D.


Posted By: gmail
Date Posted: 29 March 2009 at 11:56am
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?


Posted By: mdoubson
Date Posted: 29 March 2009 at 12:00pm
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
 


-------------
Mark Doubson, Ph.D.


Posted By: gmail
Date Posted: 29 March 2009 at 12:31pm
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?


Posted By: gmail
Date Posted: 29 March 2009 at 12:46pm
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.


Posted By: mdoubson
Date Posted: 29 March 2009 at 12:50pm
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)

-------------
Mark Doubson, Ph.D.


Posted By: gmail
Date Posted: 29 March 2009 at 1:03pm
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)?


Posted By: mdoubson
Date Posted: 29 March 2009 at 1:12pm
because you use some Theme drawing - check it. Switch to non Office2007 theme and see

-------------
Mark Doubson, Ph.D.


Posted By: gmail
Date Posted: 29 March 2009 at 1:22pm
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?


Posted By: mdoubson
Date Posted: 29 March 2009 at 1:28pm
OK - check CXTPCalendarThemeOffice2007::CTODayView:: functions which deal with drawing in Office2007 mode for DayView.

-------------
Mark Doubson, Ph.D.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net