1999-09-27 18:44:28 +00:00
|
|
|
/* This file is part of*
|
1999-11-15 10:58:38 +00:00
|
|
|
* ======================================================
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
2000-03-09 03:36:48 +00:00
|
|
|
* Copyright 1997-2000 The LyX Team.
|
1999-09-27 18:44:28 +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"
|
|
|
|
#include "lyxfunc.h"
|
|
|
|
#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"
|
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
|
|
|
|
1999-12-07 00:44:53 +00:00
|
|
|
InsetParent::InsetParent(string const & fn, Buffer * owner)
|
|
|
|
: InsetCommand("lyxparent")
|
1999-09-27 18:44:28 +00:00
|
|
|
{
|
1999-12-07 00:44:53 +00:00
|
|
|
if (owner)
|
1999-12-10 00:07:59 +00:00
|
|
|
setContents(MakeAbsPath(fn, OnlyPath(owner->fileName())));
|
1999-12-07 00:44:53 +00:00
|
|
|
else
|
|
|
|
setContents(fn);
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
|
|
|
|
1999-12-07 00:44:53 +00:00
|
|
|
|
2000-04-04 00:19:15 +00:00
|
|
|
string InsetParent::getScreenLabel() const
|
|
|
|
{
|
|
|
|
return string(_("Parent:")) + getContents();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-02-25 12:06:15 +00:00
|
|
|
void InsetParent::Edit(BufferView * bv, int, int, unsigned int)
|
1999-09-27 18:44:28 +00:00
|
|
|
{
|
2000-02-25 12:06:15 +00:00
|
|
|
bv->owner()->getLyXFunc()->
|
|
|
|
Dispatch(LFUN_CHILDOPEN, getContents().c_str());
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
|
|
|
|
1999-12-07 00:44:53 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
// LaTeX must just ignore this command
|
2000-06-12 11:27:15 +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}";
|
2000-06-12 11:27:15 +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
|
|
|
}
|