Click here to Skip to main content
11,631,212 members (74,298 online)
Click here to Skip to main content

Dynamic child window positioning

, 22 Feb 2000 265.1K 2.7K 95
Rate this:
Please Sign up or sign in to vote.
Describes a method to implement resizable child windows.

This article replaces my former article "Dynamic child window positioning" (cdxCDynamicControlsManager).
See the what's new section to find our whether it's worth changing your code.

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):

cdxCDynamicWnd-small.gif (2466 Byte) => cdxCDynamicWnd-big.gif (2928 Byte)

What classes are part of this release?

  • cdxCDynamicWnd, cdxCDynamicWndEx
    General base class(es) used to implement dynamic child window repositioning in any CWnd-derived class.

  • cdxCDynamicDialog
    A CDialog replacement that allows you to dynamically move your controls.

  • cdxCDynamicChildDlg
    The same as a dialog base-class for child window dialogs.

  • cdxCDynamicFormView
    A CFormView, now supports the scrollbars, knows its own size perfectly and stuff!

  • cdxCDynamicPropSheet, cdxCDynamicPropPage
    The dynamic CPropertySheet / CPropertyPage replacement.

  • 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.

What's new in contrast to my former cdxCDynamicControlsMananger + associated classes?

  • New and better code Smile | :)
    This is why we can not simply replace a cdxCDynamicControlsManager code into a cdxCDynamicWnd code. Frown | :(

  • Now works with HWNDs and IDs instead of CWnds.
    Therefore you don't need to explicitely create DDX control variables anymore. *

  • Supports "dynamic maps" - as known from message map macros.
    These maps map IDs to a resizable control. *

  • 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 Smile | :)

  • A ControlBar solution.

* ~ Suggested by users of my cdxCDynamicControlsManager Smile | :)

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.

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.

A list of licenses authors might use can be found here

Share

About the Author

Hans Bühler
Other JP Morgan Chase
Hong Kong Hong Kong
No Biography provided

You may also be interested in...

Comments and Discussions

 
GeneralDynamic window Pin
anup_zade11-Jul-05 3:15
memberanup_zade11-Jul-05 3:15 
GeneralcdxCDynamicFormView in a CSplitterWnd pane Pin
Anonymous24-Feb-05 9:29
sussAnonymous24-Feb-05 9:29 
GeneralButton of any kind messes up Property Page Pin
tritonesystems14-Jan-05 4:42
membertritonesystems14-Jan-05 4:42 
GeneralRe: Button of any kind messes up Property Page Pin
tritonesystems17-Jan-05 6:40
membertritonesystems17-Jan-05 6:40 
GeneralMoving a child window Pin
Arrun6-Jan-05 17:25
sussArrun6-Jan-05 17:25 
GeneralUrgent!! Problem with win98 Pin
mfc_surfer18-Sep-04 21:15
membermfc_surfer18-Sep-04 21:15 
GeneralProperty Page Control Resizing Problem Pin
Anonymous18-Jan-04 21:47
sussAnonymous18-Jan-04 21:47 
GeneralMinimize the dialog window Pin
Anonymous8-Dec-03 9:04
sussAnonymous8-Dec-03 9:04 
GeneralModeless Pin
Chris Losinger28-Nov-03 9:13
memberChris Losinger28-Nov-03 9:13 
GeneralExcellent - one of the best CP add-ons I've seen Pin
ame1220-Oct-03 2:15
memberame1220-Oct-03 2:15 
Generalproblem! button was disabled in docked dialog! Pin
youngflea4-Aug-03 22:31
memberyoungflea4-Aug-03 22:31 
GeneralRe: problem! button was disabled in docked dialog! Pin
Anonymous30-Oct-03 21:46
sussAnonymous30-Oct-03 21:46 
GeneralRe: problem! button was disabled in docked dialog! Pin
Anonymous30-Oct-03 22:10
sussAnonymous30-Oct-03 22:10 
GeneralGreat Works!, I have 2 Problems. Pin
shinsangyong30-Jun-03 16:25
membershinsangyong30-Jun-03 16:25 
GeneralThanx for your work Pin
jazper1-Apr-03 7:54
memberjazper1-Apr-03 7:54 
QuestionHow to make all dialog's controls become gray when dialog is disabled?? Pin
ProTom13-Mar-03 4:04
sussProTom13-Mar-03 4:04 
GeneralMenu Options in Dialog Box Application Pin
Prasanthi Inakollu23-Sep-02 12:39
sussPrasanthi Inakollu23-Sep-02 12:39 
GeneralResizable UI Pin
Simon Tang19-Sep-02 22:53
sussSimon Tang19-Sep-02 22:53 
GeneralUpdate a control at run-timer Pin
Joel Lucsy19-Aug-02 4:14
memberJoel Lucsy19-Aug-02 4:14 
QuestionHow to remove Size Grip ? Pin
XCorra25-Jul-02 5:02
memberXCorra25-Jul-02 5:02 
AnswerRe: How to remove Size Grip ? Pin
Anonymous13-May-03 20:29
sussAnonymous13-May-03 20:29 
GeneralRe: How to remove Size Grip ? Pin
BadBlue.com9-Oct-03 8:47
sussBadBlue.com9-Oct-03 8:47 
GeneralQuestion about the Layout() function Pin
Christian Pare12-Jun-02 5:48
memberChristian Pare12-Jun-02 5:48 
GeneralProblem in XP with ListCtrl in report view on a property page Pin
sguillaudeu11-Jun-02 11:23
membersguillaudeu11-Jun-02 11:23 
GeneralRe: Problem in XP with ListCtrl in report view on a property page Pin
Anonymous6-Aug-02 10:59
sussAnonymous6-Aug-02 10:59 
GeneralRe: Problem in XP with ListCtrl in report view on a property page Pin
Relieved Developer30-Dec-02 10:24
sussRelieved Developer30-Dec-02 10:24 
GeneralXP problems with prop sheets - thanks for the fix!! Pin
ame1227-Oct-03 3:38
memberame1227-Oct-03 3:38 
GeneralI can't used a Button Control in dialog. Pin
Cloudway24-Feb-02 20:05
memberCloudway24-Feb-02 20:05 
GeneralSolution: I can't used a Button Control in dialog. Pin
Eric Orgeron30-Oct-03 22:12
sussEric Orgeron30-Oct-03 22:12 
Questionprogram to reposition other application child windows? Pin
Joe F26-Jan-02 2:47
memberJoe F26-Jan-02 2:47 
GeneralATL object Pin
Fulvio Corradi9-Oct-01 20:44
memberFulvio Corradi9-Oct-01 20:44 
GeneralRe: ATL object Pin
corra12-Oct-01 0:59
membercorra12-Oct-01 0:59 
GeneralRe: ATL object Pin
ignacio16-Sep-03 5:13
memberignacio16-Sep-03 5:13 
QuestionDynamic controls? Pin
Anonymous27-Jul-01 5:27
memberAnonymous27-Jul-01 5:27 
AnswerRe: Dynamic controls? Pin
Matt Gullett27-Jul-01 6:34
memberMatt Gullett27-Jul-01 6:34 
GeneralRe: Dynamic controls? Pin
brandonl_webguy27-Jul-01 6:47
memberbrandonl_webguy27-Jul-01 6:47 
QuestionBug? '=' when you meant '=='? Pin
Mark Findlay18-Apr-01 11:24
memberMark Findlay18-Apr-01 11:24 
AnswerNot a bug - actual assignment w/ test Pin
soultech25-Jul-03 5:19
susssoultech25-Jul-03 5:19 
QuestionHow to keep the relative position of the controls while at the same time resize them. Pin
Xia Li19-Oct-00 8:04
sussXia Li19-Oct-00 8:04 
AnswerRe: How to keep the relative position of the controls while at the same time resize them. Pin
Uwe Keim3-Jan-01 0:33
memberUwe Keim3-Jan-01 0:33 
GeneralGreat work! Pin
Mark16-Oct-00 12:56
sussMark16-Oct-00 12:56 
QuestionWhen is an mdi child maximized ? Pin
Perry6-Oct-00 22:50
sussPerry6-Oct-00 22:50 
AnswerRe: When is an mdi child maximized ? Pin
Perry6-Oct-00 22:57
sussPerry6-Oct-00 22:57 
GeneralRe: When is an mdi child maximized ? Pin
Sen18-Oct-00 8:25
sussSen18-Oct-00 8:25 
GeneralCool stuff Pin
BuzzLightyear25-May-00 6:33
sussBuzzLightyear25-May-00 6:33 
GeneralProblems when including the code in a DLL Pin
Sen11-May-00 5:34
sussSen11-May-00 5:34 
GeneralRe: Problems when including the code in a DLL Pin
Frederic Metrich18-Aug-00 2:31
sussFrederic Metrich18-Aug-00 2:31 
GeneralLink to source incorrrect... wrong case Pin
The Obliterator7-Mar-00 10:53
sussThe Obliterator7-Mar-00 10:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150723.1 | Last Updated 23 Feb 2000
Article Copyright 2000 by Hans Bühler
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid