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

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


Resizing Property page inside a splitter pane

Randy Kirby -- randy@sensor.secacc.com
Tuesday, October 01, 1996

Environment: MSVC 4.2, Windows 95.

I'm pulling my hair out trying to get my property pages to grow as 
the splitter pane in which they and their property page reside.

In the OnCreateClient method of my MainFrame, I am creating 2 
splitter windows and 4 panes. One of the panes holds my subclassed 
CView class.
In this view I have member variables that point to my 
property sheet and property pages. Inside the Create function for 
this view I create my property pages and sheet and add the pages to 
the sheet. (no problem so far...)

When the pane is displayed, the subclassed property sheet fills the 
splitter ane as it should, BUT the property pages remain the same 
size as the were when they were created. So, it makes sense that I 
should be overriding the OnSize function for the PropertySheet and 
then resizing the PropertyPages within.

So here's what I'm doin,:

MyPropertySheet::OnSize(...)
{
RECT rc;
GetWindowRect(&rc);
ScreenToClient(&rc);

MyPropertyPage* pPage =  (MyPropertyPage*) GetPage(0);
rc.top+=6;
rc.bottom-=6;
...
pPageMoveWindow(&rc);
...
}

But my porpertyPages are still in the same location.

I know this description is a bit vague, but any ideas?

Any help would be appreciated! I'm losin' hair fast!!!

Randy Kirby
Sensormatic Electronics
Boca Raton, FL
randy@secacc.com



Ian Southwell -- IanSouthwell@ApexSystems.COM
Thursday, October 03, 1996

[Mini-digest: 3 responses]

I am not looking at my source code, but from memory what I did was to
just resize my property sheet, the pages are sized automatically.  Just
call SetWindowPos() with the SWP_NOMOVE attribute and pass the width and
height from OnSize.  This is OK if its a CView but for CScrollView I had
to paint the background of the splitter window...  If you are still
having problems let me know and I'll dig out my code.

Ian Southwell

>----------
>From: 	Randy Kirby[SMTP:randy@sensor.secacc.com]
>Sent: 	Tuesday, October 01, 1996 6:41 PM
>To: 	mfc-l@netcom.com
>Subject: 	Resizing Property page inside a splitter pane
>
>Environment: MSVC 4.2, Windows 95.
>
>I'm pulling my hair out trying to get my property pages to grow as 
>the splitter pane in which they and their property page reside.
>
>In the OnCreateClient method of my MainFrame, I am creating 2 
>splitter windows and 4 panes. One of the panes holds my subclassed 
>CView class.
>In this view I have member variables that point to my 
>property sheet and property pages. Inside the Create function for 
>this view I create my property pages and sheet and add the pages to 
>the sheet. (no problem so far...)
>
>When the pane is displayed, the subclassed property sheet fills the 
>splitter ane as it should, BUT the property pages remain the same 
>size as the were when they were created. So, it makes sense that I 
>should be overriding the OnSize function for the PropertySheet and 
>then resizing the PropertyPages within.
>
>So here's what I'm doin,:
>
>MyPropertySheet::OnSize(...)
>{
>RECT rc;
>GetWindowRect(&rc);
>ScreenToClient(&rc);
>
>MyPropertyPage* pPage =  (MyPropertyPage*) GetPage(0);
>rc.top+=6;
>rc.bottom-=6;
>...
>pPageMoveWindow(&rc);
>...
>}
>
>But my porpertyPages are still in the same location.
>
>I know this description is a bit vague, but any ideas?
>
>Any help would be appreciated! I'm losin' hair fast!!!
>
>Randy Kirby
>Sensormatic Electronics
>Boca Raton, FL
>randy@secacc.com
>
-----From: ganeshs@nationwide.com

    Check out KB  article Q143291: "How to Resize  CPropertyPages at Run
Time" for the answer... Hope it stops your hair-fall! ;->

/ ___|    / ___| __ _ _ __   ___  ___| |    I do not speak for
\___ \   | |  _ / _` | '_ \ / _ \/ __| '_ \ Tata   Unisys   or
 ___) |  | |_| | (_| | | | |  __/\__ \ | | |Nationwide    Ins.
|____(_)  \____|\__,_|_| |_|\___||___/_| |_|------------------
-----From: "D. John Anderson" 

You need to get the TabControl of the property sheet by sening it =
a GetTabControl and send the TabControl a MoveWindow for the new =
size. It in turn needs to send a MoveWindow to the active property =
page (or all pages unless you pages when they become active). =
Calling GetTabControl crashes until the PropertySheet has been =
properly initialized with Create in the modeless case.

Hope this helps,
John Anderson




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