|
From: Jeroen v. d. Z. <jv...@cf...> - 2001-12-11 21:25:45
|
On Tuesday 11 December 2001 15:00, you wrote: > jeroen wrote: > > .... > > If we were selecting, call startAutoScroll(). This tests if we're close > > to the edge. If startAutoScroll() returns TRUE then simply return. > > Otherwise, we're not close to the edge and you should process the mouse > > coords to select the appropriate audio samples. > > > > long onAutoScroll(FXObject*,FXSelector,void*); > > > > This handler is a kind-of mouse moved message issued while the mouse is > > more-or-less standing still near an edge. The implementation should call > > FXScrollArea::onAutoScroll() then perform similar code as in onMotion() > > to select audio samples. > > Hi, thanx for the quick reply last night. The information has been most > helpful. However, I have a question about autoscrolling, then even > handlers in general. > > I'm trying to implement auto scrolling. I did what you said about > calling startAutoScroll in my mouse move event handler.. if startAutoScroll > returns TRUE then I just return then expecting that onAutoScroll is about > to be invoked which will do the work that would have been done in the > remaining login in onMotion... However, I noticed that > FXScrollArea::onAutoScroll was not virtual (nor defined virtual in any base > class that I could tell) so I couldn't just simply override > FXScrollArea::onAutoScroll to get the event... So I added an event handler > for [SEL_TIMEOUT, FXWindow::ID_AUTOSCROLL, FXWaveView::onAutoScroll] in my > function map... Then I remember that you said to call > FXScrollArea::onAutoScroll in my handler (which initialially sounded like I > should override it)... So adding an event handler *REPLACES* the current > one? Why not just make all the handlers in the base class virtual so I > could just override them? (BeOS's C++ API sort of works this way if I > remember)... It amounts to the same thing. Keep in mind however that often, messages are sent to objects which may or may not have handlers for them, and thus the message-based approach is more flexible. Catching the message and then calling the base class in your own handler is what is recommended here. You can always "overload" handlers by basically adding the appropriate message ID and handler in your own class. This has the advantage of not creating a WHOPPING vtable, just on the off-chance that someone MAY want to overload it. - Jeroen -- +-------------------------------+--------------------------------------------+ | E-Mail : jv...@cf... | The FOX Platform Independent GUI Toolkit: | | USMail : 215 Wynn Drive, | | | Huntsville, AL 35805 | Official Site: | | Phone : (256) 726-4820 | http://www.fox-toolkit.org | | Fax : (256) 726-4806 | ftp://ftp.fox-toolkit.org/pub | | WWW : http://www.cfdrc.com | | +-------------------------------+--------------------------------------------+ | Copyright (C) 15:10 10/10/2001 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ |