LyX file-format changes
-----------------------
+2007-12-03 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+ * Format incremented to 304: framed and shaded boxes are now real boxes
+ (not notes).
+
2007-11-25 Uwe Stöhr <uwestoehr@web.de>
* Format incremented to 303: remove Serbocroatian as this was not a real
babel language (Croatian was used instead in the background)
# Textclass definition file for LaTeX.
-# Author : Martin vermeer <amrtin.vermeer@hut.fi>
+# Author : Martin vermeer <martin.vermeer@hut.fi>
# Inset layouts definition
#
#InsetLayout <string identifier used by LyX>
MultiPar true
End
-InsetLayout Note:Framed
- LabelString framed
- LatexType environment
- LatexName framed
- BgColor greyedoutbg
- LabelFont
- Color greyedout
- Size Small
- EndFont
- MultiPar true
-End
-
-InsetLayout Note:Shaded
- LabelString shaded
- LatexType environment
- LatexName shaded
- BgColor shaded
- LabelFont
- Color greyedout
- Size Small
- EndFont
- MultiPar true
-End
-
InsetLayout ERT
LabelString ERT
LatexType none
MultiPar true
End
+InsetLayout Box:Shaded
+ BgColor shaded
+ LabelFont
+ Color foreground
+ Size Small
+ EndFont
+ MultiPar true
+End
+
InsetLayout figure
LabelString Figure
LabelFont
("1_3", [221], minor_versions("1.3" , 7)),
("1_4", range(222,246), minor_versions("1.4" , 5)),
("1_5", range(246,277), minor_versions("1.5" , 2)),
- ("1_6", range(277,304), minor_versions("1.6" , 0))] # Uwe: Serbocroatian
+ ("1_6", range(277,305), minor_versions("1.6" , 0))]
def formats_list():
def wrap_into_ert(string, src, dst):
" Wrap a something into an ERT"
- return string.replace(src, '\n\\begin_inset ERT\nstatus collapsed\n\\begin_layout standard\n'
+ return string.replace(src, '\n\\begin_inset ERT\nstatus collapsed\n\\begin_layout Standard\n'
+ dst + '\n\\end_layout\n\\end_inset\n')
fullcontent = document.body[i + 2][6:].strip('"')
document.body[i:i + 2] = ["\\begin_inset Index",
"status collapsed",
- "\\begin_layout standard"]
+ "\\begin_layout Standard"]
# Put here the conversions needed from LaTeX string to LyXText.
# Here we do a minimal conversion to prevent crashes and data loss.
# Manual patch-up may be needed.
line = line[16:]
if line.startswith("\\begin_inset Formula"):
line = line[20:]
- if line.startswith("\\begin_layout standard"):
+ if line.startswith("\\begin_layout Standard"):
line = line[22:]
if line.startswith("\\end_layout"):
line = line[11:]
j = j + 1
+def convert_framed_notes(document):
+ "Convert framed notes to boxes. "
+ i = 0
+ while 1:
+ i = find_tokens(document.body, ["\\begin_inset Note Framed", "\\begin_inset Note Shaded"], i)
+
+ if i == -1:
+ return
+ document.body[i] = document.body[i].replace("\\begin_inset Note", "\\begin_inset Box")
+ document.body.insert(i + 1, 'position "t"\nhor_pos "c"\nhas_inner_box 0\ninner_pos "t"\n' \
+ 'use_parbox 0\nwidth "100col%"\nspecial "none"\nheight "1in"\n' \
+ 'height_special "totalheight"')
+ i = i + 1
+
+
+def revert_framed_notes(document):
+ "Revert framed boxes to notes. "
+ i = 0
+ while 1:
+ i = find_tokens(document.body, ["\\begin_inset Box Framed", "\\begin_inset Box Shaded"], i)
+
+ if i == -1:
+ return
+ j = find_end_of_inset(document.body, i + 1)
+ if j == -1:
+ # should not happen
+ document.warning("Malformed LyX document: Could not find end of Box inset.")
+ k = find_token(document.body, "status", i + 1, j)
+ if k == -1:
+ document.warning("Malformed LyX document: Missing `status' tag in Box inset.")
+ return
+ status = document.body[k]
+ l = find_token(document.body, "\\begin_layout Standard", i + 1, j)
+ if l == -1:
+ document.warning("Malformed LyX document: Missing `\\begin_layout Standard' in Box inset.")
+ return
+ m = find_token(document.body, "\\end_layout", i + 1, j)
+ if m == -1:
+ document.warning("Malformed LyX document: Missing `\\end_layout' in Box inset.")
+ return
+ ibox = find_token(document.body, "has_inner_box 1", i + 1, k)
+ pbox = find_token(document.body, "use_parbox 1", i + 1, k)
+ if ibox == -1 and pbox == -1:
+ document.body[i] = document.body[i].replace("\\begin_inset Box", "\\begin_inset Note")
+ del document.body[i+1:k]
+ else:
+ document.body[i] = document.body[i].replace("\\begin_inset Box Shaded", "\\begin_inset Box Frameless")
+ document.body.insert(l + 1, "\\begin_inset Note Shaded\n" + status + "\n\\begin_layout Standard\n")
+ document.body.insert(m + 1, "\\end_layout\n\\end_inset")
+ i = i + 1
+
+
##
# Conversion hub
#
[300, []],
[301, []],
[302, []],
- [303, [convert_serbocroatian]]
+ [303, [convert_serbocroatian]],
+ [304, [convert_framed_notes]]
]
-revert = [[302, []],
+revert = [[303, [revert_framed_notes]],
+ [302, []],
[301, [revert_latin, revert_samin]],
[300, [revert_linebreak]],
[299, [revert_pagebreak]],
namespace {
-int const LYX_FORMAT = 303; // Uwe: Serbocroatian
+int const LYX_FORMAT = 304; // JSpitzm: framed.sty goes InsetBox
} // namespace anon
{
char const * const ids_[] = {
"Frameless", "Boxed", "ovalbox",
- "Ovalbox", "Shadowbox", "Doublebox"};
+ "Ovalbox", "Shadowbox", "Shaded", "Doublebox"};
size_t const ids_size = sizeof(ids_) / sizeof(char *);
ids = vector<string>(ids_, ids_ + ids_size);
gui_names.clear();
- gui_names.push_back(_("No frame drawn"));
- gui_names.push_back(_("Rectangular box"));
- gui_names.push_back(_("Oval box, thin"));
- gui_names.push_back(_("Oval box, thick"));
- gui_names.push_back(_("Shadow box"));
- gui_names.push_back(_("Double box"));
+ gui_names.push_back(_("No frame"));
+ gui_names.push_back(_("Simple rectangular frame"));
+ gui_names.push_back(_("Oval frame, thin"));
+ gui_names.push_back(_("Oval frame, thick"));
+ gui_names.push_back(_("Drop shadow"));
+ gui_names.push_back(_("Shaded background"));
+ gui_names.push_back(_("Double rectangular frame"));
}
connect(innerBoxCO, SIGNAL(activated(const QString&)),
this, SLOT(innerBoxChanged(const QString &)));
connect(innerBoxCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
+ connect(pagebreakCB, SIGNAL(stateChanged(int)),
+ this, SLOT(pagebreakClicked()));
heightED->setValidator(unsignedLengthValidator(heightED));
widthED->setValidator(unsignedLengthValidator(widthED));
bc().addReadOnly(heightCB);
bc().addReadOnly(heightED);
bc().addReadOnly(heightUnitsLC);
+ bc().addReadOnly(pagebreakCB);
bc().setRestore(restorePB);
bc().setOK(okPB);
heightUnitsLC->setEnabled(true);
setSpecial(true);
}
+ if (index != 1)
+ pagebreakCB->setChecked(false);
+ pagebreakCB->setEnabled(index == 1);
int itype = innerBoxCO->currentIndex();
setInnerType(frameless, itype);
}
}
+void GuiBox::pagebreakClicked()
+{
+ bool pbreak = (pagebreakCB->checkState() == Qt::Checked);
+ innerBoxCO->setEnabled(!pbreak);
+ if (pbreak) {
+ valignCO->setEnabled(false);
+ ialignCO->setEnabled(false);
+ halignCO->setEnabled(false);
+ heightCB->setEnabled(false);
+ heightED->setEnabled(false);
+ heightUnitsLC->setEnabled(false);
+ setSpecial(false);
+ } else
+ typeChanged(typeCO->currentIndex());
+
+}
+
void GuiBox::updateContents()
{
string type = params_.type;
+ if (type == "Framed") {
+ pagebreakCB->setChecked(true);
+ type = "Boxed";
+ } else
+ pagebreakCB->setChecked(false);
+
+ pagebreakCB->setEnabled(type == "Boxed");
+
for (unsigned int i = 0; i < gui_names_.size(); ++i) {
if (type == ids_[i])
typeCO->setCurrentIndex(i);
void GuiBox::applyView()
{
- params_.type = ids_[typeCO->currentIndex()];
+ bool pagebreak = pagebreakCB->isChecked();
+ if (pagebreak)
+ params_.type = "Framed";
+ else
+ params_.type = ids_[typeCO->currentIndex()];
- params_.inner_box = innerBoxCO->currentText() != qt_("None");
- params_.use_parbox = innerBoxCO->currentText() == qt_("Parbox");
+ params_.inner_box = (!pagebreak && innerBoxCO->currentText() != qt_("None"));
+ params_.use_parbox = (!pagebreak && innerBoxCO->currentText() == qt_("Parbox"));
params_.pos = "tcb"[valignCO->currentIndex()];
params_.inner_pos = "tcbs"[ialignCO->currentIndex()];
void innerBoxChanged(const QString &);
void typeChanged(int);
void restoreClicked();
+ void pagebreakClicked();
private:
///
connect(noteRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(greyedoutRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(commentRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
- connect(framedRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
- connect(shadedRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
bc().setOK(okPB);
case InsetNoteParams::Greyedout:
greyedoutRB->setChecked(true);
break;
- case InsetNoteParams::Framed:
- framedRB->setChecked(true);
- break;
- case InsetNoteParams::Shaded:
- shadedRB->setChecked(true);
- break;
}
}
params_.type = InsetNoteParams::Greyedout;
else if (commentRB->isChecked())
params_.type = InsetNoteParams::Comment;
- else if (framedRB->isChecked())
- params_.type = InsetNoteParams::Framed;
- else if (shadedRB->isChecked())
- params_.type = InsetNoteParams::Shaded;
else
params_.type = InsetNoteParams::Note;
}
<x>0</x>
<y>0</y>
<width>356</width>
- <height>268</height>
+ <height>288</height>
</rect>
</property>
<property name="windowTitle" >
<property name="spacing" >
<number>6</number>
</property>
- <item row="4" column="0" colspan="3" >
+ <item row="4" column="0" colspan="2" >
+ <widget class="QCheckBox" name="pagebreakCB" >
+ <property name="toolTip" >
+ <string>Check this if the box should break across pages</string>
+ </property>
+ <property name="text" >
+ <string>Allow &page breaks</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" colspan="3" >
<widget class="QGroupBox" name="groupBox_2" >
<property name="title" >
<string>Alignment</string>
</layout>
</widget>
</item>
- <item row="0" column="1" colspan="2" >
- <widget class="QComboBox" name="typeCO" >
- <property name="toolTip" >
- <string>Supported box types</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1" colspan="2" >
- <widget class="QComboBox" name="innerBoxCO" >
- <property name="toolTip" >
- <string>Inner box -- needed for fixed width & line breaks</string>
- </property>
- <item>
- <property name="text" >
- <string>None</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Parbox</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Minipage</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="2" column="1" >
- <widget class="QLineEdit" name="widthED" >
- <property name="toolTip" >
- <string>Width value</string>
- </property>
- </widget>
- </item>
- <item row="3" column="1" >
- <widget class="QLineEdit" name="heightED" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <property name="toolTip" >
- <string>Height value</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0" >
- <widget class="QLabel" name="widthLA" >
- <property name="toolTip" >
- <string/>
- </property>
- <property name="text" >
- <string>&Width:</string>
- </property>
- <property name="buddy" >
- <cstring>widthED</cstring>
- </property>
- </widget>
- </item>
- <item row="0" column="0" >
- <widget class="QLabel" name="typeLA" >
- <property name="toolTip" >
- <string/>
- </property>
- <property name="text" >
- <string>&Decoration:</string>
- </property>
- <property name="buddy" >
- <cstring>typeCO</cstring>
- </property>
- </widget>
- </item>
- <item row="2" column="2" >
- <widget class="LengthCombo" name="widthUnitsLC" />
- </item>
- <item row="1" column="0" >
- <widget class="QLabel" name="innerBoxLA" >
- <property name="toolTip" >
- <string/>
- </property>
- <property name="text" >
- <string>Inner Bo&x:</string>
- </property>
- <property name="buddy" >
- <cstring>innerBoxCO</cstring>
- </property>
- </widget>
- </item>
- <item row="5" column="0" colspan="3" >
+ <item row="6" column="0" colspan="3" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</item>
</layout>
</item>
+ <item row="3" column="2" >
+ <widget class="LengthCombo" name="heightUnitsLC" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
<item row="3" column="0" >
<widget class="QCheckBox" name="heightCB" >
<property name="toolTip" >
</property>
</widget>
</item>
- <item row="3" column="2" >
- <widget class="LengthCombo" name="heightUnitsLC" >
+ <item row="1" column="0" >
+ <widget class="QLabel" name="innerBoxLA" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="text" >
+ <string>Inner Bo&x:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>innerBoxCO</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" >
+ <widget class="LengthCombo" name="widthUnitsLC" />
+ </item>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="typeLA" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="text" >
+ <string>&Decoration:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>typeCO</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="widthLA" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="text" >
+ <string>&Width:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>widthED</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLineEdit" name="heightED" >
<property name="enabled" >
<bool>false</bool>
</property>
+ <property name="toolTip" >
+ <string>Height value</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="widthED" >
+ <property name="toolTip" >
+ <string>Width value</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" colspan="2" >
+ <widget class="QComboBox" name="innerBoxCO" >
+ <property name="toolTip" >
+ <string>Inner box -- needed for fixed width & line breaks</string>
+ </property>
+ <item>
+ <property name="text" >
+ <string>None</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Parbox</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Minipage</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="0" column="1" colspan="2" >
+ <widget class="QComboBox" name="typeCO" >
+ <property name="toolTip" >
+ <string>Supported box types</string>
+ </property>
</widget>
</item>
</layout>
<x>0</x>
<y>0</y>
<width>202</width>
- <height>208</height>
+ <height>184</height>
</rect>
</property>
<property name="windowTitle" >
</property>
<layout class="QGridLayout" >
<property name="margin" >
- <number>11</number>
+ <number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
- <item row="1" column="0" >
- <widget class="QPushButton" name="okPB" >
+ <item row="1" column="1" >
+ <widget class="QPushButton" name="closePB" >
<property name="text" >
- <string>&OK</string>
+ <string>Close</string>
</property>
<property name="default" >
- <bool>false</bool>
+ <bool>true</bool>
</property>
</widget>
</item>
- <item row="1" column="1" >
- <widget class="QPushButton" name="closePB" >
+ <item row="1" column="0" >
+ <widget class="QPushButton" name="okPB" >
<property name="text" >
- <string>Close</string>
+ <string>&OK</string>
</property>
<property name="default" >
- <bool>true</bool>
+ <bool>false</bool>
</property>
</widget>
</item>
</property>
</widget>
</item>
- <item>
- <widget class="QRadioButton" name="framedRB" >
- <property name="toolTip" >
- <string>Framed in box</string>
- </property>
- <property name="text" >
- <string>&Framed</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="shadedRB" >
- <property name="toolTip" >
- <string>Box with shaded background</string>
- </property>
- <property name="text" >
- <string>&Shaded</string>
- </property>
- </widget>
- </item>
</layout>
</widget>
</item>
</layout>
</widget>
- <pixmapfunction></pixmapfunction>
- <includes>
- <include location="local" >qt_helpers.h</include>
- </includes>
<tabstops>
<tabstop>noteRB</tabstop>
<tabstop>commentRB</tabstop>
<tabstop>greyedoutRB</tabstop>
- <tabstop>framedRB</tabstop>
- <tabstop>shadedRB</tabstop>
<tabstop>okPB</tabstop>
<tabstop>closePB</tabstop>
</tabstops>
+ <includes>
+ <include location="local" >qt_helpers.h</include>
+ </includes>
<resources/>
<connections/>
</ui>
{
BoxTranslator translator("Boxed", InsetBox::Boxed);
translator.addPair("Frameless", InsetBox::Frameless);
+ translator.addPair("Framed", InsetBox::Framed);
translator.addPair("ovalbox", InsetBox::ovalbox);
translator.addPair("Ovalbox", InsetBox::Ovalbox);
translator.addPair("Shadowbox", InsetBox::Shadowbox);
+ translator.addPair("Shaded", InsetBox::Shaded);
translator.addPair("Doublebox",InsetBox::Doublebox);
return translator;
}
BoxTranslatorLoc const init_boxtranslator_loc()
{
- BoxTranslatorLoc translator(_("Boxed"), InsetBox::Boxed);
- translator.addPair(_("Frameless"), InsetBox::Frameless);
- translator.addPair(_("ovalbox"), InsetBox::ovalbox);
- translator.addPair(_("Ovalbox"), InsetBox::Ovalbox);
- translator.addPair(_("Shadowbox"), InsetBox::Shadowbox);
- translator.addPair(_("Doublebox"), InsetBox::Doublebox);
+ BoxTranslatorLoc translator(_("simple frame"), InsetBox::Boxed);
+ translator.addPair(_("frameless"), InsetBox::Frameless);
+ translator.addPair(_("simple frame, page breaks"), InsetBox::Framed);
+ translator.addPair(_("oval, thin"), InsetBox::ovalbox);
+ translator.addPair(_("oval, thick"), InsetBox::Ovalbox);
+ translator.addPair(_("drop shadow"), InsetBox::Shadowbox);
+ translator.addPair(_("shaded background"), InsetBox::Shaded);
+ translator.addPair(_("double frame"), InsetBox::Doublebox);
return translator;
}
}
+docstring InsetBox::name() const
+{
+ // FIXME: UNICODE
+ string name = string("Box");
+ if (boxtranslator().find(params_.type) == Shaded)
+ name += string(":Shaded");
+ return from_ascii(name);
+}
+
+
void InsetBox::write(Buffer const & buf, ostream & os) const
{
params_.write(os);
stdwidth = true;
switch (btype) {
case Frameless:
+ case Framed:
break;
case Boxed:
+ case Shaded:
width_string += " - 2\\fboxsep - 2\\fboxrule";
break;
case ovalbox:
switch (btype) {
case Frameless:
break;
+ case Framed:
+ os << "\\begin{framed}%\n";
+ i += 1;
+ break;
case Boxed:
os << "\\framebox";
if (!params_.inner_box) {
case Shadowbox:
os << "\\shadowbox{";
break;
+ case Shaded:
+ // later
+ break;
case Doublebox:
os << "\\doublebox{";
break;
os << "%\n";
i += 1;
}
+ if (btype == Shaded)
+ os << "\\begin{shaded}%\n";
+ i += 1;
i += InsetText::latex(buf, os, runparams);
+ if (btype == Shaded)
+ os << "\\end{shaded}";
+
if (params_.inner_box) {
if (params_.use_parbox)
os << "%\n}";
switch (btype) {
case Frameless:
break;
+ case Framed:
+ os << "\\end{framed}";
+ break;
case Boxed:
if (!params_.inner_box)
os << "}"; // for makebox
case Shadowbox:
os << "}";
break;
+ case Shaded:
+ // already done
+ break;
}
os << "%\n";
BoxType const btype = boxtranslator().find(params_.type);
switch (btype) {
- case Frameless: break;
- case Boxed: os << "[\n"; break;
- case ovalbox: os << "(\n"; break;
- case Ovalbox: os << "((\n"; break;
- case Shadowbox: os << "[/\n"; break;
- case Doublebox: os << "[[\n"; break;
+ case Frameless:
+ break;
+ case Framed:
+ case Boxed:
+ os << "[\n";
+ break;
+ case ovalbox:
+ os << "(\n";
+ break;
+ case Ovalbox:
+ os << "((\n";
+ break;
+ case Shadowbox:
+ case Shaded:
+ os << "[/\n";
+ break;
+ case Doublebox:
+ os << "[[\n";
+ break;
}
InsetText::plaintext(buf, os, runparams);
int len = 0;
switch (btype) {
- case Frameless: os << "\n"; break;
- case Boxed: os << "\n]"; len = 1; break;
- case ovalbox: os << "\n)"; len = 1; break;
- case Ovalbox: os << "\n))"; len = 2; break;
- case Shadowbox: os << "\n/]"; len = 2; break;
- case Doublebox: os << "\n]]"; len = 2; break;
+ case Frameless:
+ os << "\n";
+ break;
+ case Framed:
+ case Boxed:
+ os << "\n]";
+ len = 1;
+ break;
+ case ovalbox:
+ os << "\n)";
+ len = 1;
+ break;
+ case Ovalbox:
+ os << "\n))";
+ len = 2;
+ break;
+ case Shadowbox:
+ case Shaded:
+ os << "\n/]";
+ len = 2;
+ break;
+ case Doublebox:
+ os << "\n]]";
+ len = 2;
+ break;
}
return PLAINTEXT_NEWLINE + len; // len chars on a separate line
switch (btype) {
case Frameless:
break;
+ case Framed:
+ features.require("framed");
+ break;
case Boxed:
features.require("calc");
break;
features.require("calc");
features.require("fancybox");
break;
+ case Shaded:
+ features.require("color");
+ features.require("framed");
+ break;
}
InsetText::validate(features);
}
///
InsetCode lyxCode() const { return BOX_CODE; }
///
+ docstring name() const;
+ ///
void write(Buffer const &, std::ostream &) const;
///
void read(Buffer const & buf, Lexer & lex);
enum BoxType {
Frameless,
Boxed,
+ Framed,
ovalbox,
Ovalbox,
Shadowbox,
+ Shaded,
Doublebox
};
protected:
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
/// Is the width forced to some value?
virtual bool hasFixedWidth() const;
- ///
- virtual docstring name() const { return from_ascii("Box"); }
private:
friend class InsetBoxParams;
NoteTranslator translator("Note", InsetNoteParams::Note);
translator.addPair("Comment", InsetNoteParams::Comment);
translator.addPair("Greyedout", InsetNoteParams::Greyedout);
- translator.addPair("Framed", InsetNoteParams::Framed);
- translator.addPair("Shaded", InsetNoteParams::Shaded);
return translator;
}
NoteTranslatorLoc translator(_("Note"), InsetNoteParams::Note);
translator.addPair(_("Comment"), InsetNoteParams::Comment);
translator.addPair(_("Greyed out"), InsetNoteParams::Greyedout);
- translator.addPair(_("Framed"), InsetNoteParams::Framed);
- translator.addPair(_("Shaded"), InsetNoteParams::Shaded);
return translator;
}
Inset::DisplayType InsetNote::display() const
{
- switch (params_.type) {
- case InsetNoteParams::Framed:
- case InsetNoteParams::Shaded:
- return AlignLeft;
- default:
- return Inline;
- }
+ return Inline;
}
features.require("color");
features.require("lyxgreyedout");
}
- if (params_.type == InsetNoteParams::Shaded) {
- features.require("color");
- features.require("framed");
- }
- if (params_.type == InsetNoteParams::Framed)
- features.require("framed");
InsetText::validate(features);
}
enum Type {
Note,
Comment,
- Greyedout,
- Framed,
- Shaded
+ Greyedout
};
/// \c type defaults to Note
InsetNoteParams();
InsetCode lyxCode() const { return NOTE_CODE; }
///
docstring name() const;
- /// framed and shaded notes are displayed
+ ///
virtual DisplayType display() const;
///
void write(Buffer const &, std::ostream &) const;