if (!mathcursor)
return UNDISPATCHED;
+ if (mathcursor->asHyperActiveInset()) {
+ lyxerr << " uurr.... getting dificult now\n";
+ return mathcursor->asHyperActiveInset()->localDispatch(bv, action, arg);
+ }
+
RESULT result = DISPATCHED;
bool sel = false;
bool was_macro = mathcursor->inMacroMode();
int xo() const { return xo_; }
///
int yo() const { return yo_; }
+ ///
+ BufferView * view() const { return view_; }
private:
/// unimplemented
void operator=(const InsetFormulaBase &);
}
+UpdatableInset * MathBoxInset::asHyperActiveInset() const
+{
+ return text_;
+}
+
+
void MathBoxInset::write(MathWriteInfo & os) const
{
os << "\\" << name_ << "{" << cell(0) << "}";
pain.rectangle(x, y - ascent(), xcell(0).width(), height(),
LColor::mathframe);
}
+
+
+void MathBoxInset::edit(BufferView * bv, int x, int y, unsigned int button)
+{
+ if (text_)
+ text_->edit(bv, x, y, button);
+}
#endif
class InsetText;
+class UpdatableInset;
class BufferView;
class Buffer;
class LyXFont;
MathBoxInset * asBoxInset() { return this; }
///
bool isHyperActive() const { return 1; }
+ ///
+ void edit(BufferView * bv, int x, int y, unsigned int button);
+ /// identifies hyperactive insets
+ UpdatableInset * asHyperActiveInset() const;
private:
/// unimplemented
#endif
+UpdatableInset * MathCursor::asHyperActiveInset() const
+{
+ return par()->asHyperActiveInset();
+}
+
+
bool MathCursor::isInside(MathInset const * p) const
{
for (unsigned i = 0; i < Cursor_.size(); ++i)
if (hasNextAtom() && openable(nextAtom(), sel)) {
if (nextAtom()->isHyperActive()) {
lyxerr << "entering hyperactive inset\n";
+ int x, y;
+ getPos(x, y);
+ nextAtom()->edit(formula()->view(), x, y, 0);
}
pushLeft(nextAtom());
return true;
/// Make sure cursor position is valid
void normalize() const;
+ ///
+ UpdatableInset * asHyperActiveInset() const;
/// enter a MathInset
void push(MathAtom & par);
class LaTeXFeatures;
class Buffer;
+class BufferView;
+class UpdatableInset;
struct MathWriteInfo {
virtual MathBoxInset * asBoxInset() { return 0; }
/// identifies macro templates
virtual MathMacroTemplate * asMacroTemplate() { return 0; }
+ /// identifies hyperactive insets
+ virtual UpdatableInset * asHyperActiveInset() const { return 0; }
/// identifies things that can get scripts
virtual bool isScriptable() const { return false; }
///
virtual void dump() const;
+ ///
+ virtual void edit(BufferView *, int, int, unsigned int) {}
///
virtual void validate(LaTeXFeatures & features) const;