OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Specializing Scroll Bar Behavior

You might want a scroll bar object respond to its own notification messages.

TDialog has built-in support for dispatching scroll bar notification messages back to the scroll bar.

TWindow::EvHScroll or TWindow::EvVScroll executes the appropriate TScrollBar member function based on the notification code. For example:

class TSpecializedScrollBar : public TScrollBar {
public:
virtual void SBTop();
};
void TSpecializedScrollBar::SBTop() {
TScrollBar::SBTop();
::sndPlaySound("AT-TOP.WAV", SND_ASYNC); // play sound
}

Be sure to call the base member functions first. They correctly update the scroll bar to its new position.

The following table associates notification messages with the corresponding TScrollBar member function:

Notification messageTScrollBar member function
SB_LINEUPTScrollBar::SBLineUp
SB_LINEDOWNTScrollBar::SBLineDown
SB_PAGEUPTScrollBar::SBPageUp
SB_PAGEDOWNTScrollBar::SBPageDown
SB_THUMBPOSITIONTScrollBar::SBThumbPosition
SB_THUMBTRACKTScrollBar::SBThumbTrack
SB_TOPTScrollBar::SBTop
SB_BOTTOMTScrollBar::SBBottom

See Also