Print Page | Close Window

XTPPropertyGrid inside CPropertyPage

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=7632
Printed Date: 21 November 2024 at 2:34pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: XTPPropertyGrid inside CPropertyPage
Posted By: adrien
Subject: XTPPropertyGrid inside CPropertyPage
Date Posted: 19 July 2007 at 6:42pm
 
Embedding a XTPropertyGrid using Create(...) makes the following problems:
 
1. split-bar between top part and help text at the bottom is in BTNFACE not background image of the CTabCtrl
2. background color of the bottom help part is BTNFACE
3. Since it gets added to the dialog as a window drawn over the dialog, it is not added to the tab order of the dialog control items so you cannot tab to the control.
 
Ideally it would be good to be able to put a XTPPropertyGrid onto a dialog using DDX_Control(...) instead of using Create... is this possible?
 
Adrien



Replies:
Posted By: Oleg
Date Posted: 20 July 2007 at 2:55am
Hello,
Yes you can - add in dialog custom control with class "XTPPropertyGrid"


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


Posted By: adrien
Date Posted: 20 July 2007 at 6:06am

OK that works for adding it thanks!

Still have a problem with background colors on skins though

possibly in CXTPPropertyGrid::OnInvertTracker()

it looks very odd on Le5 scheme. 
 
the reason it looks odd is because there are individual borders round the grid and the help area, so no delineation between the background and the splitter area, but you get a change in color. 
 


Posted By: adrien
Date Posted: 20 July 2007 at 6:30am
doesn't look like this would be easy to solve.
 
I tried it so we don't draw solid rect for backgrounds, but then the background becomes black, since we are drawing into a new memDC, so I modified also the CXTPBufferDC::CXTPBufferDC call to add
 
 ::BitBlt(m_hDC, 0,0, m_rect.right, m_rect.bottom, hDestDC, 0, 0, SRCCOPY);
 
then we just draw over the top of what was behind the control.  This looks great until you resize or change text in the help area - need to invalidate the parent window to re-draw the background.
 


Posted By: Oleg
Date Posted: 20 July 2007 at 7:05am
Hello,
 
Yes its designed, we will add m_bTransparent flag for next release.
 
You can patch CXTPPropertyGridPaintManager::FillPropertyGrid now
 
void CXTPPropertyGridPaintManager::FillPropertyGrid(CDC* pDC)
{
 CXTPClientRect rc(m_pGrid);
 HBRUSH hBrush = NULL;
 if (m_bTransparent)
 {
  hBrush = (HBRUSH)m_pGrid->GetParent()->SendMessage(WM_CTLCOLORSTATIC, (WPARAM)pDC->GetSafeHdc(), (LPARAM)m_pGrid->m_hWnd);
 }
 if (hBrush)
 {
  ::FillRect(pDC->GetSafeHdc(), rc, hBrush);
 }
 else
 {
  pDC->FillSolidRect(rc, m_clrFace);
 }
....
 
}


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


Posted By: adrien
Date Posted: 20 July 2007 at 8:25am
I'll try that - can a HBRUSH be used to draw a background bitmap?


Posted By: adrien
Date Posted: 20 July 2007 at 8:26am
ps, if there is a background bitmap, won't that FillRect get the offset wrong, and start at the beginning of the bitmap pattern?  That won't align with the background bitmap of the parent.
 
 



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