Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - CDialog as property-grid item
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CDialog as property-grid item

 Post Reply Post Reply
Author
Message
farr02 View Drop Down
Groupie
Groupie


Joined: 10 May 2005
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote farr02 Quote  Post ReplyReply Direct Link To This Post Topic: CDialog as property-grid item
    Posted: 19 October 2005 at 10:33am
Hello,
I am developing a property-grid item that holds a CDialog. (I know this is a little bit perverse but my boss wants it;-) At the moment I have some problems with correct drawing of the CDialog, especially when expanding/collapsing other categories of the grid the inplace dialog will not be drawn correctly.
I have overridden the OnDrawItemValue member of my inplace-dialog class in nearly the same manner as shown for the button-property in the GridSample but the function will not get called, when the whole item gets invisible due to expanding an other category. So my inplace dialog stays visible:-( Anyone can give me a hint on how to handle this problem?

Best regards,
   Holger

Back to Top
farr02 View Drop Down
Groupie
Groupie


Joined: 10 May 2005
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote farr02 Quote  Post ReplyReply Direct Link To This Post Posted: 22 November 2005 at 2:44am
Hello,

finally I have implemented a class, that embeds a CDialog into a property-grid item. One can see the result in the GridSample-based demo-project: 2005-11-22_023757_GridSampleForum.zip

The new item is a CXTPPropertyGridItem-derived class, which holds a pointer to CDialog as a member. In the constructor the CDialog will be created, whereas OnDrawItemValue only shows or hides the dialog via ShowWindow. It also uses a pointer to the grid for resizing the grid automatically, if the dialog to be embed is wider than the grid. Caution: the MFC limits the height of a CListBox-item to 255 pixel (CXTPPropertyGrid is a CListBox derived class). Dialogs that are higher will be cropped. Last but not least one has keyboard navigation. (To leave the inplace dialog press ESC.)

I only have a problem with correct drawing of the dialog. Maybe someone can take a look at the code and give me a hint why the drawing is incorrect. (There is a problem with the scrollbars, too but Oleg told me that this must be a CListBox-bug and he will try to find a workaround. Maybe in 9.81 everything works fine.)

Best regards
   Holger

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.189 seconds.