#include "gettext.h"
#include "lyxfont.h"
#include "BufferView.h"
-#include "Painter.h"
#include "lyxtext.h"
+#include "insets/insettext.h"
#include "support/LOstream.h"
+#include "debug.h"
using std::ostream;
using std::endl;
// (Lgb)
InsetMinipage::InsetMinipage()
- : InsetCollapsable()
+ : InsetCollapsable(), pos_(center),
+ inner_pos_(inner_center)
{
setLabel(_("minipage"));
LyXFont font(LyXFont::ALL_SANE);
}
-Inset * InsetMinipage::Clone() const
+Inset * InsetMinipage::Clone(Buffer const &) const
{
InsetMinipage * result = new InsetMinipage;
- result->init(this);
+ result->inset->init(inset);
result->collapsed = collapsed;
return result;
}
-char const * InsetMinipage::EditMessage() const
+string const InsetMinipage::EditMessage() const
{
return _("Opened Minipage Inset");
}
{
os << "\\begin{minipage}{\\columnwidth}%\n";
- int i = InsetText::Latex(buf, os, fragile, fp);
+ int i = inset->Latex(buf, os, fragile, fp);
os << "\\end{minipage}%\n";
return i + 2;
}
-bool InsetMinipage::InsertInset(BufferView * bv, Inset * inset)
+bool InsetMinipage::InsertInsetAllowed(Inset * in) const
{
- if (!InsertInsetAllowed(inset))
+ if ((in->LyxCode() == Inset::FLOAT_CODE) ||
+ (in->LyxCode() == Inset::MARGIN_CODE)) {
return false;
-
- return InsetText::InsertInset(bv, inset);
+ }
+ return true;
}
-bool InsetMinipage::InsertInsetAllowed(Inset * inset) const
+InsetMinipage::Position InsetMinipage::pos() const
{
- if ((inset->LyxCode() == Inset::FLOAT_CODE) ||
- (inset->LyxCode() == Inset::MARGIN_CODE)) {
- return false;
- }
- return true;
+ return pos_;
+}
+
+
+void InsetMinipage::pos(InsetMinipage::Position p)
+{
+ pos_ = p;
+}
+
+
+InsetMinipage::InnerPosition InsetMinipage::innerPos() const
+{
+ return inner_pos_;
+}
+
+
+void InsetMinipage::innerPos(InsetMinipage::InnerPosition ip)
+{
+ inner_pos_ = ip;
+}
+
+
+LyXLength const & InsetMinipage::height() const
+{
+ return height_;
+}
+
+
+void InsetMinipage::height(LyXLength const & ll)
+{
+ height_ = ll;
+}
+
+
+LyXLength const & InsetMinipage::width() const
+{
+ return width_;
}
-LyXFont InsetMinipage::GetDrawFont(BufferView * bv,
- LyXParagraph * p, int pos) const
+void InsetMinipage::width(LyXLength const & ll)
{
- LyXFont fn = getLyXText(bv)->GetFont(bv->buffer(), p, pos);
- fn.decSize().decSize();
- return fn;
+ width_ = ll;
}