#include "insets/insetexternal.h"
#include "insets/insetgraphics.h"
#include "insets/insetfoot.h"
+#include "insets/insetmarginal.h"
+#include "insets/insetminipage.h"
+#include "insets/insetfloat.h"
+#include "insets/insetlist.h"
#include "insets/insettabular.h"
+#include "insets/insettheorem.h"
#include "mathed/formulamacro.h"
#include "toolbar.h"
#include "spellchecker.h" // RVDK_PATCH_5
#include "menus.h"
#include "bufferview_funcs.h"
#include "frontends/Dialogs.h"
+#include "FloatList.h"
using std::pair;
using std::endl;
}
case LFUN_TABLE:
+#ifndef NEW_TABULAR
Table();
+#else
+ owner->getDialogs()->showTabularCreate();
+#endif
break;
case LFUN_FIGURE:
txt->cursor.par(),
txt->cursor.pos());
tmpinset->Edit(owner->view(),
- tmpinset->x() + tmpinset->width(owner->view()->painter(),font),
- tmpinset->descent(owner->view()->painter(),font),
+ tmpinset->x() +
+ tmpinset->width(owner->view(),font),
+ tmpinset->descent(owner->view(),font),
0);
break;
}
case LFUN_INSET_TEXT:
{
- InsetText * new_inset = new InsetText();
+ InsetText * new_inset = new InsetText;
if (owner->view()->insertInset(new_inset))
new_inset->Edit(owner->view(), 0, 0, 0);
else
delete new_inset;
}
break;
+
case LFUN_INSET_ERT:
{
- InsetERT * new_inset = new InsetERT();
+ InsetERT * new_inset = new InsetERT;
if (owner->view()->insertInset(new_inset))
new_inset->Edit(owner->view(), 0, 0, 0);
else
case LFUN_INSET_EXTERNAL:
{
- InsetExternal * new_inset = new InsetExternal();
+ InsetExternal * new_inset = new InsetExternal;
if (owner->view()->insertInset(new_inset))
new_inset->Edit(owner->view(), 0, 0, 0);
else
case LFUN_INSET_FOOTNOTE:
{
- InsetFoot * new_inset = new InsetFoot();
+ InsetFoot * new_inset = new InsetFoot;
+ if (owner->view()->insertInset(new_inset))
+ new_inset->Edit(owner->view(), 0, 0, 0);
+ else
+ delete new_inset;
+ }
+ break;
+
+ case LFUN_INSET_MARGINAL:
+ {
+ InsetMarginal * new_inset = new InsetMarginal;
+ if (owner->view()->insertInset(new_inset))
+ new_inset->Edit(owner->view(), 0, 0, 0);
+ else
+ delete new_inset;
+ }
+ break;
+
+ case LFUN_INSET_MINIPAGE:
+ {
+ InsetMinipage * new_inset = new InsetMinipage;
+ if (owner->view()->insertInset(new_inset))
+ new_inset->Edit(owner->view(), 0, 0, 0);
+ else
+ delete new_inset;
+ }
+ break;
+
+ case LFUN_INSET_FLOAT:
+ {
+ // check if the float type exist
+ if (floatList.typeExist(argument)) {
+ InsetFloat * new_inset = new InsetFloat(argument);
+ if (owner->view()->insertInset(new_inset))
+ new_inset->Edit(owner->view(), 0, 0, 0);
+ else
+ delete new_inset;
+ } else {
+ lyxerr << "Non-existant float type: "
+ << argument << endl;
+ }
+
+ }
+ break;
+
+ case LFUN_INSET_LIST:
+ {
+ InsetList * new_inset = new InsetList;
+ if (owner->view()->insertInset(new_inset))
+ new_inset->Edit(owner->view(), 0, 0, 0);
+ else
+ delete new_inset;
+ }
+ break;
+
+ case LFUN_INSET_THEOREM:
+ {
+ InsetTheorem * new_inset = new InsetTheorem;
if (owner->view()->insertInset(new_inset))
new_inset->Edit(owner->view(), 0, 0, 0);
else
}
break;
+ case LFUN_CREATE_CITATION:
+ {
+ owner->getDialogs()->createCitation( argument );
+ }
+ break;
+
case LFUN_INSERT_CITATION:
- {
- InsetCitation * new_inset = new InsetCitation();
- // ale970405
- // The note, if any, must be after the key, delimited
- // by a | so both key and remark can have spaces.
- if (!argument.empty()) {
- string lsarg(argument);
- if (contains(lsarg, "|")) {
- new_inset->setContents(token(lsarg, '|', 0));
- new_inset->setOptions(token(lsarg, '|', 1));
- } else
- new_inset->setContents(lsarg);
- if (!owner->view()->insertInset(new_inset))
- delete new_inset;
- } else {
- if (owner->view()->insertInset(new_inset))
- new_inset->Edit(owner->view(), 0, 0, 0);
- else
- delete new_inset;
- }
+ {
+ string keys = token(argument, '|', 0);
+ string text = token(argument, '|', 1);
+
+ InsetCitation * inset = new InsetCitation( keys, text );
+ if (!owner->view()->insertInset(inset))
+ delete inset;
+ else
+ owner->view()->updateInset( inset, true );
}
break;