DlgSplit MFC Sample


Contents

Back to Kostya Sebov's home page/Professional Content


From the Author

Hi!

This page is devoted to a little sample I once posted to some MFC newsgroup (or was it mfc-l?) in response to a frequently appearing question on splitters in dialog boxes. I was impressed how much intelligent resources was being spent in attempt to stuff the CSplitterWnd into CDialog, while all that needed by majority was simply to have the two adjacent controls share the same dialog area.

I believe this sample represent a very simple technique that solves the problem without any extra complications.

As always all constructive comments are welcome!

Good luck to all!

Kostya.


ReadMe.txt

February 17th, 1997
Kiev, Ukraine.

This sample demonstrates a technique of implementing splitter-like functionality within the dialog box _without_ actually using the CSplitterWnd class.

Basically, it is modified Class-wizard-generated dialog-based app. It uses DLL-based MFC 4.2b (and the corresponding run-time library).

The Visual C++ 4.2b project file is included.

The approach is very straightforward:
1. Subclass the dialog,
2. Hittest the corresponding mouse events
3. Perform standard tracking scenario when the mouse is pressed
4. Reposition the child controls accordingly.

Please, note:
1. This is a quick and dirty sample, so
* it may contain bugs,
* it mainly does NOT perform error checking
* it does NOT fully account for some necessary cases (like dragging cancellation)
* of course, it does NOT imply any kind of warranty

2. It is NOT based on CSplitterWnd class, so
* dynamic split is NOT supported
* horz split is NOT directly supported (although the sample can be easily modified to do so)
* the user interface is not perfect (actually no splitbar is drawn and the dragging beedback is primitive)
* the controls involved in the splitter group are hard-coded

3. This is freeware, so
* you may use the sample code or ideas freely without any obligation
* you may copy it limitless number of time (if you want) for any purpose,
I appreciate if you include some note about the its origin (like this file).

Comments are welcome:
mailto: sebov@is.kiev.ua

Copyright (C) 1997 by Kostyantin Sebov


Download DlgSplit.zip

You can use the below location to downloaded zipped source code, resource and project files for the sample.

Virtual community on the Internet, CA, USA dlgsplit.zip

 


Back to Kostya Sebov's home page.

CopyrightŠ1997-1999 Kostya Sebov.
Last revised: March 23, 1999. 

1