Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - XTPPropertyGrid inside CPropertyPage
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

XTPPropertyGrid inside CPropertyPage

 Post Reply Post Reply
Author
Message
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Topic: XTPPropertyGrid inside CPropertyPage
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 20 July 2007 at 2:55am
Hello,
Yes you can - add in dialog custom control with class "XTPPropertyGrid"
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post 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. 
 
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post 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.
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 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
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 20 July 2007 at 8:25am
I'll try that - can a HBRUSH be used to draw a background bitmap?
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post 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.
 
 
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.219 seconds.