window.c
changeset 2021 3be628c59488
parent 1980 9ea0c89fbb58
child 2026 02dfa0aa2c2f
equal deleted inserted replaced
2020:392890f32338 2021:3be628c59488
    96 	e.click.pt.x = x;
    96 	e.click.pt.x = x;
    97 	e.click.pt.y = y;
    97 	e.click.pt.y = y;
    98 	w->wndproc(w, &e);
    98 	w->wndproc(w, &e);
    99 }
    99 }
   100 
   100 
   101 
   101 /** Dispatch the mousewheel-action to the window which will scroll any
   102 void DispatchMouseWheelEvent(Window *w, uint widget, int wheel)
   102  * compatible scrollbars if the mouse is pointed over the bar or its contents
   103 {
   103  * @param *w Window
   104 	const Widget *wi1 = &w->widget[widget];
   104  * @param widget the widget where the scrollwheel was used
   105 	const Widget *wi2 = &w->widget[widget + 1];
   105  * @param wheel scroll up or down
       
   106  */
       
   107 void DispatchMouseWheelEvent(Window *w, int widget, int wheel)
       
   108 {
       
   109 	const Widget *wi1, *wi2;
   106 	Scrollbar *sb;
   110 	Scrollbar *sb;
       
   111 
       
   112 	if (widget < 0) return;
       
   113 
       
   114 	wi1 = &w->widget[widget];
       
   115 	wi2 = &w->widget[widget + 1];
   107 
   116 
   108 	/* The listbox can only scroll if scrolling was done on the scrollbar itself,
   117 	/* The listbox can only scroll if scrolling was done on the scrollbar itself,
   109 	 * or on the listbox (and the next item is (must be) the scrollbar)
   118 	 * or on the listbox (and the next item is (must be) the scrollbar)
   110 	 * XXX - should be rewritten as a widget-dependent scroller but that's
   119 	 * XXX - should be rewritten as a widget-dependent scroller but that's
   111 	 * not happening until someone rewrites the whole widget-code */
   120 	 * not happening until someone rewrites the whole widget-code */