Print Page | Close Window

Changing ribbon-tab causes extreme delay

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=13316
Printed Date: 23 June 2025 at 12:57am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Changing ribbon-tab causes extreme delay
Posted By: znakeeye
Subject: Changing ribbon-tab causes extreme delay
Date Posted: 02 February 2009 at 4:19pm
XTP 12.1.1, VS 2008 SP1.
 
I have three tabs in my ribbon-application:
T1 | T2 | T3
 
I handle TCN_SELCHANGE in CMainFrame and switch pre-created pane-layouts depending on the tab-ID. In the T3-layout there is a pane-view with a COM-based charting control occupying the whole view area.
 
The problems begin after the Chart-tab (T3) has been activated at least once! This is truly crazy:
 
T3 selected... ok
T2 selected... ok
T1 selected... 10 sec delay! (Path T2->T1)
T3 selected... ok
T1 selected... ok
T2 selected... 10 sec delay! (Path T1->T2)
T1 selected... ok
T2 selected... ok
T3 selected... 10 sec delay! (Path T2->T3)
a.s.o.
 
There is always one path that seems to cause the delay, but the combination change after the "bad" T3-tab has been selected.
 
I've traced the cause to my chart view in T3:
void CChartView::OnWindowPosChanged(WINDOWPOS* lpwndpos)
{
    // This is causing the delay... sometimes!
    m_wndChart.MoveWindow(0, 0, lpwndpos->cx, lpwndpos->cy);
}
 
I timed the call during tab-selection, and caught this:
CChartView::OnWindowPosChanged: 0 ms, SWP_NOSIZE SWP_NOZORDER SWP_NOREDRAW
CChartView::OnWindowPosChanged: 0 ms, SWP_NOSIZE SWP_NOZORDER SWP_NOACTIVATE SWP_SHOWWINDOW
CChartView::OnWindowPosChanged: 1872 ms, SWP_NOZORDER SWP_NOACTIVATE
CChartView::OnWindowPosChanged: 2777 ms, SWP_NOZORDER SWP_NOACTIVATE
CChartView::OnWindowPosChanged: 2511 ms, SWP_NOZORDER SWP_NOACTIVATE
 
My question
I really don't see what I'm doing wrong here. Certainly, there seems to be a problem with the drawing of the charting control, but where do those extra WM_WINDOWPOSCHANGED messages come from? When I deselect T1 and select T2, in my opinion T3 should NOT change!


-------------
PokerMemento - http://www.pokermemento.com/



Replies:
Posted By: znakeeye
Date Posted: 04 February 2009 at 3:27am
Oleg? Do you need a sample to understand this?
 
To me, the problem is obvious. The underlying OCX is slow on resize. However, it makes no sense that I get WM_WINDOWPOSCHANGED when I selected/deselect other tabs!


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: Oleg
Date Posted: 04 February 2009 at 1:46pm
Hi,
 
Difficult to say without debugging. Guess most easy way is add some size varaible - last size of chart control and don't call  MoveWindow if coordinates same.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 05 February 2009 at 3:12am
Good idea. Thanks.
 
Still, I wonder why I get WM_WINDOWPOSCHANGED when selecting/deselecting tabs that have nothing to do with this pane!
 
It seems like XTP fires some size messages when it shouldn't!


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: znakeeye
Date Posted: 10 March 2009 at 5:17am
Got some more information now. The delay is present when my chart window (Nevron OCX) receives WM_SIZE, SIZE_RESTORED, (2, 2).
I have no idea where this message comes from, but it is only sent when selecting the tabs as previously described. That is:
 
Tab1 is selected. Layout1 is set.
Tab3 is selected. Layout3 is set. OCX is resized (in OnWindowPosChanged). Long delay due to mysterious WM_SIZE.
Tab2 is selected. Layout2 is set. (WM_SIZE not sent to OCX)
Tab1 is selected. Layout1 is set. (WM_SIZE sent to OCX!!!)
It makes no sense! Where does this message come from? All I do is switching layout, and recalcing the frame layout. (XTP 13.0.0, XP SP2 Classic)


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: znakeeye
Date Posted: 10 March 2009 at 5:17pm
Ooooooooooooooops!
 
Accidently had several pane windows with the same id: AFX_IDW_PANE_FIRST. Bad idea!!
 
Sorry for bloating your forum.


-------------
PokerMemento - http://www.pokermemento.com/



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