Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Changing ribbon-tab causes extreme delay
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Changing ribbon-tab causes extreme delay

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: Changing ribbon-tab causes extreme delay
    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/
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
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.188 seconds.