From: Lars Gullik Bjønnes Date: Wed, 14 Mar 2001 14:53:55 +0000 (+0000) Subject: updates to minipage inset X-Git-Tag: 1.6.10~21467 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a097c6236f0e56d6748b4522a64a30972c02d22d;p=features.git updates to minipage inset git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1756 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 0d4f6b62c4..9003a4f028 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2001-03-14 Lars Gullik Bjønnes + + * insetminipage.h: add pos, inner_pos, width and height. + getters + and setters for all of them. + 2001-03-13 Dekel Tsur * insetinclude.C (Latex): Do not exit when the textclass of the diff --git a/src/insets/insetcollapsable.C b/src/insets/insetcollapsable.C index e7cfe8b373..ea7757dc01 100644 --- a/src/insets/insetcollapsable.C +++ b/src/insets/insetcollapsable.C @@ -3,7 +3,7 @@ * * LyX, The Document Processor * - * Copyright (C) 1998 The LyX Team. + * Copyright 1998-2001 The LyX Team. * * ====================================================== */ @@ -32,9 +32,9 @@ using std::endl; using std::max; InsetCollapsable::InsetCollapsable() - : UpdatableInset() + : UpdatableInset(), inset(new InsetText) { - inset = new InsetText; + //inset = new InsetText; inset->setOwner(this); collapsed = true; label = "Label"; @@ -84,7 +84,7 @@ void InsetCollapsable::Read(Buffer const * buf, LyXLex & lex) { if (lex.IsOK()) { lex.next(); - string token = lex.GetString(); + string const token = lex.GetString(); if (token == "collapsed") { lex.next(); collapsed = lex.GetBool(); @@ -222,7 +222,7 @@ void InsetCollapsable::Edit(BufferView * bv, int x, int y, unsigned int button) } else if (!collapsed) { if (!bv->lockInset(this)) return; - inset->Edit(bv, x-widthCollapsed, y, button); + inset->Edit(bv, x - widthCollapsed, y, button); } } @@ -248,7 +248,7 @@ void InsetCollapsable::InsetUnlock(BufferView * bv) 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); } } @@ -268,7 +268,7 @@ void InsetCollapsable::InsetButtonRelease(BufferView * bv, 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); } } diff --git a/src/insets/insetexternal.C b/src/insets/insetexternal.C index 1d22fd9931..6639eacbbe 100644 --- a/src/insets/insetexternal.C +++ b/src/insets/insetexternal.C @@ -40,7 +40,7 @@ InsetExternal::InsetExternal() : view(0) { tempname = lyx::tempName(string(), "lyxext"); - ExternalTemplateManager::Templates::const_iterator i1; + //ExternalTemplateManager::Templates::const_iterator i1; params_.templ = ExternalTemplateManager::get().getTemplates().begin()->second; } diff --git a/src/insets/insetminipage.C b/src/insets/insetminipage.C index ceb7d8da5c..aafab15c0e 100644 --- a/src/insets/insetminipage.C +++ b/src/insets/insetminipage.C @@ -55,7 +55,8 @@ using std::endl; // (Lgb) InsetMinipage::InsetMinipage() - : InsetCollapsable() + : InsetCollapsable(), pos_(center), + inner_pos_(inner_center) { setLabel(_("minipage")); LyXFont font(LyXFont::ALL_SANE); @@ -111,3 +112,51 @@ bool InsetMinipage::InsertInsetAllowed(Inset * in) const } 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; +} diff --git a/src/insets/insetminipage.h b/src/insets/insetminipage.h index aff41a6eec..fa455acb33 100644 --- a/src/insets/insetminipage.h +++ b/src/insets/insetminipage.h @@ -17,12 +17,26 @@ #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(); /// @@ -37,6 +51,31 @@ public: 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