News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

resize bar?

Started by DC, January 03, 2006, 04:41:05 AM

Previous topic - Next topic

DC

what is the thing called that resizes two clients at the same time?
like the one in explorer between the treeview and the listview?
or if it is just one window being resized and the other getting adjusted to fit, how do you limit dragging only one side?
thanx,
dc
this isn't daja vu, I'm just learning it for the 37th time
http://www.bmath.net

Tedd

Usually referred to as a "splitter" (window/bar)

You can do it in a number of ways (as with everything :P)
One way is to create a child window (with no real contents, borders, etc) and place it between the two windows (if you need more than two, then you need more 'splitters') making its width only 2 or 3 and set its cursor to the sideways or upanddown resizer one.
Then you have to catch WM_LBUTTONDOWN and this starts the resizing. Then you SetCapure, and use the WM_MOUSEMOVE messages to see where to MoveWindow your splitter. And at the same time as you MoveWindow the splitter, you also MoveWindow its two friends (which you'll adjust the paramaters make them resize.) And then when you get WM_LBUTTONUP, you can ReleaseCapture, and presto - it is done!

That's the proper way to do it (so says I) - a little more cheaply (and dirty :bdg), you can avoid creating the extra window, size the two windows to leave a litle gap between them, and set the cursor of the parent, then just start dragging on WM_LBUTTONDOWN on the parent's background, use WM_MOUSEMOVE (without setting capture), and stop sizing on WM_LBUTTONUP. This is limited to only one splitter though.
No snowflake in an avalanche feels responsible.

DC

thanx there Tedd,
once again you haved saved my life,
take care,
DC
this isn't daja vu, I'm just learning it for the 37th time
http://www.bmath.net