Hiding splitter panes
Charles Shopsin -- chaz@jriver.jriver.com
Tuesday, November 12, 1996
Environment: VC++ 4.2b, Win 95
I am trying to implement an application that will create new splitter panes
on command from a user. I don't want to use the dynamic splitters because
the user does not get to choose where they go. Also there may be 5 or more
panes in one Row (dynamic splitters only allow 2 per row). I have tried
making the panes in advance and hiding them by making their min size larger
than the screen but it still displays the splitter bar on the side of the
screen.
Does anyone know how to either create static frames on the fly, or hide
ones for later use?
Thanks,
Charles
----------------------------------------------------
Charles Shopsin |email: chaz@jriver.com |
Windows Developer |Voice: 612-339-2521 |
J. River, Inc. |Fax: 612-339-7056 |
125 North First Street |Cell: 612-817-4901 |
Minneapolis, MN 55401 | |
----------------------------------------------------
Rob den Breejen -- robb@and.nl
Thursday, November 14, 1996
[Mini-digest: 2 responses]
Hi Charles,
Some handy Splitter functions can only be used for dynamic splitters. In =
these functions there's an ASSERT for SPLS_DYNAMIC_SPLIT. You can fake =
this by setting this style before calling a 'dynamic-style' function and =
restore afterwards. In the following code I wrote my own 'static' =
DeleteRow() and SplitRow().
void CSplitter::DeleteThisRow(int nRow)
{
// Get current style
long lStyle =3D GetWindowLong(this->GetSafeHwnd(), GWL_STYLE);
SetWindowLong(this->GetSafeHwnd(), GWL_STYLE, =
lStyle|SPLS_DYNAMIC_SPLIT);
DeleteRow(nRow);
// Restore style
SetWindowLong(this->GetSafeHwnd(), GWL_STYLE, lStyle);
}
void CSplitter::SplitThisRow(int cyBefore)
{
long lStyle =3D GetWindowLong(this->GetSafeHwnd(), GWL_STYLE);
SetWindowLong(this->GetSafeHwnd(), GWL_STYLE, =
lStyle|SPLS_DYNAMIC_SPLIT);
m_pDynamicViewClass =3D RUNTIME_CLASS(CMyView);
SetRowInfo(0, 100, 10);
SplitRow(cyBefore);
SetWindowLong(this->GetSafeHwnd(), GWL_STYLE, lStyle);
}
=09
I hope this helps,
Rob den Breejen. (robb@and.nl)
----------
From: Charles Shopsin[SMTP:chaz@jriver.jriver.com]
Sent: Tuesday, November 12, 1996 7:30 PM
To: mfc-l@netcom.com
Subject: Hiding splitter panes
Environment: VC++ 4.2b, Win 95
I am trying to implement an application that will create new splitter =
panes
on command from a user. I don't want to use the dynamic splitters =
because
the user does not get to choose where they go. Also there may be 5 or =
more
panes in one Row (dynamic splitters only allow 2 per row). I have tried
making the panes in advance and hiding them by making their min size =
larger
than the screen but it still displays the splitter bar on the side of =
the
screen.
Does anyone know how to either create static frames on the fly, or hide
ones for later use?
Thanks,
Charles
----------------------------------------------------
Charles Shopsin |email: chaz@jriver.com |
Windows Developer |Voice: 612-339-2521 |
J. River, Inc. |Fax: 612-339-7056 |
125 North First Street |Cell: 612-817-4901 |
Minneapolis, MN 55401 | | =20
----------------------------------------------------
Dong Chen -- d_chen@ix.netcom.com
Thursday, November 14, 1996
At 12:30 PM 11/12/96 -0600, you wrote:
>
>
>Environment: VC++ 4.2b, Win 95
>
>
>
>I am trying to implement an application that will create new splitter panes
>on command from a user. I don't want to use the dynamic splitters because
>the user does not get to choose where they go. Also there may be 5 or more
>panes in one Row (dynamic splitters only allow 2 per row). I have tried
>making the panes in advance and hiding them by making their min size larger
>than the screen but it still displays the splitter bar on the side of the
>screen.
>
>Does anyone know how to either create static frames on the fly, or hide
>ones for later use?
>Thanks,
>Charles
>----------------------------------------------------
>Charles Shopsin |email: chaz@jriver.com |
>Windows Developer |Voice: 612-339-2521 |
>J. River, Inc. |Fax: 612-339-7056 |
>125 North First Street |Cell: 612-817-4901 |
>Minneapolis, MN 55401 | |
>----------------------------------------------------
>
>
I ran across the knowledge base article Q149257: SAMPLE: Split32: How to
Replace a View in a Splitter Window in microsoft home page. I think you can
get what you want from that sample. Good luck.
--
Dong
d_chen@ix.netcom.com
| Вернуться в корень Архива
|