Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Ribbon Sample
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Ribbon Sample

 Post Reply Post Reply
Author
Message
BastianPL View Drop Down
Groupie
Groupie
Avatar

Joined: 15 April 2006
Status: Offline
Points: 69
Post Options Post Options   Thanks (0) Thanks(0)   Quote BastianPL Quote  Post ReplyReply Direct Link To This Post Topic: Ribbon Sample
    Posted: 26 April 2007 at 10:01am
Hi,
 
I have problem. In ribobn sample application, when I am rezising window, the scrollricheditview is flickering very much. How can I change this to make that witout flickering ??

Thanks
Bastian
Back to Top
BastianPL View Drop Down
Groupie
Groupie
Avatar

Joined: 15 April 2006
Status: Offline
Points: 69
Post Options Post Options   Thanks (0) Thanks(0)   Quote BastianPL Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2007 at 12:19pm
Hi,
 
I have also problem with CXTButton added to status bar. In this same status bar i have a second pane that shows current cursor position.
My button is declared as CXTPNoFlickerWnd<CXTButton> m_wndStatusButton. And when I am moving mouse the button is flickering.


If anybody have any ideas i would be appreviative for help.
 
Thanks
Bastian
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 27 April 2007 at 1:01am
Hi,
 
Strange, may be you already modified sample somehow, I don't see flickers at all :(
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
BastianPL View Drop Down
Groupie
Groupie
Avatar

Joined: 15 April 2006
Status: Offline
Points: 69
Post Options Post Options   Thanks (0) Thanks(0)   Quote BastianPL Quote  Post ReplyReply Direct Link To This Post Posted: 27 April 2007 at 5:28am
Hi,
 
It doesn't help. My code is very simple.When I am resizing windows a view inside Workspace view still flickers. I didn't change code very much. Just instead your CScrollRichEdit class I am using normal CView class.
 

void CMainView::OnPaint()

{

    CPaintDC dc( this );

    CRect rc;

    GetClientRect( &rc );

    CXTMemDC MemoryDC( &dc, &rc );

    rc.DeflateRect( 16, 16, 16, 16 );

    MemoryDC.FillSolidRect( &rc, RGB( 255, 0, 0 ) );

}

 

BOOL CMainView::OnEraseBkgnd( CDC *pDC )

{

    return TRUE;

}


Thanks for help.
Sebastian
Bastian
Back to Top
BastianPL View Drop Down
Groupie
Groupie
Avatar

Joined: 15 April 2006
Status: Offline
Points: 69
Post Options Post Options   Thanks (0) Thanks(0)   Quote BastianPL Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2007 at 10:57am

Do You have some ideas ???

 
Thanks
Bastian
Back to Top
BastianPL View Drop Down
Groupie
Groupie
Avatar

Joined: 15 April 2006
Status: Offline
Points: 69
Post Options Post Options   Thanks (0) Thanks(0)   Quote BastianPL Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2007 at 11:22am
I just send You all my header and cpp. The workspace class is this same like in ribbon sample.
 
Thanks a lot for your help!
 
my Header
 

#pragma once

#include "TestView.h"

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

class CMainDoc;

class CMainView : public CView

{

protected:

CMainView();

DECLARE_DYNCREATE( CMainView )

// Attributes

public:

CMainDoc* GetDocument();

virtual ~CMainView();

// Operations

public:

virtual BOOL PreCreateWindow( CREATESTRUCT& cs );

#ifdef _DEBUG

virtual void AssertValid() const;

virtual void Dump( CDumpContext& dc ) const;

#endif

virtual void CalcWindowRect( LPRECT lpClientRect, UINT nAdjustType = adjustBorder );

protected:

// called first time after construct

virtual void OnInitialUpdate();

virtual BOOL OnPreparePrinting( CPrintInfo *pInfo );

afx_msg void OnDestroy();

afx_msg BOOL OnEraseBkgnd( CDC *pDC );

DECLARE_MESSAGE_MAP()

void OnEmptyCommand( UINT );

virtual void OnDraw( CDC* /*pDC*/ );

afx_msg void OnPaint();

afx_msg void OnNcPaint();

public:

afx_msg void OnMouseMove(UINT nFlags, CPoint point);

protected:

virtual void OnUpdate(CView* /*pSender*/, LPARAM /*lHint*/, CObject* /*pHint*/);

HBITMAP hBitmap;

public:

afx_msg void OnSize(UINT nType, int cx, int cy);

};

My CPP

#include "stdafx.h"

#include "CMainApp.h"

#include "CMainDoc.h"

#include "CMainView.h"

#include "CMainFrame.h"

#include "CWorkspaceView.h"

#include "CDoubleBuffer.h"

#ifdef _DEBUG

#define new DEBUG_NEW

#undef THIS_FILE

static char THIS_FILE[] = __FILE__;

#endif

/*************************************************************************************************************************************************************\

*

* Message maps

*

* DESCRIPTION:

* Message maps

*

\*************************************************************************************************************************************************************/

IMPLEMENT_DYNCREATE( CMainView, CView )

BEGIN_MESSAGE_MAP( CMainView, CView )

ON_WM_DESTROY()

ON_WM_MOUSEMOVE()

ON_WM_PAINT()

ON_WM_ERASEBKGND()

ON_WM_NCPAINT()

ON_WM_SIZE()

END_MESSAGE_MAP()

/*************************************************************************************************************************************************************\

*

* CAlphabetNamesView()

*

* DESCRIPTION:

* Constructor

*

\*************************************************************************************************************************************************************/

CMainView::CMainView()

{

hBitmap = (HBITMAP)::LoadImage( NULL, "C:\\test.bmp", IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_LOADFROMFILE );

}

/*************************************************************************************************************************************************************\

*

* ~CAlphabetNamesView()

*

* DESCRIPTION:

* Destructor

*

\*************************************************************************************************************************************************************/

CMainView::~CMainView()

{

}

/*************************************************************************************************************************************************************\

*

* BOOL PreCreateWindow( CREATESTRUCT& cs )

*

* DESCRIPTION:

* Precreate window style

*

\*************************************************************************************************************************************************************/

BOOL CMainView::PreCreateWindow( CREATESTRUCT& cs )

{

cs.dwExStyle &= ~WS_EX_CLIENTEDGE;

return CView::PreCreateWindow( cs );

}

/*************************************************************************************************************************************************************\

*

* void OnInitialUpdate()

*

* DESCRIPTION:

* Initial update on view. Called only once

*

\*************************************************************************************************************************************************************/

void CMainView::OnInitialUpdate()

{

CView::OnInitialUpdate();

ModifyStyleEx( WS_EX_CLIENTEDGE , 0 );

ModifyStyle( 0, WS_BORDER );

ULONG ulStyle = ::GetClassLong( GetSafeHwnd(), GCL_STYLE );

if( !( ulStyle & CS_DROPSHADOW ) )

::SetClassLong( GetSafeHwnd(), GCL_STYLE, CS_DROPSHADOW );

}

/*************************************************************************************************************************************************************\

*

* void OnPreparePrinting( CPrintInfo *pInfo )

*

* DESCRIPTION:

* Prepare printing

*

\*************************************************************************************************************************************************************/

BOOL CMainView::OnPreparePrinting( CPrintInfo *pInfo )

{

// default preparation

return DoPreparePrinting( pInfo );

}

/*************************************************************************************************************************************************************\

*

* void OnDestroy( )

*

* DESCRIPTION:

* Destroy view

*

\*************************************************************************************************************************************************************/

void CMainView::OnDestroy()

{

CView::OnDestroy();

}

#ifdef _DEBUG

/*************************************************************************************************************************************************************\

*

* void AssertValid( ) const

*

* DESCRIPTION:

* Assert

*

\*************************************************************************************************************************************************************/

void CMainView::AssertValid() const

{

CView::AssertValid();

}

/*************************************************************************************************************************************************************\

*

* void Dump( CDumpContext& dc ) const

*

* DESCRIPTION:

* Dump

*

\*************************************************************************************************************************************************************/

void CMainView::Dump( CDumpContext& dc ) const

{

CView::Dump( dc );

}

/*************************************************************************************************************************************************************\

*

* CAlphabetNamesDoc* CAlphabetNamesView::GetDocument()

*

* DESCRIPTION:

* Return document object pointer

*

\*************************************************************************************************************************************************************/

CMainDoc* CMainView::GetDocument()

{

ASSERT( m_pDocument->IsKindOf( RUNTIME_CLASS( CMainDoc ) ) ) ;

return (CMainDoc *)m_pDocument;

}

#endif //_DEBUG

/*************************************************************************************************************************************************************\

*

* void OnDraw ( CDC *pDC )

*

* DESCRIPTION:

* View drawing function

*

\*************************************************************************************************************************************************************/

void CMainView::OnDraw( CDC *pDC )

{

return;

}

/*************************************************************************************************************************************************************\

*

* void CalcWindowRect( LPRECT lpClientRect, UINT nAdjustType )

*

* DESCRIPTION:

* Calculates window rect

*

\*************************************************************************************************************************************************************/

void CMainView::CalcWindowRect( LPRECT lpClientRect, UINT nAdjustType )

{

CView::CalcWindowRect( lpClientRect, nAdjustType );

int nWidth = 200;

int nHeight = 200;;

int nClientWidth = lpClientRect->right - lpClientRect->left;

int nBorders = max(8, nClientWidth - nWidth);

int nTopMargin = max(4, 40);

lpClientRect->top += nTopMargin;

lpClientRect->left += 300;

lpClientRect->right -= 300;

lpClientRect->bottom -= 30;

}

/*************************************************************************************************************************************************************\

*

* void OnMouseMove( UINT nFlags, CPoint point )

*

* DESCRIPTION:

* WM_MOUSEMOVE message handler

*

\*************************************************************************************************************************************************************/

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

{

CString cs;

cs.Format( "X=%.3d : Y=%.3d", point.x, point.y );

CMainFrame* pFrame = (CMainFrame *)AfxGetMainWnd();

if ( pFrame )

{

pFrame->m_wndStatusBar.SetPaneText( pFrame->m_wndStatusBar.CommandToIndex( ID_INDICATOR_POSITION ), cs, TRUE );

}

CView::OnMouseMove(nFlags, point);

}

/*************************************************************************************************************************************************************\

*

* void OnUpdate( CView *pSender, LPARAM lHint, CObject *pHint )

*

* DESCRIPTION:

* OnUpdate view function called by document object

*

\*************************************************************************************************************************************************************/

void CMainView::OnUpdate( CView *pSender, LPARAM lHint, CObject *pHint )

{

int nParam = (int)lHint;

//if ( nParam == 1 )

// m_strFileName = *(CString *)pHint;

}

/*************************************************************************************************************************************************************\

*

* void OnPaint()

*

* DESCRIPTION:

* OnPaint message handler

*

\*************************************************************************************************************************************************************/

void CMainView::OnPaint()

{

CPaintDC dc( this );

CXTPWindowRect rc( this );

//GetClientRect( &rcClient );

ScreenToClient( &rc );

CXTMemDC memDC( &dc, &rc );

rc.DeflateRect( 20, 20, 20, 20 );

memDC.FillSolidRect( &rc, RGB( 255, 0, 0 ) );

}

 

/*************************************************************************************************************************************************************\

*

* void OnEraseBkgnd( CDC *pDC )

*

* DESCRIPTION:

* WM_ERASEBKGND message handler

*

\*************************************************************************************************************************************************************/

BOOL CMainView::OnEraseBkgnd( CDC *pDC )

{

return TRUE;

}

/*************************************************************************************************************************************************************\

*

* void OnNcPaint()

*

* DESCRIPTION:

* OnNcPaint message handler

*

\*************************************************************************************************************************************************************/

void CMainView::OnNcPaint()

{

CView::OnNcPaint();

}

 

/*************************************************************************************************************************************************************\

*

* void OnSize( UINT nType, int cx, int cy )

*

* DESCRIPTION:

* WM_SIZE method

*

\*************************************************************************************************************************************************************/

void CMainView::OnSize( UINT nType, int cx, int cy )

{

CView::OnSize( nType, cx, cy );

}

Bastian
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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 May 2007 at 2:56pm
Hello,
 
Attach whole project in issuetrack.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.047 seconds.