Changing ribbon-tab causes extreme delay |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
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/
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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/
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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/
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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/
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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/
|
|
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 |