mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-27 06:19:36 +00:00
updates to minipage inset
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1756 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9356012089
commit
a097c6236f
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user