+2002-08-02 Angus Leeming <leeming@lyx.org>
+
+ * FORMAT: a new file to document changes in the LyX file format.
+ Start it off with a change to Include insets.
+
2002-06-26 André Pönitz <poenitz@gmx.de>
* development/Win32/lyxwin32.c: Win32 specific patch from Claus
--- /dev/null
+Changes to the LyX format since version 220 (LyX 1.2.0) was released.
+=====================================================================
+
+2002-08-02 Angus Leeming <leeming@lyx.org>
+
+Added a boolean "preview" flag to InsetCommandParams.
+Currently it is written only by InsetInclude, because only this
+class can generate a preview of its contents.
+
+The LyX file now contains:
+
+ \begin_inset Include \input{snapshot_t=40.tex}
++preview true
+
+ \end_inset
+
+Earlier versions of LyX just swallow this extra token silently.
+2002-08-02 Angus Leeming <leeming@lyx.org>
+
+ * FormInclude.C:
+ * forms/form_include.fd: added a check_preview button and controlling
+ logic. The user can now choose to preview a \input-ed file.
+
2002-08-02 Angus Leeming <leeming@lyx.org>
* FormTabular.C (input):
fl_set_button(dialog_->check_typeset,
int(controller().params().noload));
+ if (cmdname == "input")
+ fl_set_button(dialog_->check_preview,
+ int(controller().params().cparams.preview()));
+ else
+ fl_set_button(dialog_->check_preview, 0);
+
+ setEnabled(dialog_->check_preview, (cmdname == "input"));
+
fl_set_button(dialog_->radio_useinput, cmdname == "input");
fl_set_button(dialog_->radio_useinclude, cmdname == "include");
if (cmdname == "verbatiminput" || cmdname == "verbatiminput*") {
void FormInclude::apply()
{
controller().params().noload = fl_get_button(dialog_->check_typeset);
+ controller().params().cparams
+ .preview(fl_get_button(dialog_->check_preview));
string const file = fl_get_input(dialog_->input_filename);
if (controller().fileExists(file))
action = ButtonPolicy::SMI_INVALID;
}
+ if (ob == dialog_->radio_useinput) {
+ setEnabled(dialog_->check_preview, true);
+ } else if (ob == dialog_->radio_verbatim ||
+ ob == dialog_->radio_useinclude) {
+ fl_set_button(dialog_->check_preview, 0);
+ setEnabled(dialog_->check_preview, false);
+ }
+
return action;
}
=============== FORM ===============
Name: form_include
Width: 340
-Height: 210
-Number of Objects: 14
+Height: 250
+Number of Objects: 15
--------------------
class: FL_BOX
type: UP_BOX
-box: 0 0 340 210
+box: 0 0 340 250
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_BUTTON
type: RETURN_BUTTON
-box: 120 170 100 30
+box: 120 210 100 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
-box: 230 170 100 30
+box: 230 210 100 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
-box: 230 130 100 30
+box: 230 170 100 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_BEGIN_GROUP
type: 0
-box: 0 0 0 0
+box: 0 10 10 0
boxtype: FL_NO_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_CENTER
callback:
argument:
+--------------------
+class: FL_CHECKBUTTON
+type: PUSH_BUTTON
+box: 180 130 150 30
+boxtype: FL_NO_BOX
+colors: FL_COL1 FL_YELLOW
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Preview|#p
+shortcut:
+resize: FL_RESIZE_NONE
+gravity: FL_NoGravity FL_NoGravity
+name: check_preview
+callback: C_FormBaseInputCB
+argument: 0
+
==============================
create_the_forms
+2002-08-02 Angus Leeming <leeming@lyx.org>
+
+ * insetcommandparams.[Ch] (preview): new methods returning and setting
+ a new bool preview_ flag.
+ (read): read this flag.
+ (operator==): add flag to check.
+
+ * insetinclude.C (write): output new preview() flag.
+ (previewWanted): use this flag.
+
2002-08-02 Angus Leeming <leeming@lyx.org>
* insetcollapsable.[Ch] (addPreview):
InsetCommandParams::InsetCommandParams(string const & n,
string const & c,
string const & o)
- : cmdname(n), contents(c), options(o)
+ : cmdname(n), contents(c), options(o), preview_(false)
{}
}
while (lex.isOK()) {
- lex.nextToken();
+ lex.next();
token = lex.getString();
if (token == "\\end_inset")
break;
+ if (token == "preview") {
+ lex.next();
+ preview_ = lex.getBool();
+ }
}
if (token != "\\end_inset") {
lex.printError("Missing \\end_inset at this point. "
{
return o1.getCmdName() == o2.getCmdName()
&& o1.getContents() == o2.getContents()
- && o1.getOptions() == o2.getOptions();
+ && o1.getOptions() == o2.getOptions()
+ && o1.preview() == o2.preview();
}
string const getAsString() const;
///
void setFromString(string const &);
+ ///
+ bool preview() const { return preview_; }
+ ///
+ void preview(bool p) { preview_ = p; }
+
private:
///
string cmdname;
string contents;
///
string options;
+ ///
+ bool preview_;
};
void InsetInclude::write(Buffer const *, ostream & os) const
{
- os << "Include " << params_.cparams.getCommand() << "\n";
+ os << "Include " << params_.cparams.getCommand() << '\n'
+ << "preview " << tostr(params_.cparams.preview()) << '\n';
}
bool InsetInclude::PreviewImpl::previewWanted() const
{
- return parent().params_.flag == InsetInclude::INPUT;
+ return parent().params_.flag == InsetInclude::INPUT &&
+ parent().params_.cparams.preview();
}