Fix redraw problems in qt3 and gtk

* src/frontends/gtk/GWorkArea.C
	(GWorkArea::onScroll): redraw the workarea
	(GWorkArea::onButtonPress): Call WorkArea::dispatch instead of
	BufferView::workAreaDispatch in order to redraw the workarea
	(GWorkArea::onButtonRelease): ditto
	(GWorkArea::onMotionNotify): ditto

	* src/frontends/WorkArea.h
	(dispatch): make public

	* src/frontends/qt3/QContentPane.C
	(QContentPane::scrollBarChanged): redraw the workarea
	(QContentPane::generateSyntheticMous): Call WorkArea::dispatch instead
	of BufferView::workAreaDispatch in order to redraw the workarea
	(QContentPane::mousePressEvent): ditto
	(QContentPane::mouseReleaseEvent): ditto
	(QContentPane::mouseMoveEvent): ditto
	(QContentPane::doubleClickTimeout): ditto


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14517 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2006-07-30 14:57:01 +00:00
parent 104a09f014
commit e6e554d68c
3 changed files with 16 additions and 11 deletions

View File

@ -105,9 +105,11 @@ protected:
/// cause the display of the given area of the work area /// cause the display of the given area of the work area
virtual void expose(int x, int y, int w, int h) = 0; virtual void expose(int x, int y, int w, int h) = 0;
/// public:
/// FIXME: This is public because of qt3 and gtk, should be protected
void dispatch(FuncRequest const & cmd0); void dispatch(FuncRequest const & cmd0);
protected:
/// ///
void resizeBufferView(); void resizeBufferView();

View File

@ -377,6 +377,7 @@ void GWorkArea::onScroll()
double val = vscrollbar_.get_adjustment()->get_value(); double val = vscrollbar_.get_adjustment()->get_value();
view_.view()->scrollDocView(static_cast<int>(val)); view_.view()->scrollDocView(static_cast<int>(val));
view_.workArea()->redraw();
adjusting_ = false; adjusting_ = false;
} }
@ -422,7 +423,7 @@ bool GWorkArea::onButtonPress(GdkEventButton * event)
default: default:
break; break;
} }
view_.view()->workAreaDispatch(FuncRequest(ka, view_.workArea()->dispatch(FuncRequest(ka,
static_cast<int>(event->x), static_cast<int>(event->x),
static_cast<int>(event->y), static_cast<int>(event->y),
gButtonToLyx(event->button))); gButtonToLyx(event->button)));
@ -433,7 +434,7 @@ bool GWorkArea::onButtonPress(GdkEventButton * event)
bool GWorkArea::onButtonRelease(GdkEventButton * event) bool GWorkArea::onButtonRelease(GdkEventButton * event)
{ {
view_.view()->workAreaDispatch(FuncRequest(LFUN_MOUSE_RELEASE, view_.workArea()->dispatch(FuncRequest(LFUN_MOUSE_RELEASE,
static_cast<int>(event->x), static_cast<int>(event->x),
static_cast<int>(event->y), static_cast<int>(event->y),
gButtonToLyx(event->button))); gButtonToLyx(event->button)));
@ -458,7 +459,7 @@ bool GWorkArea::onMotionNotify(GdkEventMotion * event)
} }
timeBefore = event->time; timeBefore = event->time;
} }
view_.view()->workAreaDispatch(FuncRequest(LFUN_MOUSE_MOTION, view_.workArea()->dispatch(FuncRequest(LFUN_MOUSE_MOTION,
static_cast<int>(event->x), static_cast<int>(event->x),
static_cast<int>(event->y), static_cast<int>(event->y),
gtkButtonState(event->state))); gtkButtonState(event->state)));

View File

@ -162,15 +162,17 @@ void QContentPane::generateSyntheticMouseEvent()
synthetic_mouse_event_.scrollbar_value_old = scrollbar_value; synthetic_mouse_event_.scrollbar_value_old = scrollbar_value;
// ... and dispatch the event to the LyX core. // ... and dispatch the event to the LyX core.
wa_->view().view()->workAreaDispatch(synthetic_mouse_event_.cmd); wa_->view().workArea()->dispatch(synthetic_mouse_event_.cmd);
} }
} }
void QContentPane::scrollBarChanged(int val) void QContentPane::scrollBarChanged(int val)
{ {
if (track_scrollbar_) if (track_scrollbar_) {
wa_->view().view()->scrollDocView(val); wa_->view().view()->scrollDocView(val);
wa_->view().workArea()->redraw();
}
} }
@ -181,13 +183,13 @@ void QContentPane::mousePressEvent(QMouseEvent * e)
FuncRequest cmd(LFUN_MOUSE_TRIPLE, FuncRequest cmd(LFUN_MOUSE_TRIPLE,
dc_event_.x, dc_event_.y, dc_event_.x, dc_event_.y,
q_button_state(dc_event_.state)); q_button_state(dc_event_.state));
wa_->view().view()->workAreaDispatch(cmd); wa_->view().workArea()->dispatch(cmd);
return; return;
} }
FuncRequest const cmd(LFUN_MOUSE_PRESS, e->x(), e->y(), FuncRequest const cmd(LFUN_MOUSE_PRESS, e->x(), e->y(),
q_button_state(e->button())); q_button_state(e->button()));
wa_->view().view()->workAreaDispatch(cmd); wa_->view().workArea()->dispatch(cmd);
} }
@ -198,7 +200,7 @@ void QContentPane::mouseReleaseEvent(QMouseEvent * e)
FuncRequest const cmd(LFUN_MOUSE_RELEASE, e->x(), e->y(), FuncRequest const cmd(LFUN_MOUSE_RELEASE, e->x(), e->y(),
q_button_state(e->button())); q_button_state(e->button()));
wa_->view().view()->workAreaDispatch(cmd); wa_->view().workArea()->dispatch(cmd);
} }
@ -258,7 +260,7 @@ void QContentPane::mouseMoveEvent(QMouseEvent * e)
synthetic_mouse_event_.scrollbar_value_old = scrollbar_value; synthetic_mouse_event_.scrollbar_value_old = scrollbar_value;
// ... and dispatch the event to the LyX core. // ... and dispatch the event to the LyX core.
wa_->view().view()->workAreaDispatch(cmd); wa_->view().workArea()->dispatch(cmd);
} }
} }
@ -317,7 +319,7 @@ void QContentPane::doubleClickTimeout()
FuncRequest cmd(LFUN_MOUSE_DOUBLE, FuncRequest cmd(LFUN_MOUSE_DOUBLE,
dc_event_.x, dc_event_.y, dc_event_.x, dc_event_.y,
q_button_state(dc_event_.state)); q_button_state(dc_event_.state));
wa_->view().view()->workAreaDispatch(cmd); wa_->view().workArea()->dispatch(cmd);
} }