Print Page | Close Window

some code not work for CHtmlView & CHtmlEditView

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Shortcut Bar
Forum Description: Topics Related to Codejock Shortcut Bar
URL: http://forum.codejock.com/forum_posts.asp?TID=6549
Printed Date: 28 April 2024 at 4:59pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: some code not work for CHtmlView & CHtmlEditView
Posted By: jchip
Subject: some code not work for CHtmlView & CHtmlEditView
Date Posted: 02 March 2007 at 11:52am

void CShortcutBarView::OnDraw(CDC* pDC)

{

CShortcutBarDoc* pDoc = GetDocument();

ASSERT_VALID(pDoc);

if (XTPPaintManager()->GetCurrentTheme() == xtpThemeOffice2003)

pDC->Draw3dRect(CXTPClientRect(this), GetXtremeColor(XPCOLOR_FRAME), GetXtremeColor(XPCOLOR_FRAME));

else

pDC->Draw3dRect(CXTPClientRect(this), GetXtremeColor(COLOR_3DSHADOW), GetXtremeColor(COLOR_3DHIGHLIGHT));

}

 

It only works with CView, but not work for CHtmlView & CHtmlEditView.

Please help.

 

 




Replies:
Posted By: Oleg
Date Posted: 04 March 2007 at 4:04am
Hi,
See CHtmlView::OnPaint method and CHtmlView ::OnDraw:
 
void CHtmlView::OnDraw(CDC* /* pDC */)
{
 // this class should never do its own drawing;
 // the browser control should handle everything
 ASSERT(FALSE);
}

void CHtmlView::OnPaint()
{
 Default();
}
 
 
 
so OnDraw never called for such views.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: rmercer
Date Posted: 05 March 2007 at 10:51am
Originally posted by jchip jchip wrote:

void CShortcutBarView::OnDraw(CDC* pDC)

{

CShortcutBarDoc* pDoc = GetDocument();

ASSERT_VALID(pDoc);

if (XTPPaintManager()->GetCurrentTheme() == xtpThemeOffice2003)

pDC->Draw3dRect(CXTPClientRect(this), GetXtremeColor(XPCOLOR_FRAME), GetXtremeColor(XPCOLOR_FRAME));

else

pDC->Draw3dRect(CXTPClientRect(this), GetXtremeColor(COLOR_3DSHADOW), GetXtremeColor(COLOR_3DHIGHLIGHT));

}

 

It only works with CView, but not work for CHtmlView & CHtmlEditView.

Please help.

 

 

If you're looking to draw a thin border around the view, why not just use CXTPOfficeBorder when you create the view?


Posted By: jchip
Date Posted: 06 March 2007 at 12:08pm
Originally posted by oleg oleg wrote:

Hi,
See CHtmlView::OnPaint method and CHtmlView ::OnDraw:
 
void CHtmlView::OnDraw(CDC* /* pDC */)
{
 // this class should never do its own drawing;
 // the browser control should handle everything
 ASSERT(FALSE);
}

void CHtmlView::OnPaint()
{
 Default();
}
 
 
 
so OnDraw never called for such views.

 

 

CHtmlView::OnDraw never be invoked.

Should I have to move the code in CHtmlView::OnPain()?
Some time looks not work perfectly.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net