]> git.lyx.org Git - features.git/commitdiff
updates to minipage inset
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 14 Mar 2001 14:53:55 +0000 (14:53 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 14 Mar 2001 14:53:55 +0000 (14:53 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1756 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insetcollapsable.C
src/insets/insetexternal.C
src/insets/insetminipage.C
src/insets/insetminipage.h

index 0d4f6b62c4dc1d689b4f1ab976a4a320a1ab1174..9003a4f02811285c925c29e80ca0e831256f5549 100644 (file)
@@ -1,3 +1,8 @@
+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
index e7cfe8b373699c852e0732da1e1137dd35dc81a8..ea7757dc01fc3ca09b5ce9bb443d58daac5818a2 100644 (file)
@@ -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);
     }
 }
 
index 1d22fd9931dee040e2541c3e39e431fb9102977d..6639eacbbe4bb006dfc2809bad2b66ef1e409288 100644 (file)
@@ -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;
 }
 
index ceb7d8da5c9423e2dda4e8e0f68d90450ae2dcd3..aafab15c0e4579e9ef3405ddcea7eba1bdce1116 100644 (file)
@@ -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;
+}
index aff41a6eeceb2680a407b550e31ddd734a46142d..fa455acb33edd4110438ec436a21a8193cff6dcf 100644 (file)
 #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