John Spray <[EMAIL PROTECTED]> writes: | On Thu, 2004-09-23 at 17:37, Lars Gullik Bjønnes wrote: >> You should probably read the >> Development/lyx-devel/development/Code_rules/Rules document. > | In my haste I only skimmed that before: I've read it properly now. | Thanks for your advice Lars & Alfredo. Revised patch attached (now | including changelog entry as well as strategically placed spaces).
:-) I have one more nit though... sorry about that. | +bool GWorkArea::onScrollWheel(GdkEventScroll * event) | +{ | + double step; move this down | + Gtk::Adjustment * adjustment = vscrollbar_.get_adjustment(); | + step = adjustment->get_step_increment(); to here so that you get: double step = adjustment->get_step_increment(); | + | + if (event->direction == GDK_SCROLL_UP) | + step *= -1.0f; | + | + adjustment->set_value(adjustment->get_value() + step); | + | + return true; | +} | | bool GWorkArea::onButtonPress(GdkEventButton * event) | { | Index: GWorkArea.h | =================================================================== | RCS file: /cvs/lyx/lyx-devel/src/frontends/gtk/GWorkArea.h,v | retrieving revision 1.9 | diff -u -3 -p -u -p -r1.9 GWorkArea.h | --- GWorkArea.h 2004/05/19 15:11:32 1.9 | +++ GWorkArea.h 2004/09/23 17:03:01 | @@ -93,6 +93,7 @@ private: | bool onExpose(GdkEventExpose * event); | bool onConfigure(GdkEventConfigure * event); | void onScroll(); | + bool onScrollWheel(GdkEventScroll * event); | bool onButtonPress(GdkEventButton * event); | bool onButtonRelease(GdkEventButton * event); | bool onMotionNotify(GdkEventMotion * event); | Index: ChangeLog | =================================================================== | RCS file: /cvs/lyx/lyx-devel/src/frontends/gtk/ChangeLog,v | retrieving revision 1.52 | diff -u -3 -p -u -p -r1.52 ChangeLog | --- ChangeLog 2004/07/24 16:40:21 1.52 | +++ ChangeLog 2004/09/23 17:03:01 | @@ -1,3 +1,8 @@ | +2004-09-23 John Spray <[EMAIL PROTECTED]> | + | + * GWorkArea.[Ch]: Add GWorkArea::onScrollWheel to implement | + mouse-wheel scrolling of document | + | 2004-07-24 Lars Gullik Bjonnes <[EMAIL PROTECTED]> | | * GPainter.C (text): sue boost::scoped_array to store the ^^^^^ spelling ... OOOPS that was my own typo... but fell free to fix it ;-) -- Lgb