home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
status.zip
/
README
next >
Wrap
Text File
|
1995-04-20
|
3KB
|
101 lines
ABSTRACT
========
A status line window is created to whom messages can be sent during
program execution with
WinSetWindowText(hwndStatus,(PSZ)pszWhatever);
OR
WinSendMsg(
hwndStatus,
WM_USER_SETTEXT,
MPFROMP(pszWhatever),
0L);
Presentation parameters of this window can be changed with a fairly
nice set of WM_USER_SETVAL messages, either under program control
or through a dialog accessible with a right button click on the status
line.
SOFTWARE/PLATFORM
=================
a. Gpf 2.1, level A2
b. OS/2 2.11, VGA
c. IBM CPP v2.01 (straight C, not in C++ mode)
d. TOOLKT21
FILES
=====
status.orc
status.h
ufstat.c
ufstat.mak
readme
SOME DISCUSSION
===============
This sample creates a child window belonging to the frame (as
opposed to most Gpf controls, which belong to the client). Physically
it occupies (creates) a space between the client area and the bottom-most
frame entity. The client area gives up an appropriate amount of
vertical room. Of course it could just have easily been placed at the
bottom of the client area, with simple modifications in the frame's
WM_FORMATFRAME message.
The Status Line Window (STATWIN) is unknown to Gpf, and is created
on-the-fly during the 'Main' window's WM_CREATE. At his time, when
nothing is visible yet, the frame procedure is sub-classed and the
two messages of interest are modified. Note that this window keeps
a local structure in the "window words", so technically speaking you
can make several of these if you want to (how? this is left as an
excercise for the reader). Since Gpf is ignorant of this beast one
must write a WindowProcedure for it.
This WinProc could have been very simple, handling only
WM_PAINT
WM_SETWINDOWPARAMS /* in order to react to WinSetWindowText() */
But many functions were added which give the user better control of
how things are displayed. Two of these are not standard:
WM_USER_SETTEXT
WM_USER_SETVAL
but
WM_CONTEXTMENU
certainly is, though WM_BUTTONxCLICK could have been used instead.
All of them contain what I think is simple code and I hope you agree.
In fact the main complexity of this sample is in the initialization
and handling of the 'StatParms' window, all of which can be scrapped
if you want to 'hard wire' the display to a fixed presentation.
SUPPORT
=======
None. You are on your own. Enjoy.
POSSIBLE ENHANCEMENTS
=====================
1. [currently hard wired to VGA. The default vertical height
really ought to be computed as a function of the default font. This
is fairly trivial.] DONE! 04.20.95 A
2. enable the 'Font..' button. Eventually I'll do it, if you want to
wait. The window's height may need to be re-sized dynamically as a
function of the new font height.
3. create a ticker-tape effect (bidirectional scrolling)
4. convert this to a User Control (non-trivial)
5. re-write the code so as not to use a global handle (hwndStatus).
HINT: it is definitely a child of the frame, not the client.
6. [add a WM_USER_SETVAL to position the status line BELOW the client
area. Do you think this will have any effect on controls within the
client area?] DONE! 04.20.95 B
7. [resize the vertical dimension dynamically as the shadow size is
changed (cuurently the shadow can impinge on the text.)] DONE! 04.20.95 A
OTHER
=====
If you like it, it was created by Al Charov; if you don't, it was
created by someone else.
Al Charov
Tax Day, 1995
MODS
04.20.95