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

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


resizing a CFrameWnd

Christoph P. Kukulies -- kuku@gilberto.physik.rwth-aachen.de
Tuesday, December 26, 1995

I'm pulling my hairs with the following - and though I got some advice
from this list and elsewhere I'm not getting further:

I have a mainfrm.cpp and a myview.cpp.
What I want is the resize the mainfrm window when the inner client rect
is changed. Or in other words: the inner client rect should always
appear in a certain x/y side ratio, e.g. 1.4.

I accompished this by intercepting OnWindowPosChanging in myview.cpp.
The client rect appears in the correct ratio but the outer framework
doesn't care - of course, since it isn't said to do so.

I looked into the CFrameWnd class, tried to play with ReclacLayout(),
RePositionsBars() but it appears to me rather complicated to 
achieve my desired goal.

If anyone has done so or can give me some starting help I'd be
very grateful.

--Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de



Lawrence Young -- hxkj@public.szptt.net.cn
Wednesday, December 27, 1995

You should intercept OnWindowPosChanging in mainfrm which should be derived 
from CFrameWnd instead of intercepting in myview, becasue the view window 
is defined to be the entire available client area of the Frame window. When 
changing the frame window, view changes accordingly.

----------
From: 	Christoph P. Kukulies[SMTP:kuku@gilberto.physik.rwth-aachen.de]
Sent: 	Wednesday, December 27, 1995 2:54 AM
To: 	mfc-l@netcom.com
Subject: 	resizing a CFrameWnd

I'm pulling my hairs with the following - and though I got some advice
from this list and elsewhere I'm not getting further:

I have a mainfrm.cpp and a myview.cpp.
What I want is the resize the mainfrm window when the inner client rect
is changed. Or in other words: the inner client rect should always
appear in a certain x/y side ratio, e.g. 1.4.

I accompished this by intercepting OnWindowPosChanging in myview.cpp.
The client rect appears in the correct ratio but the outer framework
doesn't care - of course, since it isn't said to do so.

I looked into the CFrameWnd class, tried to play with ReclacLayout(),
RePositionsBars() but it appears to me rather complicated to
achieve my desired goal.

If anyone has done so or can give me some starting help I'd be
very grateful.

--Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de




begin 600 WINMAIL.DAT
M>)\^(A8(`0:0" `$```````!``$``0>0!@`(````Y 0```````#H``$-@ 0`
M`@````(``@`!!) &``P!```!````# ````,``# #````"P`/#@`````"`?\/
M`0```#\`````````@2L?I+ZC$!F=;@#=`0]4`@````!M9F,M;$!N971C;VTN
M8V]M`%--5% `;69C+6Q ;F5T8V]M+F-O;0``'@`", $````%````4TU44 ``
M```>``,P`0```!$```!M9F,M;$!N971C;VTN8V]M``````,`%0P!`````P#^
M#P8````>``$P`0```!,````G;69C+6Q ;F5T8V]M+F-O;2<```(!"S !````
M%@```%--5% Z349#+4Q 3D540T]-+D-/30````,``#D`````"P! .@$````"
M`?8/`0````0````````#/RP!"( '`!@```!)4$TN36ECFEN9R!A($-&`' ``0```!D```!213H@)S=&5M`H,S=P+D!Q,"@'T*@ C/
M"=D[\18/,C4U`H *@0VQ"V#@;F\6-A<_$*4"!T:!\0(G(>(!QSGQN0!" -L0N 'X%T;Q[RCR-2
M"? AT!80(&%V"W#G"V "8!\08VP(D (P)@`]%A!A(1(C4B 3(]4N(/Y7(V #
MH!%Q'20C4@-0* B_(K CDRD3!Y$`T 6A9!U!/&QY** *A0J+)L Q.((P`M%I
M+3$T- WPYPS0+D,+63$V"J #8!/0^F,%0"TP9PJ'+QL,,"_F>R 0`W Z,6XO
MY@R"'_!H4P40$\!O1TBL$0%D!/@-U$@,CAU"SR=0( $' ;8"; '5'](E @$8 ET 0@`_ C4"F4[P;P%: CX1U@
M+28`('$C4,4(8&<><$D@9S `&R#[`W E\60B("O!%/
M@"$A!: (X@J%_1]P


Deepak Saxena -- deepak@ecn.purdue.edu
Wednesday, December 27, 1995

> I'm pulling my hairs with the following - and though I got some advice
> from this list and elsewhere I'm not getting further:
> 
> I have a mainfrm.cpp and a myview.cpp.
> What I want is the resize the mainfrm window when the inner client rect
> is changed. Or in other words: the inner client rect should always
> appear in a certain x/y side ratio, e.g. 1.4.
> 
> I accompished this by intercepting OnWindowPosChanging in myview.cpp.
> The client rect appears in the correct ratio but the outer framework
> doesn't care - of course, since it isn't said to do so.

I'm not in front of my computer and don't have the MFC reference on me at the
moment, but I believe you can just call myview::ResizeParentToFit(). This
should cause the frame window to wrap the children perfectly.

> --Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de

-- 
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 where will we find a duck and a hose at this hour?



Timothy G. Law -- tim@itsnet.com
Tuesday, January 02, 1996

Be sure to call myview::GetParentFrame()->RecalcLayout(); before you call myview::ResizeParentToFit() or it may not resize correctly.

----------
From: 	Deepak Saxena[SMTP:deepak@ecn.purdue.edu]
Sent: 	Wednesday, December 27, 1995 4:29 AM
To: 	mfc-l@netcom.com
Subject: 	Re: resizing a CFrameWnd

> I'm pulling my hairs with the following - and though I got some advice
> from this list and elsewhere I'm not getting further:
> 
> I have a mainfrm.cpp and a myview.cpp.
> What I want is the resize the mainfrm window when the inner client rect
> is changed. Or in other words: the inner client rect should always
> appear in a certain x/y side ratio, e.g. 1.4.
> 
> I accompished this by intercepting OnWindowPosChanging in myview.cpp.
> The client rect appears in the correct ratio but the outer framework
> doesn't care - of course, since it isn't said to do so.

I'm not in front of my computer and don't have the MFC reference on me at the
moment, but I believe you can just call myview::ResizeParentToFit(). This
should cause the frame window to wrap the children perfectly.

> --Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de

-- 
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 where will we find a duck and a hose at this hour?




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