1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0027543: Samples - flickering when view is resized in MFC samples

Define proper window class for OpenGL window within
overridden method CView::PreCreateWindow().
This commit is contained in:
kgv
2016-07-30 19:07:34 +03:00
committed by bugmaster
parent 458e3c0deb
commit d01ed5fdd1
8 changed files with 34 additions and 39 deletions

View File

@@ -80,6 +80,7 @@ BOOL OCC_2dView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.lpszClass = ::AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_OWNDC, ::LoadCursor(NULL, IDC_ARROW), NULL, NULL);
return CView::PreCreateWindow(cs);
}
@@ -471,12 +472,12 @@ void OCC_2dView::OnMouseMove(UINT nFlags, CPoint point)
}
void OCC_2dView::OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/)
void OCC_2dView::OnSize(UINT nType, int cx, int cy)
{
OCC_BaseView::OnSize (nType, cx, cy);
// Take care : This fonction is call before OnInitialUpdate
if (!myV2dView.IsNull())
myV2dView->MustBeResized();
}
void OCC_2dView::OnBUTTONFitAll()

View File

@@ -81,9 +81,10 @@ OCC_3dView::~OCC_3dView()
BOOL OCC_3dView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.lpszClass = ::AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_OWNDC, ::LoadCursor(NULL, IDC_ARROW), NULL, NULL);
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
@@ -162,8 +163,9 @@ void OCC_3dView::OnFileExportImage()
GetDocument()->ExportView (myView);
}
void OCC_3dView::OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/)
void OCC_3dView::OnSize(UINT nType, int cx, int cy)
{
OCC_BaseView::OnSize (nType, cx, cy);
if (!myView.IsNull())
myView->MustBeResized();
}

View File

@@ -43,7 +43,7 @@ void Sample2D_Text::Compute (const Handle(PrsMgr_PresentationManager3d)& /*aPres
asp->SetHorizontalJustification(myHAlign);
asp->SetVerticalJustification(myVAlign);
asp->Aspect()->SetTextZoomable(myIsZoomable);
asp->Aspect()->SetTextZoomable(myIsZoomable == Standard_True);
asp->Aspect()->SetTextAngle(myAngle);
asp->Aspect()->SetTextFontAspect(myFontAspect);
asp->SetHeight(myHeight);