Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - Property Grid as Dockable Pane?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Property Grid as Dockable Pane?

 Post Reply Post Reply
Author
Message
eric_hill View Drop Down
Newbie
Newbie
Avatar

Joined: 13 February 2006
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote eric_hill Quote  Post ReplyReply Direct Link To This Post Topic: Property Grid as Dockable Pane?
    Posted: 13 November 2006 at 4:43pm
What is the right way to create a property grid as a dockable pane?  I tried modifying the MFC ToolkitPro template such that the declaration of the pane was:

CXTPOfficeBorder<CXTPPropertyGrid> m_wndProperties;


The window did indeed show up as a property grid (I could see the help section below), but no matter what I do in the OnCreate routine, I can't get any items added to the grid.  Here's what I'm trying to do:

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) {
    // ...
    CXTPPropertyGridItem* pCategory = m_wndProperties.AddCategory(_T("Example Category"));
    CXTPPropertyGridItem* pItem = pCategory->AddChildItem(new CXTPPropertyGridItemNumber("Example Number"));
  // ...
}


This code compiles and runs just fine, but the property grid stays blank instead of showing the added item.

Any hints?
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: 14 November 2006 at 12:37am
You don't need CXTPOfficeBorder class. Just CXTPPropertyGrid m_wndProperties.
 
 
See GUI_Whidbey sample it has Property Grid as pane.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
eric_hill View Drop Down
Newbie
Newbie
Avatar

Joined: 13 February 2006
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote eric_hill Quote  Post ReplyReply Direct Link To This Post Posted: 14 November 2006 at 9:24am
The GUI_Whidbey led me to the correct answer.  After a grid.Create(...) call, you have to do grid.SetOwner(...), otherwise the grid will never paint.

Thanks.
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.125 seconds.