Click here to Skip to main content
6,305,776 members and growing! (17,519 online)
Email Password   helpLost your password?
Desktop Development » Dialogs and Windows » General     Intermediate

Dynamic child window positioning

By Hans Bühler

Describes a method to implement resizable child windows.
VC6, Visual Studio, MFC, Dev
Posted:22 Feb 2000
Views:205,670
Bookmarked:68 times
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
60 votes for this article.
Popularity: 8.29 Rating: 4.66 out of 5
2 votes, 8.3%
1

2

3
1 vote, 4.2%
4
21 votes, 87.5%
5

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 :)
    This is why we can not simply replace a cdxCDynamicControlsManager code into a cdxCDynamicWnd code. :(

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

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

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

About the Author

Hans Bühler


Member

Location: Germany Germany

Other popular Dialogs and Windows articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 55 (Total in Forum: 55) (Refresh)FirstPrevNext
GeneralNits so compiles with warning level 4 Pinmemberl_d_allan8:42 5 Nov '08  
GeneralFYI small bug? PinmemberJens froslev-nielsen3:36 15 May '07  
GeneralProblem with propertysheet multiline TabControl PinmemberDieter Hammer0:40 20 Dec '06  
GeneralModeless sheet bug? PinmemberIonut Codrut5:31 7 Dec '06  
QuestionSize problems Pinmembermluri23:44 23 Nov '06  
Questionhelp me,pls Pinmemberaiqin17:14 20 Oct '06  
QuestionRe: help me,pls Pinmemberaiqin17:25 20 Oct '06  
GeneralDynamic window Pinmemberanup_zade4:15 11 Jul '05  
GeneralcdxCDynamicFormView in a CSplitterWnd pane PinsussAnonymous10:29 24 Feb '05  
GeneralButton of any kind messes up Property Page Pinmembertritonesystems5:42 14 Jan '05  
GeneralRe: Button of any kind messes up Property Page Pinmembertritonesystems7:40 17 Jan '05  
GeneralMoving a child window PinsussArrun18:25 6 Jan '05  
GeneralUrgent!! Problem with win98 Pinmembermfc_surfer22:15 18 Sep '04  
GeneralProperty Page Control Resizing Problem PinsussAnonymous22:47 18 Jan '04  
GeneralMinimize the dialog window PinsussAnonymous10:04 8 Dec '03  
GeneralModeless PinsupporterChris Losinger10:13 28 Nov '03  
GeneralExcellent - one of the best CP add-ons I've seen Pinmemberame123:15 20 Oct '03  
Generalproblem! button was disabled in docked dialog! Pinmemberyoungflea23:31 4 Aug '03  
GeneralRe: problem! button was disabled in docked dialog! PinsussAnonymous22:46 30 Oct '03  
GeneralRe: problem! button was disabled in docked dialog! PinsussAnonymous23:10 30 Oct '03  
GeneralGreat Works!, I have 2 Problems. Pinmembershinsangyong17:25 30 Jun '03  
GeneralThanx for your work Pinmemberjazper8:54 1 Apr '03  
GeneralHow to make all dialog's controls become gray when dialog is disabled?? PinsussProTom5:04 13 Mar '03  
GeneralMenu Options in Dialog Box Application PinsussPrasanthi Inakollu13:39 23 Sep '02  
GeneralResizable UI PinsussSimon Tang23:53 19 Sep '02  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 22 Feb 2000
Editor: Sean Ewington
Copyright 2000 by Hans Bühler
Everything else Copyright © CodeProject, 1999-2009
Web19 | Advertise on the Code Project