mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
John Spray's gtk scrolling patch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9002 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
32b506229b
commit
47aecd3178
@ -1,6 +1,11 @@
|
||||
2004-09-23 John Spray <spray_john@users.sourceforge.net>
|
||||
|
||||
* GWorkArea.[Ch]: Add GWorkArea::onScrollWheel to implement
|
||||
mouse-wheel scrolling of document
|
||||
|
||||
2004-07-24 Lars Gullik Bjonnes <larsbj@gullik.net>
|
||||
|
||||
* GPainter.C (text): sue boost::scoped_array to store the
|
||||
* GPainter.C (text): use boost::scoped_array to store the
|
||||
temporary wchar_t pointer
|
||||
|
||||
* lyx_gui.C: change "support/std_sstream.h" to <sstream>
|
||||
|
@ -174,6 +174,8 @@ GWorkArea::GWorkArea(LyXView & owner, int width, int height)
|
||||
workArea_.show();
|
||||
vscrollbar_.get_adjustment()->signal_value_changed().connect(
|
||||
SigC::slot(*this, &GWorkArea::onScroll));
|
||||
workArea_.signal_scroll_event().connect(
|
||||
SigC::slot(*this, &GWorkArea::onScrollWheel));
|
||||
vscrollbar_.show();
|
||||
hbox_.children().push_back(Gtk::Box_Helpers::Element(workArea_));
|
||||
hbox_.children().push_back(
|
||||
@ -340,6 +342,23 @@ void GWorkArea::onScroll()
|
||||
scrollDocView(static_cast<int>(val));
|
||||
}
|
||||
|
||||
bool GWorkArea::onScrollWheel(GdkEventScroll * event)
|
||||
{
|
||||
Gtk::Adjustment * adjustment = vscrollbar_.get_adjustment();
|
||||
|
||||
double step;
|
||||
if (event->state & GDK_CONTROL_MASK)
|
||||
step = adjustment->get_page_increment();
|
||||
else
|
||||
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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user