Re: FXTreeList scrolling
[email protected] Mon, 21 Oct 2024 14:45:01 -0500
| Newsgroups | gmane.comp.lib.fox-toolkit.user |
|---|---|
| Message-ID | <[email protected]> |
On 2024-10-21 08:33, John Selverian wrote:
> I wound up making a TreeList_jhs1 class derived from FXTreeList
> class which only contains:
>
>
> FXMAPFUNC(SEL_MOUSEWHEEL,0,TreeList_jhs1::onCmdNotUsed)
>
> /****************************************************************
> ***************/
> long TreeList_jhs1::onCmdNotUsed(FXObject*, FXSelector, void*)
> {
> return 0;
> }
Yes, this would let the parent widget take a stab at handling the wheel
event.
Alternatively, you could pass along to the FXScrollBar; this is what
FXScrollArea does:
long FXScrollArea::onMouseWheel(FXObject* sender,FXSelector sel,void*
ptr){
if((options&VSCROLLING_OFF)!=VSCROLLING_OFF){
vertical->handle(sender,sel,ptr);
return 1;
}
if((options&HSCROLLING_OFF)!=HSCROLLING_OFF){
horizontal->handle(sender,sel,ptr);
return 1;
}
return 0;
}
Basically, it lets either the vertical or, as fallback, the horizontal
scrollbar deal with the wheel message.
Vertical scrolling is preferred unless vertical scroll was disabled, for
example if the window was horizontally oriented and side-to-side
scrolling
is the most common way to scroll.
Not handling the wheel message will have the same effect, if the parent
widget is FXScrollWindow.
-- JVZ