InsetNoteMailer("note", *this).updateDialog(bv);
return DISPATCHED;
case LFUN_MOUSE_RELEASE:
- if (cmd.button() == mouse_button::button3 && cmd.x < button_length
- && cmd.y >= button_top_y && cmd.y <= button_bottom_y) {
+ if (cmd.button() == mouse_button::button3 && hitButton(cmd)) {
InsetNoteMailer("note", *this).showDialog(bv);
return DISPATCHED;
}
int i = 0;
if (pt == "Comment")
- os << "%\n\\begin{comment}\n"; // remember to validate
+ // verbatim
+ os << "%\n\\begin{comment}\n";
else if (pt == "Greyedout")
- os << "%\n\\textcolor[gray]{0.8}{";
+ // we roll our own macro
+ os << "%\n\\begin{lyxgreyedout}\n";
if (pt != "Note")
i = inset.latex(buf, os, runparams);
os << "%\n\\end{comment}\n";
i += 3;
} else if (pt == "Greyedout") {
- os << "\\normalcolor%\n}";
+ os << "%\n\\end{lyxgreyedout}\n";
i += 2;
}
return i;
}
-int InsetNote::linuxdoc(Buffer const *, std::ostream &) const
+int InsetNote::linuxdoc(Buffer const * buf, std::ostream & os) const
{
- return 0;
+ string const pt = params_.type;
+
+ int i = 0;
+ if (pt == "Comment")
+ os << "<comment>\n";
+
+ if (pt != "Note")
+ i = inset.linuxdoc(buf, os);
+
+ if (pt == "Comment") {
+ os << "\n</comment>\n";
+ i += 3;
+ }
+ return i;
}
int InsetNote::docbook(Buffer const * buf, std::ostream & os, bool mixcont) const
{
- int i = 0;
string const pt = params_.type;
- // incomplete, untested - MV
+
+ int i = 0;
+ if (pt == "Comment")
+ os << "<remark>\n";
+
if (pt != "Note")
i = inset.docbook(buf, os, mixcont);
+
+ if (pt == "Comment") {
+ os << "\n</remark>\n";
+ i += 3;
+ }
return i;
}
{
if (params_.type == "Comment")
features.require("verbatim");
- if (params_.type == "Greyedout")
+ if (params_.type == "Greyedout") {
features.require("color");
+ features.require("lyxgreyedout");
+ }
inset.validate(features);
}