#pragma implementation "lyxinset.h"
#endif
-#define SCROLL_INSET
-
#include "lyxinset.h"
#include "debug.h"
#include "BufferView.h"
#include "support/lstrings.h"
#include "Painter.h"
-#ifdef SCROLL_INSET
#include "commandtags.h"
#include "support/lstrings.h"
-#endif
using std::endl;
}
-LyXText * Inset::getLyXText(BufferView * bv) const
+LyXText * Inset::getLyXText(BufferView const * bv, bool const) const
{
if (owner())
- return owner()->getLyXText(bv);
+ return owner()->getLyXText(bv, false);
else
return bv->text;
}
}
-#ifdef SCROLL_INSET
void UpdatableInset::scroll(BufferView * bv, float s) const
{
LyXFont font;
+ if (!s) {
+ scx = 0;
+ return;
+ }
if (((top_x - scx) > 0) &&
(top_x - scx + width(bv, font)) < bv->workWidth())
return;
void UpdatableInset::scroll(BufferView * bv, int offset) const
{
if (offset > 0) {
- if (!scx && top_x > 0)
+ if (!scx && top_x >= 20)
return;
if ((top_x + offset) > 20)
- scx += offset - (top_x - scx + offset - 20);
+ scx = 0;
+// scx += offset - (top_x - scx + offset - 20);
else
scx += offset;
} else {
// bv->updateInset(const_cast<UpdatableInset *>(this), false);
}
-
-#endif
-
/// An updatable inset could handle lyx editing commands
-#ifdef SCROLL_INSET
UpdatableInset::RESULT
UpdatableInset::LocalDispatch(BufferView * bv,
- int action, string const & arg)
-#else
-UpdatableInset::RESULT
-UpdatableInset::LocalDispatch(BufferView *, int, string const &)
-#endif
+ kb_action action, string const & arg)
{
-#ifdef SCROLL_INSET
-
if (!arg.empty() && (action==LFUN_SCROLL_INSET)) {
if (arg.find('.') != arg.npos) {
float xx = static_cast<float>(strToDbl(arg));
return DISPATCHED;
}
-#endif
return UNDISPATCHED;
}