diff --git a/samples/mfc/standard/01_Geometry/src/GeometryView2D.cpp b/samples/mfc/standard/01_Geometry/src/GeometryView2D.cpp index feaa1e488e..e46af68988 100755 --- a/samples/mfc/standard/01_Geometry/src/GeometryView2D.cpp +++ b/samples/mfc/standard/01_Geometry/src/GeometryView2D.cpp @@ -276,8 +276,9 @@ void CGeometryView2D::OnMouseMove(UINT nFlags, CPoint point) } } -void CGeometryView2D::OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/) +void CGeometryView2D::OnSize(UINT nType, int cx, int cy) { + OCC_2dView::OnSize (nType, cx, cy); if (!myV2dView.IsNull()) { myV2dView->MustBeResized(); // added sro diff --git a/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.cpp b/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.cpp index a410788be2..85e697d771 100755 --- a/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.cpp +++ b/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.cpp @@ -111,8 +111,6 @@ CViewer3dView::CViewer3dView() myXmax (0), myYmax (0), myCurZoom (0.0), - myWidth (0), - myHeight (0), NbActiveLights (2), // There are 2 default active lights myHlrModeIsOn (Standard_False), m_Pen (NULL), @@ -131,10 +129,10 @@ CViewer3dView::~CViewer3dView() BOOL CViewer3dView::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); } ///////////////////////////////////////////////////////////////////////////// @@ -170,15 +168,7 @@ void CViewer3dView::OnDraw(CDC* /*pDC*/) { CViewer3dDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); - CRect aRect; - GetWindowRect(aRect); - if(myWidth != aRect.Width() || myHeight != aRect.Height()) { - myWidth = aRect.Width(); - myHeight = aRect.Height(); - ::PostMessage ( GetSafeHwnd () , WM_SIZE , SW_SHOW , myWidth + myHeight*65536 ); - } myView->Redraw(); - } ///////////////////////////////////////////////////////////////////////////// @@ -228,8 +218,9 @@ gp_Pnt ConvertClickToPoint(Standard_Real x, Standard_Real y, Handle(V3d_View) aV return ResultPoint; } -void CViewer3dView::OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/) +void CViewer3dView::OnSize(UINT nType, int cx, int cy) { + CView::OnSize (nType, cx, cy); if (!myView.IsNull()) myView->MustBeResized(); } diff --git a/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.h b/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.h index 8aeb8239ca..06eef81652 100755 --- a/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.h +++ b/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.h @@ -137,8 +137,6 @@ private: Standard_Integer myYmin; Standard_Integer myXmax; Standard_Integer myYmax; - Standard_Integer myWidth; - Standard_Integer myHeight; Standard_Integer NbActiveLights; Standard_Boolean myHlrModeIsOn; diff --git a/samples/mfc/standard/09_Animation/src/AnimationView3D.cpp b/samples/mfc/standard/09_Animation/src/AnimationView3D.cpp index 4324a162c3..563abdcd51 100755 --- a/samples/mfc/standard/09_Animation/src/AnimationView3D.cpp +++ b/samples/mfc/standard/09_Animation/src/AnimationView3D.cpp @@ -105,10 +105,10 @@ CAnimationView3D::~CAnimationView3D() BOOL CAnimationView3D::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); } ///////////////////////////////////////////////////////////////////////////// @@ -227,12 +227,13 @@ void CAnimationView3D::OnFileExportImage() GetDocument()->ExportView (myView); } -void CAnimationView3D::OnSize(UINT /*nType*/, int cx, int cy) +void CAnimationView3D::OnSize(UINT nType, int cx, int cy) { - m_cx = cx ; - m_cy = cy ; - if (!myView.IsNull()) - myView->MustBeResized(); + CView::OnSize (nType, cx, cy); + m_cx = cx ; + m_cy = cy ; + if (!myView.IsNull()) + myView->MustBeResized(); } void CAnimationView3D::OnBUTTONBack() diff --git a/samples/mfc/standard/10_Convert/src/WNT/OCCDemoView.cpp b/samples/mfc/standard/10_Convert/src/WNT/OCCDemoView.cpp index cd2c43c792..0a50eb246a 100755 --- a/samples/mfc/standard/10_Convert/src/WNT/OCCDemoView.cpp +++ b/samples/mfc/standard/10_Convert/src/WNT/OCCDemoView.cpp @@ -83,10 +83,10 @@ COCCDemoView::~COCCDemoView() BOOL COCCDemoView::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); } ///////////////////////////////////////////////////////////////////////////// @@ -141,8 +141,9 @@ COCCDemoDoc* COCCDemoView::GetDocument() // non-debug version is inline ///////////////////////////////////////////////////////////////////////////// // COCCDemoView message handlers -void COCCDemoView::OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/) +void COCCDemoView::OnSize(UINT nType, int cx, int cy) { + CView::OnSize (nType, cx, cy); if (!myView.IsNull()) myView->MustBeResized(); } diff --git a/samples/mfc/standard/Common/OCC_2dView.cpp b/samples/mfc/standard/Common/OCC_2dView.cpp index a0b4290da4..dcd52bdb7c 100755 --- a/samples/mfc/standard/Common/OCC_2dView.cpp +++ b/samples/mfc/standard/Common/OCC_2dView.cpp @@ -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() diff --git a/samples/mfc/standard/Common/OCC_3dView.cpp b/samples/mfc/standard/Common/OCC_3dView.cpp index ed77baa0c5..4d8a4368ee 100755 --- a/samples/mfc/standard/Common/OCC_3dView.cpp +++ b/samples/mfc/standard/Common/OCC_3dView.cpp @@ -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(); } diff --git a/samples/mfc/standard/Common/Primitive/Sample2D_Text.cpp b/samples/mfc/standard/Common/Primitive/Sample2D_Text.cpp index 774ab2cac0..607f698e45 100755 --- a/samples/mfc/standard/Common/Primitive/Sample2D_Text.cpp +++ b/samples/mfc/standard/Common/Primitive/Sample2D_Text.cpp @@ -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);