1999-09-27 18:44:28 +00:00
|
|
|
/* This file is part of*
|
2002-03-21 17:09:55 +00:00
|
|
|
* ======================================================
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
2002-03-21 17:09:55 +00:00
|
|
|
*
|
2001-05-30 13:53:44 +00:00
|
|
|
* Copyright 1997-2001 The LyX Team.
|
2002-03-21 17:09:55 +00:00
|
|
|
*
|
1999-11-15 10:58:38 +00:00
|
|
|
* ====================================================== */
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Created by asierra 970813
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "insetparent.h"
|
1999-10-02 16:21:10 +00:00
|
|
|
#include "support/filetools.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
#include "BufferView.h"
|
|
|
|
#include "LyXView.h"
|
2001-07-30 13:35:08 +00:00
|
|
|
#include "support/LOstream.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
#include "commandtags.h"
|
2000-04-08 17:02:02 +00:00
|
|
|
#include "buffer.h"
|
2000-07-14 07:52:03 +00:00
|
|
|
#include "gettext.h"
|
2001-04-24 17:33:01 +00:00
|
|
|
#include "lyxfunc.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2000-04-04 00:19:15 +00:00
|
|
|
using std::ostream;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2000-09-14 17:53:12 +00:00
|
|
|
|
2001-07-06 15:57:54 +00:00
|
|
|
InsetParent::InsetParent(InsetCommandParams const & p, Buffer const & bf, bool)
|
2000-08-04 13:12:30 +00:00
|
|
|
: InsetCommand(p)
|
1999-09-27 18:44:28 +00:00
|
|
|
{
|
2000-11-04 10:00:12 +00:00
|
|
|
string const fn = p.getContents();
|
2002-01-14 23:31:23 +00:00
|
|
|
setContents(MakeAbsPath(fn, bf.filePath()));
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
|
|
|
|
1999-12-07 00:44:53 +00:00
|
|
|
|
2002-03-21 17:09:55 +00:00
|
|
|
string const InsetParent::getScreenLabel(Buffer const *) const
|
2000-04-04 00:19:15 +00:00
|
|
|
{
|
|
|
|
return string(_("Parent:")) + getContents();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-06-28 10:25:20 +00:00
|
|
|
void InsetParent::edit(BufferView * bv, int, int, unsigned int)
|
2002-03-21 17:09:55 +00:00
|
|
|
{
|
2000-02-25 12:06:15 +00:00
|
|
|
bv->owner()->getLyXFunc()->
|
2001-07-16 15:42:57 +00:00
|
|
|
dispatch(LFUN_CHILDOPEN, getContents());
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
|
|
|
|
1999-12-07 00:44:53 +00:00
|
|
|
|
2001-07-20 14:18:48 +00:00
|
|
|
void InsetParent::edit(BufferView * bv, bool)
|
|
|
|
{
|
|
|
|
edit(bv, 0, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
// LaTeX must just ignore this command
|
2001-06-28 10:25:20 +00:00
|
|
|
int InsetParent::latex(Buffer const * buf, ostream & os,
|
2000-04-19 01:42:55 +00:00
|
|
|
bool fragile, bool free_spc) const
|
1999-09-27 18:44:28 +00:00
|
|
|
{
|
1999-12-07 00:44:53 +00:00
|
|
|
os << "%%#{lyx}";
|
2001-06-28 10:25:20 +00:00
|
|
|
InsetCommand::latex(buf, os, fragile, free_spc);
|
1999-12-07 00:44:53 +00:00
|
|
|
return 0;
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|