+2001-03-14 Lars Gullik Bjønnes <larsbj@trylle.birdstep.com>
+
+ * insetminipage.h: add pos, inner_pos, width and height. + getters
+ and setters for all of them.
+
2001-03-13 Dekel Tsur <dekelts@tau.ac.il>
* insetinclude.C (Latex): Do not exit when the textclass of the
*
* LyX, The Document Processor
*
- * Copyright (C) 1998 The LyX Team.
+ * Copyright 1998-2001 The LyX Team.
*
* ======================================================
*/
using std::max;
InsetCollapsable::InsetCollapsable()
- : UpdatableInset()
+ : UpdatableInset(), inset(new InsetText)
{
- inset = new InsetText;
+ //inset = new InsetText;
inset->setOwner(this);
collapsed = true;
label = "Label";
{
if (lex.IsOK()) {
lex.next();
- string token = lex.GetString();
+ string const token = lex.GetString();
if (token == "collapsed") {
lex.next();
collapsed = lex.GetBool();
} else if (!collapsed) {
if (!bv->lockInset(this))
return;
- inset->Edit(bv, x-widthCollapsed, y, button);
+ inset->Edit(bv, x - widthCollapsed, y, button);
}
}
void InsetCollapsable::InsetButtonPress(BufferView * bv,int x,int y,int button)
{
if (!collapsed && (x >= button_length)) {
- inset->InsetButtonPress(bv, x-widthCollapsed, y, button);
+ inset->InsetButtonPress(bv, x - widthCollapsed, y, button);
}
}
bv->updateInset(this, false);
}
} else if (!collapsed && (x >= button_length) && (y >= button_top_y)) {
- inset->InsetButtonRelease(bv, x-widthCollapsed, y, button);
+ inset->InsetButtonRelease(bv, x - widthCollapsed, y, button);
}
}
: view(0)
{
tempname = lyx::tempName(string(), "lyxext");
- ExternalTemplateManager::Templates::const_iterator i1;
+ //ExternalTemplateManager::Templates::const_iterator i1;
params_.templ = ExternalTemplateManager::get().getTemplates().begin()->second;
}
// (Lgb)
InsetMinipage::InsetMinipage()
- : InsetCollapsable()
+ : InsetCollapsable(), pos_(center),
+ inner_pos_(inner_center)
{
setLabel(_("minipage"));
LyXFont font(LyXFont::ALL_SANE);
}
return true;
}
+
+
+InsetMinipage::Position InsetMinipage::pos() const
+{
+ 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_;
+}
+
+
+void InsetMinipage::width(LyXLength const & ll)
+{
+ width_ = ll;
+}
#endif
#include "insetcollapsable.h"
+#include "vspace.h"
/** The minipage inset
*/
class InsetMinipage : public InsetCollapsable {
public:
+ ///
+ enum Position {
+ center,
+ top,
+ bottom
+ };
+ ///
+ enum InnerPosition {
+ inner_center,
+ inner_top,
+ inner_bottom,
+ inner_stretch
+ };
///
InsetMinipage();
///
string const EditMessage() const;
///
bool InsertInsetAllowed(Inset * inset) const;
+ ///
+ Position pos() const;
+ ///
+ void pos(Position);
+ ///
+ InnerPosition innerPos() const;
+ ///
+ void innerPos(InnerPosition);
+ ///
+ LyXLength const & height() const;
+ ///
+ void height(LyXLength const &);
+ ///
+ LyXLength const & width() const;
+ ///
+ void width(LyXLength const &);
+private:
+ ///
+ Position pos_;
+ ///
+ InnerPosition inner_pos_;
+ ///
+ LyXLength height_;
+ ///
+ LyXLength width_;
};
#endif