What's this article about?

I'll introduce you to some of my code that has will make your windows support automatic repositioning of their child controls. I'll call such windows dynamic (since they don't have a static size and child control ordering but dynamic ones):

cdxCDynamicBar, cdxCDynamicBarDlg and cdxCDynamicBarT<>A controlbar with an embedded dialog that is dynamically moving its childs.The bar itself is derived from the CSizingControlBar published at CodeGuru.com by Cristi Posea.

Now uses ::DeferWindowPos() instead of ::SetWindowPos() to decrease flickering (for all classes). *

Anti-Flickering system for cdxCDynamicDialog (looks much better!). *

Supports scrolling in CFormView (and any other class, if you enable it by hand). *

"Auto-Positioning" feature for dynamic dialogs & property pages. *

Support for dialogs that are meant to be "child control dialogs" - if often embedd dialogs and this class helps to make your child controls remain in a suitable place :)

A ControlBar solution.

* ~ Suggested by users of my cdxCDynamicControlsManager :)

However, since I rewrote much of the code of the cdxCDynamicControlsManager, you cannot switch from that class to my new cdxCDynamicWnd without further work to be done; converting a cdxCSizingDialog into a cdxCDynamicDialog would need help by you.

A documentation file is included in the sub-directory codex/doc/cdxCDynamicWnd-DOC.html.

Any suggestions & bug-reports are welcome.

</li />

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

In /codex/doc/cdxCDynamicWnd-DOC.html the author states:
"You are free to use and modify the code and the classes but I would like you to note the author (that's me in your product's documentation at any place, if possible.
You use this code at your own risk.
Any damange caused by the use or misuse of this code is the sole responsibility of the user."
So add an acknowledgement to your documentation and that's it.

I would like to close Modeless sheet dialog by clicking the right up button, or Alt+F4 - but it seems not to work (VC++ 7.1 / Win Xp prof. - SP2). How can I do this? Also, it is possible to add minimize and maximize button to the title bar of this modeless sheet dialog and to send messages to the child controls of property pages included - something like OnChildNotify...?

I'm trying to make my dialog based application "Dynamic", by using the cdxCDynamicDialog class. I have managed, more or less, to make everything work OK, but I have a couple (or three) issues:

- When the application starts, the dialog is bigger than what I have defined in the resource editor. I can make it smaller after cdxCDynamicDialog::OnInitDialog() sets the size, but is this OK?

- When I try to minimize, the application throws an assertion failure. If I ignore it, it works OK, and it seems to work OK on release as well. Is this normal?

- If the dialog is smaller than a certain size X and I minimize it, when I restore it, it restores to that size X, bigger than the original one. How can I make it "remember" its size? Am I doing something wrong?

When I place a button of any kind (push, radio, checkbox) on the cdxDynamicPropertyPage, the painting gets messed up when I maximize the window. The lower third of the prop page is white instead of the normal grey background color. I am using XP and I get the same problem whether XP Themes are enabled or not.

OK, it _is_ the use of XP Themes (aka ComCtl32.dll version 6 or later) that has caused this painting bug for the Property Page. Unfortunately, I can't disable the Themes for the final release. I have also tested another resizable PropertySheet with the same results, so this looks like it is not a bug for this set of classes, but a bug in general. We can kill this thread here, unless anyone knows what is up with the CButton class.

I've use cdx... classes in my MFC application to make all property pages, dialogs, etc. resizeable and it works fine on Win2K & winXP (Thanks a lot to Hans Buhler) but it crashes when running on win98.