Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC
  New Posts New Posts RSS Feed - CXTSplitterWnd Flicker issue
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum LockedCXTSplitterWnd Flicker issue

 Post Reply Post Reply
Author
Message
brutuscat View Drop Down
Newbie
Newbie


Joined: 12 June 2008
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote brutuscat Quote  Post ReplyReply Direct Link To This Post Topic: CXTSplitterWnd Flicker issue
    Posted: 03 July 2008 at 7:30pm
Hi!
I'm using the CXTSplitterWnd and the Views are flickering A LOT!

I'm with the 1200 version, on VS2005 and WinXP SP2.

I'm appending CDialog controls inside my views (CView) and both (the CDialogs and the CViews) are being templated trought the CXTPNoFlickerWnd template class.
Inside the CDialogs also live other child dialogs, with other controls.
The CView derived class, calls to MoveWindow of the child CDialogs as a basic logic for the splitter (just for now).
Also I'm applying the fix for the Splitter related with the OnMouseMove and OnLButtonUp issues.
This how I'm initializin the controls:

     if(_splitter == NULL)
          _splitter = new CGdxSplitterWndFixed;
     _splitter->CreateStatic(_frameContainer,2, 1);
     _splitter->ModifyStyleEx(WS_EX_CLIENTEDGE, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE);
     //_splitter->SetSplitterStyle(XT_SPLIT_DOTTRACKER);
     _splitter->CreateView(0,0, RUNTIME_CLASS(CHolderView), CSize(rect.Width(), rect.Height()/2), &ccc);
     CHolderView* pView = (CHolderView*)_splitter->GetPane(0,0);
     ASSERT_VALID(pView);
     if(_report == NULL)
          _report = new CXTPNoFlickerWnd<CGdxReportViewDialog>;
     pView->setWnd(_report);
     pView->setOwner(parent);
     _report->Create(CGdxReportViewDialog::IDD, pView);

and then the show thing with the EnableThemeDialogTexture

_report->ShowWindow(SW_SHOW);
_frameContainer->ShowWindow(SW_SHOW);
_splitter->ShowWindow(SW_SHOW);
XTPSkinManager()->EnableThemeDialogTexture(_report->GetSafeHwnd(), ETDT_ENABLE);     

and so...

How can avoid the Flickering?

Thanks!

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 July 2008 at 1:24am
Hi,
 
in Views catch WM_ERASEBGND and return TRUE, add WS_CLIPCHILDREN for Views and Splitter.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
brutuscat View Drop Down
Newbie
Newbie


Joined: 12 June 2008
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote brutuscat Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2008 at 1:46pm
No, no luck.
I added the WS_CLIPCHILDREN to the splitter and to the CViews, also to the parent frame of the splitter.
Almost all child windows of the splitter are templated using the CXTPNoFlickerWnd, which returns TRUE in the WM_ERASEBGND.
Maybe you can send me an example using CDialogs inside the splitter that doesn't flicker?

Thanks!
Back to Top
bschaer View Drop Down
Groupie
Groupie


Joined: 27 June 2006
Location: United States
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote bschaer Quote  Post ReplyReply Direct Link To This Post Posted: 25 August 2008 at 12:33pm

Oleg,

 
I posted comments about CXTSplitterWnd in the Beta group quite some time ago and it seems that nothing has been changed thru 12.0.2
 
OnLButtonUp should be deleted entirely or forwarded to CSplitterWnd, and OnMouseMove should be simplified as shown below.
 

void CXTSplitterWnd::OnLButtonUp(UINT nFlags, CPoint point)

{

CSplitterWnd::OnLButtonUp(nFlags, point);

// Invalidate();

}

void CXTSplitterWnd::OnMouseMove(UINT nFlags, CPoint point)

{

CSplitterWnd::OnMouseMove(nFlags, point);

if(m_bTracking && m_bFullDrag && m_point != point)

{

OnLButtonUp(MK_LBUTTON, point);

OnLButtonDown(MK_LBUTTON, point);

RedrawWindow(NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW);

m_point = point;

}

}

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: 09 October 2008 at 4:45pm
Any news? Is this fixed in 12.1?
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: 10 October 2008 at 2:02am
We didn't confirmed this problem.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
zitz View Drop Down
Senior Member
Senior Member


Joined: 05 October 2008
Status: Offline
Points: 112
Post Options Post Options   Thanks (0) Thanks(0)   Quote zitz Quote  Post ReplyReply Direct Link To This Post Posted: 02 March 2009 at 8:22am
Need remove:

OnLButtonUp(MK_LBUTTON, point);

OnLButtonDown(MK_LBUTTON, point);

Anyway it does not work correctly.

i patch it that:
void CXTSplitterWnd::OnMouseMove( UINT nFlags, CPoint point )
{
    if ( m_bFullDrag == FALSE )
    {
        CSplitterWnd::OnMouseMove( nFlags, point );
        return;
    }

    if ( GetCapture() != this )
    {
        StopTracking( FALSE );
    }

    if ( m_bTracking )
    {
        // move tracker to current cursor position
        point.Offset(m_ptTrackOffset); // point is the upper right of hit detect

        // limit the point to the valid split range
        if (point.y < m_rectLimit.top)
        {
            point.y = m_rectLimit.top;
        }
        else if (point.y > m_rectLimit.bottom)
        {
            point.y = m_rectLimit.bottom;
        }
        if (point.x < m_rectLimit.left)
        {
            point.x = m_rectLimit.left;
        }
        else if (point.x > m_rectLimit.right)
        {
            point.x = m_rectLimit.right;
        }

        if (m_htTrack == vSplitterBox || m_htTrack >= vSplitterBar1 && m_htTrack <= vSplitterBar15)
        {
            if (m_rectTracker.top != point.y)
            {
                OnInvertTracker(m_rectTracker);
                m_rectTracker.OffsetRect(0, point.y - m_rectTracker.top);
                OnInvertTracker(m_rectTracker);
            }
        }
        else if (m_htTrack == hSplitterBox || m_htTrack >= hSplitterBar1 && m_htTrack <= hSplitterBar15)
        {
            if (m_rectTracker.left != point.x)
            {
                OnInvertTracker(m_rectTracker);
                m_rectTracker.OffsetRect(point.x - m_rectTracker.left, 0);
                OnInvertTracker(m_rectTracker);
            }
        }
        else if (m_htTrack == bothSplitterBox || (m_htTrack >= splitterIntersection1 && m_htTrack <= splitterIntersection225))
        {
            if (m_rectTracker.top != point.y)
            {
                OnInvertTracker(m_rectTracker);
                m_rectTracker.OffsetRect(0, point.y - m_rectTracker.top);
                OnInvertTracker(m_rectTracker);
            }
            if (m_rectTracker2.left != point.x)
            {
                OnInvertTracker(m_rectTracker2);
                m_rectTracker2.OffsetRect(point.x - m_rectTracker2.left, 0);
                OnInvertTracker(m_rectTracker2);
            }
        }

        int htTrack = m_htTrack;
        StopTracking( TRUE );
        StartTracking( htTrack );

        if (m_point != point)
        {
            RedrawWindow(NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW);
            m_point = point;
        }
    }
    else
    {
        // simply hit-test and set appropriate cursor
        int ht = HitTest(point);
        SetSplitCursor(ht);
    }
}


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: 17 May 2010 at 6:50am

Have you tested this with this setting enabled/disabled?

SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, 0, (PVOID)FALSE, SPIF_SENDCHANGE);
vs
SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, 0, (PVOID)TRUE, SPIF_SENDCHANGE);
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.156 seconds.