Dec 062017
How to implement “split-bar” windows in Windows 3.1. | |||
---|---|---|---|
File Name | File Size | Zip Size | Zip Type |
README.TXT | 1590 | 678 | deflated |
SPLITWIN.EXE | 38056 | 15374 | deflated |
SPLITWIN.ZIP | 15157 | 14024 | deflated |
Download File SPLTBR.ZIP Here
Contents of the README.TXT file
SPLITWIN
--------
SPLITWIN demonstrates how to split a window into two panes so that the panes
can be scrolled independently in the vertical direction and together
in the horizontal direction.
A frame window is created with its client area filled with a child window. When
the window is split, a second child window is created and the two children are
sized as specified by the user. The two children can be scrolled independently
in the vertical direction. Only the lower child has a horizontal scroll bar.
Scrolling the lower child horizontally will also result in the upper child
being scrolled by the same amount.
The sizes of the panes is specified by the user by dragging a split-bar. The
split-bar can be dragged using the mouse or using the arrow keys. The split
window can be restored to its original state by dragging the split-bar off the
client area of the frame window or if there isn't enough space for the lower
child after a split.
The dragging is performed by a PeekMessage loop which looks for mouse and
keyboard messages:
while (bTracking) // While the split-bar is being dragged
{ // Get mouse and keyboard messages
while (!PeekMessage(&msgModal, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE) &&
!PeekMessage(&msgModal, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE))
WaitMessage();
:
;
}
PatBlt() is used to draw the split-bar while it is being dragged since it is
very fast.
The dragging code is in DRAG.C
The scrollling code is in SCROLL.C
--------
SPLITWIN demonstrates how to split a window into two panes so that the panes
can be scrolled independently in the vertical direction and together
in the horizontal direction.
A frame window is created with its client area filled with a child window. When
the window is split, a second child window is created and the two children are
sized as specified by the user. The two children can be scrolled independently
in the vertical direction. Only the lower child has a horizontal scroll bar.
Scrolling the lower child horizontally will also result in the upper child
being scrolled by the same amount.
The sizes of the panes is specified by the user by dragging a split-bar. The
split-bar can be dragged using the mouse or using the arrow keys. The split
window can be restored to its original state by dragging the split-bar off the
client area of the frame window or if there isn't enough space for the lower
child after a split.
The dragging is performed by a PeekMessage loop which looks for mouse and
keyboard messages:
while (bTracking) // While the split-bar is being dragged
{ // Get mouse and keyboard messages
while (!PeekMessage(&msgModal, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE) &&
!PeekMessage(&msgModal, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE))
WaitMessage();
:
;
}
PatBlt() is used to draw the split-bar while it is being dragged since it is
very fast.
The dragging code is in DRAG.C
The scrollling code is in SCROLL.C
December 6, 2017
Add comments