15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


How to divide up a client area

Linda Kasparek -- lindak@pumpkin.iii.net
Monday, January 29, 1996

Charles Petzold, in his book Programming Windows 3.1, describes dividing up
a client area into several smaller
rectangular regions using child windows where each child window has its own
window handle, window procedure, and
client area.  (Chapter 4, CHECKER3 example).  I'd like to implement this
exact same idea in an SDI VC++/MFC 4.0
app that uses the document/view paradigm.  My question is, what is the best
way to organize this?  Should I have
my view class own various child windows that are derived from CWnd?  Or
should I derive my various child windows
from CView and manage those from the main frame window?  

Thanks in advance,

Linda




Mario Contestabile -- Mario_Contestabile.UOS__MTL@UOSMTL2.universal.com
Tuesday, January 30, 1996

[Mini-digest: 3 responses]

[Snip->Cut()]
Charles Petzold, in his book Programming Windows 3.1, describes dividing up
a client area into several smaller
rectangular regions using child windows where each child window has its own
window handle, window procedure, and
client area.  (Chapter 4, CHECKER3 example).  I'd like to implement this
exact same idea in an SDI VC++/MFC 4.0
app that uses the document/view paradigm.  My question is, what is the best
way to organize this?  Should I have
my view class own various child windows that are derived from CWnd?  Or
should I derive my various child windows
from CView and manage those from the main frame window?  
[Snip()->UnCut()]

One quick and easy way of achieving this using the doc/view architecture is to 
simply:
- Put a CSplitterWnd member in your CChildWnd derived class.
- Override OnCreateClient() and call the splitter window CreateStatic() 
function, then CreateView() for each pane.

You can split your document into a maximum of 16 small views using this simple 
approach.

mcontest@universal.com

-----From: mikeblas@interserv.com

Are you sure you want each window to have its own window procedure?  Why do 
you want that?

>My question is, what is the best
>way to organize this?  Should I have
>my view class own various child windows that are derived from CWnd? 

View windows are already CWnd-derived classes with the extra smarts of 
dealing with frame windows and documents built into them.

> Or should I derive my various child windows
>from CView and manage those from the main frame window?  

That's what I would do, I think.

.B ekiM
--
TCHAR szDisc[] = _T("These words are my own; I do not speak for Microsoft.");

-----From: Deepak Saxena 

Easiest way to do this would be to use a splitter window and then catch 
WM_SIZE messages to reset the minimum size such that all the sections are
the size you want them to be.
-- 
Deepak Saxena -- deepak@ecn.purdue.edu -- http://cernan.ecn.purdue.edu/~deepak

Pinky, are you pondering what I'm pondering?
Uh, I think so, Brain, but burlap chafes me so.




| Вернуться в корень Архива |