}
break;
+ case LFUN_INSET_WIDE_FLOAT:
+ {
+ // check if the float type exist
+ if (floatList.typeExist(argument)) {
+ InsetFloat * new_inset = new InsetFloat(argument);
+ new_inset->wide(true);
+ if (bv_->insertInset(new_inset))
+ new_inset->Edit(bv_, 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;
2001-05-31 Lars Gullik Bjønnes <larsbj@birdstep.com>
+ * commandtags.h: add LFUN_INSET_WIDE_FLOAT
+
+ * MenuBackend.C (expand): also create menu entries for wide
+ versions of the floats.
+
+ * LyXAction.C (init): add entry for LFUN_INSET_WIDE_FLOAT
+
+ * BufferView_pimpl.C (Dispatch): implement LFUN_INSET_WIDE_FLOAT
+
* Makefile.am (lyx_DEPENDENCIES): adjust for change in
frontends/Makefile.am
{ LFUN_FILE_OPEN, "file-open", _("Open a file"), NoBuffer },
{ LFUN_MENUSEARCH, "find-replace", N_("Find & Replace"),
ReadOnly },
- { LFUN_INSET_FLOAT, "float-insert", "", Noop },
+ { LFUN_INSET_FLOAT, "float-insert", "Insert a Float", Noop },
+ { LFUN_INSET_WIDE_FLOAT, "float-wide-insert",
+ "Insert a wide Float", Noop },
{ LFUN_BOLD, "font-bold", N_("Toggle bold"), Noop },
{ LFUN_CODE, "font-code", N_("Toggle code style"), Noop },
{ LFUN_DEFAULT, "font-default", N_("Default font style"),
int const action = lyxaction
.getPseudoAction(LFUN_FLOAT_LIST,
cit->second.type());
- string label = "List of ";
+ string label = _("List of ");
label += cit->second.name();
tomenu.add(MenuItem(MenuItem::Command,
label, action));
FloatList::const_iterator cit = floatList.begin();
FloatList::const_iterator end = floatList.end();
for (; cit != end; ++cit) {
+ // normal float
int const action = lyxaction
.getPseudoAction(LFUN_INSET_FLOAT,
cit->second.type());
string const label = cit->second.name();
tomenu.add(MenuItem(MenuItem::Command,
label, action));
+
+ // and the wide version
+ int const action2 = lyxaction
+ .getPseudoAction(LFUN_INSET_WIDE_FLOAT,
+ cit->second.type());
+ string const label2 = _("Wide ") + label;
+ tomenu.add(MenuItem(MenuItem::Command,
+ label2, action2));
}
}
break;
LFUN_INSET_MARGINAL, // Lgb 20000626
LFUN_INSET_MINIPAGE, // Lgb 20000627
LFUN_INSET_FLOAT, // Lgb 20000627
+ LFUN_INSET_WIDE_FLOAT, // Lgb 20010531
LFUN_INSET_LIST, // Lgb 20000627
LFUN_INSET_THEOREM, // Lgb 20000630
LFUN_CITATION_CREATE, // 240 // Angus 20000705
2001-05-31 Lars Gullik Bjønnes <larsbj@birdstep.com>
+ * insetfloat.C (Write): write out wide info
+ (Read): read the wide info
+ (Latex): use the wide info when creating latex.
+
* insettext.C: adjust
* insetgraphics.[Ch] (statusMessage): change to return string
} else {
os << "placement " << floatPlacement_ << "\n";
}
+ if (wide_) {
+ os << "wide true\n";
+ } else {
+ os << "wide false\n";
+ }
InsetCollapsable::Write(buf, os);
}
{
if (lex.IsOK()) {
lex.next();
- string const token = lex.GetString();
+ string token = lex.GetString();
if (token == "placement") {
lex.next();
floatPlacement_ = lex.GetString();
lyxerr << "InsetFloat::Read: Missing placement!"
<< endl;
}
+ lex.next();
+ token = lex.GetString();
+ if (token == "wide") {
+ lex.next();
+ string const tmptoken = lex.GetString();
+ if (tmptoken == "true")
+ wide(true);
+ else
+ wide(false);
+ } else {
+ lyxerr << "InsetFloat::Read:: Missing wide!"
+ << endl;
+ }
}
InsetCollapsable::Read(buf, lex);
}
int InsetFloat::Latex(Buffer const * buf,
ostream & os, bool fragile, bool fp) const
{
- os << "\\begin{" << floatType_ << "}";
+ string const tmptype = (wide_ ? floatType_ + "*" : floatType_);
+
+ os << "\\begin{" << tmptype << "}";
if (!floatPlacement_.empty()
&& floatPlacement_ != floatList.defaultPlacement(floatType_))
os << "[" << floatPlacement_ << "]";
os << "%\n";
int const i = inset.Latex(buf, os, fragile, fp);
- os << "\\end{" << floatType_ << "}%\n";
+ os << "\\end{" << tmptype << "}%\n";
return i + 2;
}