Angus Leeming wrote:
> Attached are the changes in my 1.3.x tree.
--
Angus? boost_changes.diff
? branches.diff
? build-qt
? build-xforms
? colors.diff
? insetgraphics.diff
? lib_images.diff
? paragraph.diff
? qt_scroll.diff
? relyx-accents.diff
? relyx-minipage-test.tex
? relyx-minipage.diff
? striplog.sed
? tmp.diff
? xpm.diff.bz2
? xpm_cleanup.sh
? development/lyxserver/server_monitor
? development/lyxserver/tmpfile
? lib/configure.diff
Index: src/text3.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
retrieving revision 1.29.2.2
diff -u -p -r1.29.2.2 text3.C
--- src/text3.C 13 Jun 2003 16:15:11 - 1.29.2.2
+++ src/text3.C 28 Dec 2003 15:15:41 -
@@ -1096,7 +1096,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ
break;
case LFUN_GETLAYOUT:
- cmd.message(tostr(cursor.par()->layout()));
+ cmd.message(cursor.par()->layout()->name());
break;
case LFUN_LAYOUT: {
Index: src/frontends/qt2/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/ChangeLog,v
retrieving revision 1.389.2.41
diff -u -p -r1.389.2.41 ChangeLog
--- src/frontends/qt2/ChangeLog 9 Dec 2003 14:15:22 - 1.389.2.41
+++ src/frontends/qt2/ChangeLog 28 Dec 2003 15:15:45 -
@@ -16,6 +16,17 @@
* QDocument.C: use geometry on custom, A3, B3 and B4
papersizes.
+2003-12-01 Angus Leeming <[EMAIL PROTECTED]>
+
+* QContentPane.[Ch] (SyntheticMouseEvent): a new, helper struct.
+(QContentPane): store an instance of SyntheticMouseEvent and
+add a slot, generateSyntheticMouseEvent, that is invoked by the
+SyntheticMouseEvent::timeout.
+(mouseMoveEvent): initialize synthetic_mouse_event_ when the
+mouse button is depressed and the cursor is outside of the work area.
+(generateSyntheticMouseEvent): if the scrollbar value is different
+from the cached value, then dispatch a 'synthetic' mouse event.
+
2003-11-14 Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
* ui/QMathDialogBase.ui: remove mention of \frac in tooltip, since
Index: src/frontends/qt2/QContentPane.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QContentPane.C,v
retrieving revision 1.18
diff -u -p -r1.18 QContentPane.C
--- src/frontends/qt2/QContentPane.C 17 Dec 2002 20:37:10 - 1.18
+++ src/frontends/qt2/QContentPane.C 28 Dec 2003 15:15:45 -
@@ -16,9 +16,10 @@
#include "debug.h"
+#include
+
#include "QWorkArea.h"
#include "QLyXKeySym.h"
-#include "funcrequest.h"
#include "qt_helpers.h"
#include
@@ -82,10 +83,20 @@ mouse_button::state q_motion_state(Qt::B
} // namespace anon
+SyntheticMouseEvent::SyntheticMouseEvent()
+ : timeout(200), restart_timeout(true),
+ x_old(-1), y_old(-1), scrollbar_value_old(-1.0)
+{}
+
+
QContentPane::QContentPane(QWorkArea * parent)
: QWidget(parent, "content_pane", WRepaintNoErase),
wa_(parent)
{
+ synthetic_mouse_event_.timeout.timeout.connect(
+ boost::bind(&QContentPane::generateSyntheticMouseEvent,
+ this));
+
setFocusPolicy(QWidget::WheelFocus);
setFocus();
setCursor(ibeamCursor);
@@ -103,6 +114,25 @@ void QContentPane::scrollBarChanged(int
}
+void QContentPane::generateSyntheticMouseEvent()
+{
+ // Set things off to generate the _next_ 'pseudo' event.
+ if (synthetic_mouse_event_.restart_timeout)
+ synthetic_mouse_event_.timeout.start();
+
+ // Has anything changed on-screen since the last timeout signal
+ // was received?
+ double const scrollbar_value = wa_->scrollbar_->value();
+ if (scrollbar_value != synthetic_mouse_event_.scrollbar_value_old) {
+ // Yes it has. Store the params used to check this.
+ synthetic_mouse_event_.scrollbar_value_old = scrollbar_value;
+
+ // ... and dispatch the event to the LyX core.
+ wa_->dispatch(synthetic_mouse_event_.cmd);
+ }
+ }
+
+
void QContentPane::mousePressEvent(QMouseEvent * e)
{
if (dc_event_.active && dc_event_ == *e) {
@@ -122,6 +152,9 @@ void QContentPane::mousePressEvent(QMous
void QContentPane::mouseReleaseEvent(QMouseEvent * e)
{
+ if (synthetic_mouse_event_.timeout.running())
+ synthetic_mouse_event_.timeout.stop();
+
FuncRequest cmd(LFUN_MOUSE_RELEASE, e->x(), e->y(),
q_button_state(e->button()));
wa_->dispatch(cmd);
@@ -130,9 +163,55 @@ void QContentPane::mouseReleaseEvent(QMo
void QContentPane::mouseMoveEvent(QMouseEvent * e)
{
- FuncRequest cmd
- (LFUN_MOUSE_MOTION, e->x(), e->y(), q_motion_state(e->state()));
- wa_->dispatch(cmd);
+ FuncRequest const cmd(LFUN_MOUSE_MOTION, e->x(), e->y(),
+ q_motion_state(e->state()));
+
+ // If we're above or below the work area...
+ if (e->y() <= 0 || e->y() >= height()) {
+ // Store the event, to be handled when the timeout expires.
+ synthetic_mouse_event_.cmd = cmd;
+
+ if (synthetic_mouse_event_.timeout.running()) {
+ // Discard the eve