- how to make two windows controls have the same edge
- Posted by TheTempest on August 3rd, 2003
Hello,
How would i link two edges of two controls together so that the user
could contract one to enlarge the other?
Like how expolore does it with it's treecontrol and listview
~Thanks~
- Posted by Tim Robinson on August 3rd, 2003
In MFC: CSplitterWnd
In ATL: CSplitterWindow
Without either of these:
-- Set the parent window's cursor to IDC_SIZEWE or something. Set the
parent's background brush to (COLOR_3DFACE + 1). Give each pane the
WS_EX_CLIENTEDGE style.
-- WM_SIZE: size the panes so they occupy the left and right sides, with
about a 3 pixel gap in between.
-- WM_LBUTTONDOWN: set a flag (is_dragging). Draw a line on the screen, with
an XOR pen, corresponding to the gap between the two panes. Call SetCapture.
-- WM_MOUSEMOVE: check the is_dragging flag. If set, erase the old line and
draw a new one at the mouse X position (GET_X_LPARAM(lParam)).
-- WM_LBUTTONUP: check the is_dragging flag. If set, erase the old line.
Store the new X position somewhere. Resize the two panes.
See MFC sources for more details.
--
Tim Robinson (MVP, Windows SDK)
http://www.themobius.co.uk/
"TheTempest" <wannabegenius15@hotmail.com> wrote in message
news:79c7484c.0308030958.1d336c2a@posting.google.c om...
- Posted by TheTempest on August 3rd, 2003
see,
the problem is that i'm not using MFC, i'm just doing this with plain
win32 api calls. And i'm thinking that there is an easier way that
that, perhaps a flag to call in the style, but i have no idea.
Thanks for the reply, i will try to impliment that =)
"Tim Robinson" <tim.at.gaat.freeserve.co.uk@invalid.com> wrote in message news:<bgjluu$pess8$1@ID-103400.news.uni-berlin.de>...
- Posted by Jakob Bieling on August 3rd, 2003
"TheTempest" <wannabegenius15@hotmail.com> wrote in message
news:79c7484c.0308031420.4c87f585@posting.google.c om...
No, there is flag for this. You have two child windows and you want them
to be resizable in a specific way. With the plain Win32 API, you do this
yourself, just like Tim showed you.
regards
--
jb
(replace y with x if you want to reply by e-mail)
- Posted by Norman Bullen on August 5th, 2003
Jakob Bieling wrote:
Seems to me it's high time someone created a "control" to do this. Lot's
of people have implemented splitters and it shouldn't be too much harder
to package that code in a separate window class.
Norm