return NOT_EDITABLE;
}
+bool Inset::IsTextInset() const
+{
+ return ((LyxCode() == TEXT_CODE) ||
+ (LyxCode() == ERT_CODE) ||
+ (LyxCode() == FOOT_CODE) ||
+ (LyxCode() == MARGIN_CODE));
+}
void Inset::Validate(LaTeXFeatures &) const
{
}
+char const * Inset::EditMessage() const
+{
+ return _("Opened inset");
+}
+
/* some stuff for inset locking */
void UpdatableInset::InsetButtonPress(BufferView *, int x, int y, int button)
{
}
+void UpdatableInset::ShowInsetCursor(BufferView *)
+{
+}
+
+void UpdatableInset::HideInsetCursor(BufferView *)
+{
+}
+
void UpdatableInset::Edit(BufferView * bv, int, int, unsigned int)
{
scx = 0;
- mx_scx = abs((width(bv->getPainter(), font) - bv->paperWidth()) / 2);
+ mx_scx = abs((width(bv->painter(), font) - bv->paperWidth()) / 2);
}
void UpdatableInset::draw(Painter &, LyXFont const &,
- int baseline, float & x) const
+ int /* baseline */, float & x) const
{
if (scx) x += float(scx);
- top_x = int(x);
- top_baseline = baseline;
+// ATTENTION: this is not good doing here
+// top_x = int(x);
+// top_baseline = baseline;
}
return UNDISPATCHED;
}
-int UpdatableInset::getMaxWidth(Painter & pain) const
+int UpdatableInset::getMaxWidth(Painter & pain, UpdatableInset const *inset) const
{
- if (owner_)
- return owner_->getMaxWidth(pain);
+ if (owner())
+ return static_cast<UpdatableInset*>(owner())->getMaxWidth(pain, inset);
return pain.paperWidth();
}
-