document layout, service pack 1

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2784 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2001-09-21 15:20:17 +00:00
parent 4851d24977
commit a10b503e59
8 changed files with 61 additions and 53 deletions

View File

@ -1,5 +1,7 @@
2001-09-21 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* lyx_cb.C (MenuLayoutSave): change a bit the question
* sp_base.h: include <sys/types.h>
2001-09-18 Angus Leeming <a.leeming@ic.ac.uk>

View File

@ -1,3 +1,7 @@
2001-09-20 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* forms/form_document.fd: small tweaks.
2001-09-19 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* forms/form_document.fd: Added checkbox "auto_reset", button

View File

@ -91,6 +91,7 @@ void FormDocument::build()
bc().setApply(dialog_->button_apply);
bc().setCancel(dialog_->button_cancel);
bc().setRestore(dialog_->button_restore);
bc().addReadOnly (dialog_->button_save_defaults);
// the document paper form
paper_.reset(build_doc_paper());
@ -179,7 +180,6 @@ void FormDocument::build()
bc().addReadOnly (class_->input_doc_spacing);
bc().addReadOnly (class_->radio_auto_reset);
bc().addReadOnly (class_->button_reset_defaults);
bc().addReadOnly (class_->button_save_defaults);
// the document language form
@ -309,6 +309,9 @@ void FormDocument::update()
checkReadOnly();
fl_set_object_label(dialog_->button_save_defaults,
_("Save as Defaults"));
BufferParams const & params = lv_->buffer()->params;
class_update(params);
@ -363,7 +366,7 @@ bool FormDocument::input( FL_OBJECT * ob, long data )
lyxrc.auto_reset_options = fl_get_button(class_->radio_auto_reset);
}
if (ob == class_->button_save_defaults) {
if (ob == dialog_->button_save_defaults) {
lv_->getLyXFunc()->dispatch(LFUN_LAYOUT_SAVE_DEFAULT);
}
@ -726,7 +729,6 @@ void FormDocument::class_update(BufferParams const & params)
fl_set_button(class_->radio_auto_reset, lyxrc.auto_reset_options);
fl_set_object_label(class_->button_reset_defaults, _("Reset"));
setEnabled(class_->button_reset_defaults, !params.hasClassDefaults());
fl_set_object_label(class_->button_save_defaults, _("Save as Defaults"));
}

View File

@ -25,37 +25,43 @@ FD_form_tabbed_document * FormDocument::build_tabbed_document()
FL_OBJECT *obj;
FD_form_tabbed_document *fdui = new FD_form_tabbed_document;
fdui->form = fl_bgn_form(FL_NO_BOX, 465, 450);
fdui->form = fl_bgn_form(FL_NO_BOX, 465, 475);
fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 465, 450, "");
obj = fl_add_box(FL_UP_BOX, 0, 0, 465, 475, "");
fdui->tabbed_folder = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 20, 15, 435, 365, _("Tabbed folder"));
fl_set_object_resize(obj, FL_RESIZE_ALL);
{
char const * const dummy = N_("Cancel|^[");
fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 355, 410, 100, 30, idex(_(dummy)));
fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 355, 430, 100, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, INPUT);
{
char const * const dummy = N_("Apply|#A");
fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 245, 410, 100, 30, idex(_(dummy)));
fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 245, 430, 100, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseDeprecatedApplyCB, INPUT);
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 135, 410, 100, 30, _("OK"));
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 135, 430, 100, 30, _("OK"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseDeprecatedOKCB, INPUT);
fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 20, 380, 435, 30, "");
fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 10, 390, 435, 30, "");
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
{
char const * const dummy = N_("Restore|#R");
fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 410, 100, 30, idex(_(dummy)));
fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 430, 100, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseDeprecatedRestoreCB, INPUT);
{
char const * const dummy = N_("Save as Defaults|#v");
fdui->button_save_defaults = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 390, 170, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
fl_end_form();
fdui->form->fdui = fdui;
@ -354,7 +360,6 @@ FD_form_doc_class * FormDocument::build_doc_class()
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
fl_set_button(obj, 1);
{
char const * const dummy = N_("Skip|#K");
fdui->radio_doc_skip = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 300, 240, 110, 30, idex(_(dummy)));
@ -368,21 +373,15 @@ FD_form_doc_class * FormDocument::build_doc_class()
fdui->input_doc_spacing = obj = fl_add_input(FL_NORMAL_INPUT, 220, 240, 60, 30, "");
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
{
char const * const dummy = N_("Save as Defaults|#v");
fdui->button_save_defaults = obj = fl_add_button(FL_NORMAL_BUTTON, 305, 295, 105, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
{
char const * const dummy = N_("Reset|#R");
fdui->button_reset_defaults = obj = fl_add_button(FL_NORMAL_BUTTON, 160, 295, 100, 30, idex(_(dummy)));
fdui->button_reset_defaults = obj = fl_add_button(FL_NORMAL_BUTTON, 190, 300, 100, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
fdui->radio_auto_reset = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 20, 295, 30, 30, _("Auto Reset"));
fdui->radio_auto_reset = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 25, 300, 30, 30, _("Auto Reset"));
fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, INPUT);
obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 285, 410, 45, _("Class Defaults"));
obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 15, 290, 285, 45, _("Class Defaults"));
fl_end_form();
fdui->form->fdui = fdui;

View File

@ -9,6 +9,7 @@ extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long);
extern "C" void C_FormBaseDeprecatedApplyCB(FL_OBJECT *, long);
extern "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT *, long);
extern "C" void C_FormBaseDeprecatedRestoreCB(FL_OBJECT *, long);
extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long);
extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long);
@ -32,6 +33,7 @@ struct FD_form_tabbed_document {
FL_OBJECT *button_ok;
FL_OBJECT *text_warning;
FL_OBJECT *button_restore;
FL_OBJECT *button_save_defaults;
};
struct FD_form_doc_paper {
~FD_form_doc_paper();
@ -76,7 +78,6 @@ struct FD_form_doc_class {
FL_OBJECT *radio_doc_indent;
FL_OBJECT *radio_doc_skip;
FL_OBJECT *input_doc_spacing;
FL_OBJECT *button_save_defaults;
FL_OBJECT *button_reset_defaults;
FL_OBJECT *radio_auto_reset;
};

View File

@ -10,13 +10,13 @@ SnapGrid: 5
=============== FORM ===============
Name: form_tabbed_document
Width: 465
Height: 450
Number of Objects: 7
Height: 475
Number of Objects: 8
--------------------
class: FL_BOX
type: UP_BOX
box: 0 0 465 450
box: 0 0 465 475
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
@ -52,7 +52,7 @@ argument:
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
box: 355 410 100 30
box: 355 430 100 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
@ -70,7 +70,7 @@ argument: INPUT
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
box: 245 410 100 30
box: 245 430 100 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
@ -88,7 +88,7 @@ argument: INPUT
--------------------
class: FL_BUTTON
type: RETURN_BUTTON
box: 135 410 100 30
box: 135 430 100 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
@ -106,7 +106,7 @@ argument: INPUT
--------------------
class: FL_TEXT
type: NORMAL_TEXT
box: 20 380 435 30
box: 10 390 435 30
boxtype: FL_FLAT_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE
@ -124,7 +124,7 @@ argument:
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
box: 10 410 100 30
box: 10 430 100 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
@ -139,6 +139,24 @@ name: button_restore
callback: C_FormBaseDeprecatedRestoreCB
argument: INPUT
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
box: 10 390 170 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label: Save as Defaults|#v
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_save_defaults
callback: C_FormBaseDeprecatedInputCB
argument: INPUT
=============== FORM ===============
Name: form_doc_paper
Width: 440
@ -653,7 +671,7 @@ argument:
Name: form_doc_class
Width: 440
Height: 345
Number of Objects: 29
Number of Objects: 28
--------------------
class: FL_BOX
@ -1109,25 +1127,7 @@ argument: INPUT
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
box: 305 295 105 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label: Save as Defaults|#v
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_save_defaults
callback: C_FormBaseDeprecatedInputCB
argument: INPUT
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
box: 160 295 100 30
box: 190 300 100 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
@ -1145,7 +1145,7 @@ argument: INPUT
--------------------
class: FL_CHECKBUTTON
type: PUSH_BUTTON
box: 20 295 30 30
box: 25 300 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_CENTER
@ -1163,7 +1163,7 @@ argument: INPUT
--------------------
class: FL_LABELFRAME
type: ENGRAVED_FRAME
box: 10 285 410 45
box: 15 290 285 45
boxtype: FL_NO_BOX
colors: FL_BLACK FL_COL1
alignment: FL_ALIGN_TOP_LEFT

View File

@ -532,7 +532,7 @@ void MenuLayoutSave(BufferView * bv)
return;
if (AskQuestion(_("Do you want to save the current settings"),
_("for Character, Document, Paper and Quotes"),
_("for document layout"),
_("as default for new documents?")))
bv->buffer()->saveParamsAsDefaults();
}

View File

@ -214,7 +214,7 @@ void LyXRC::setDefaults() {
override_x_deadkeys = true;
autosave = 300;
auto_region_delete = true;
auto_reset_options = true;
auto_reset_options = false;
ascii_linelen = 65;
num_lastfiles = 4;
check_lastfiles = true;