![]() |
Introduction to PM ProgrammingWritten by Larry Salomon, Jr. |
IntroductionThe purpose of this column is to provide the readers out there who are not familiar with PM application development the information necessary to satisfy their curiosity, educate themselves, and give them an advantage over the documentation supplied by IBM. Of course, much of this stuff could probably be found in one of the many books out there, but the problem with books in general is that they don't answer the questions you have after you read the book the first time through. I will gladly entertain feedback from the readers about what was "glossed
over" or what was detailed well, what tangential topics need to be covered
and what superfluous crap should have been removed. This feedback is
essential in guaranteeing that you get what you pay for. It should be said that you must not depend solely on this column to teach
you how to develop PM applications; instead, this should be viewed as a
supplement to your other information storehouses (books, the network
conferences, etc.). Because this column must take a general approach,
there will be some topics that you would like to see discussed that really
do not belong here. Specific questions can be directed to me via email and
I will do my best to answer them in a timely fashion.
As I sat down to write this month's installment, I had to look back to see
where we've been. The window classes that we've covered here so far are
listed below:
The window classes left to be covered are listed below:
As I looked, I decided that we could hit three birds with one stone if we
ventured into the realm of the circular slider, slider, and scrollbar,
since all three controls are very similar in function.
What is the purpose of each of these three controls? To sum it up in one
sentence, their purpose is to allow the user to choose a single value
within a range of values. Since Salomon's Law states that the complexity
of a window class is exponentially proportional to the number of words in
which you can state its purpose, you can imagine that we won't need to
spend much time on these controls.
If you breakdown the capabilities of the controls, you will see that all
three provide the following:
We will look at the details specific to each control in this column
starting with the scroll bar (WC_SCROLLBAR).
The parts of a scroll bar are labelled in the illustration below.
The buttons are used to change the position by one increment (see below).
The slider areas are used to change the position by one page.
The thumb is used to move the scroll bar to an absolute position.
The concept of a unit or a page of units is defined by the application.
One unit may correspond to one line of text, but it may correspond to three
lines of text.
The scroll bar styles are listed below.
The scroll bar is unlike the other PM controls in that its notifications
are not communicated via the WM_CONTROL message. Instead, depending on the
orientation of the scroll bar (horizontal or vertical), the owner receives
a WM_HSCROLL or WM_VSCROLL message.
WM_HSCROLL / WM_VSCROLL
There are five, easy to understand messages that the scroll bar
understands:
Next month we will take a look at a small application that uses both the
horizontal and vertical scroll bars to allow you to scroll through a
"large" amount of data. Bring your thinking caps!
|