Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - Timeshift BUG
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Timeshift BUG

 Post Reply Post Reply
Author
Message
gmail View Drop Down
Groupie
Groupie


Joined: 24 February 2008
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote gmail Quote  Post ReplyReply Direct Link To This Post Topic: Timeshift BUG
    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?
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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);

}

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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!
 
 
 
Back to Top
gmail View Drop Down
Groupie
Groupie


Joined: 24 February 2008
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote gmail Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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
 
Back to Top
gmail View Drop Down
Groupie
Groupie


Joined: 24 February 2008
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote gmail Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
gmail View Drop Down
Groupie
Groupie


Joined: 24 February 2008
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote gmail Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
gmail View Drop Down
Groupie
Groupie


Joined: 24 February 2008
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote gmail Quote  Post ReplyReply Direct Link To This Post 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)?
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 29 March 2009 at 1:12pm
because you use some Theme drawing - check it. Switch to non Office2007 theme and see
Back to Top
gmail View Drop Down
Groupie
Groupie


Joined: 24 February 2008
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote gmail Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 29 March 2009 at 1:28pm
OK - check CXTPCalendarThemeOffice2007::CTODayView:: functions which deal with drawing in Office2007 mode for DayView.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.