diff --git a/ChangeLog b/ChangeLog index d95cc8dce4..b19c7e1181 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2000-08-29 Allan Rae + + * lib/bind/xemacs.bind: update a binding due to Juergen's recent work + + * src/frontends/xforms/FormDocument.C (checkReadOnly): new function + (EnableDocumentLayout): removed + (DisableDocumentLayout): removed + (build): make use of ButtonController's read-only handling to + de/activate various objects. Replaces both of the above functions. + + * src/frontends/xforms/ButtonController.h (readWrite): was read_write + (readOnly): was read_only + (refresh): fixed dumb mistakes with read_only_ handling + + * src/frontends/xforms/forms/form_document.fd: + * src/frontends/xforms/forms/form_tabular.fd: Use FL_FLAT_BOX for the + tabbed dialogs so the tabs look more like tabs and so its easier to + work out which is the current tab. + + * src/lyx_gui_misc.C (updateAllVisibleBufferRelatedDialogs): fix + segfault with form_table + + * src/frontends/ButtonPolicies.C: All policies now support UNDO_ALL. + 2000-08-28 Juergen Vigna * acconfig.h: added USE_PSPELL. diff --git a/lib/bind/xemacs.bind b/lib/bind/xemacs.bind index 45c3bcf205..a7f9bcc121 100644 --- a/lib/bind/xemacs.bind +++ b/lib/bind/xemacs.bind @@ -275,7 +275,7 @@ \bind "C-c C-e v" "layout Quote" \bind "C-c C-e f" "figure-insert" ## should be figure-float -\bind "C-c C-e t" "table-insert" ## should be table-float +\bind "C-c C-e t" "dialog-tabular-insert" ## should be table-float \bind "C-c percent" "layout Comment" diff --git a/src/frontends/ButtonPolicies.C b/src/frontends/ButtonPolicies.C index 384020a1d6..3295c8d6ed 100644 --- a/src/frontends/ButtonPolicies.C +++ b/src/frontends/ButtonPolicies.C @@ -129,8 +129,8 @@ OkCancelPolicy::OkCancelPolicy() { // Build the state output map outputs_[INITIAL] = CLOSE; - outputs_[VALID] = OKAY | CANCEL; - outputs_[INVALID] = CANCEL; + outputs_[VALID] = UNDO_ALL | OKAY | CANCEL; + outputs_[INVALID] = UNDO_ALL | CANCEL; // Build the state machine one state at a time // NOTE: Since CANCEL and HIDE always go to INITIAL they are @@ -148,11 +148,13 @@ OkCancelPolicy::OkCancelPolicy() state_machine_[VALID][SMI_READ_WRITE] = VALID; state_machine_[VALID][SMI_INVALID] = INVALID; state_machine_[VALID][SMI_OKAY] = INITIAL; + state_machine_[VALID][SMI_UNDO_ALL] = INITIAL; // State::INVALID state_machine_[INVALID][SMI_VALID] = VALID; state_machine_[INVALID][SMI_INVALID] = INVALID; state_machine_[INVALID][SMI_READ_ONLY] = INVALID; state_machine_[INVALID][SMI_READ_WRITE] = INVALID; + state_machine_[INVALID][SMI_UNDO_ALL] = INITIAL; } @@ -182,11 +184,11 @@ OkCancelReadOnlyPolicy::OkCancelReadOnlyPolicy() { // Build the state output map outputs_[INITIAL] = CLOSE; - outputs_[VALID] = OKAY | CANCEL; - outputs_[INVALID] = CANCEL; + outputs_[VALID] = UNDO_ALL | OKAY | CANCEL; + outputs_[INVALID] = UNDO_ALL | CANCEL; outputs_[RO_INITIAL] = CLOSE; - outputs_[RO_VALID] = CANCEL; - outputs_[RO_INVALID] = CANCEL; + outputs_[RO_VALID] = UNDO_ALL | CANCEL; + outputs_[RO_INVALID] = UNDO_ALL | CANCEL; // Build the state machine one state at a time // NOTE: Since CANCEL and HIDE always go to INITIAL they are @@ -203,11 +205,13 @@ OkCancelReadOnlyPolicy::OkCancelReadOnlyPolicy() state_machine_[VALID][SMI_READ_WRITE] = VALID; state_machine_[VALID][SMI_INVALID] = INVALID; state_machine_[VALID][SMI_OKAY] = INITIAL; + state_machine_[VALID][SMI_UNDO_ALL] = INITIAL; state_machine_[VALID][SMI_READ_ONLY] = RO_VALID; // State::INVALID state_machine_[INVALID][SMI_INVALID] = INVALID; state_machine_[INVALID][SMI_READ_WRITE] = INVALID; state_machine_[INVALID][SMI_VALID] = VALID; + state_machine_[INVALID][SMI_UNDO_ALL] = INITIAL; state_machine_[INVALID][SMI_READ_ONLY] = RO_INVALID; // State::RO_INITIAL state_machine_[RO_INITIAL][SMI_READ_ONLY] = RO_INITIAL; @@ -219,11 +223,13 @@ OkCancelReadOnlyPolicy::OkCancelReadOnlyPolicy() state_machine_[RO_VALID][SMI_READ_ONLY] = RO_VALID; state_machine_[RO_VALID][SMI_INVALID] = RO_INVALID; state_machine_[RO_VALID][SMI_READ_WRITE] = VALID; + state_machine_[RO_VALID][SMI_UNDO_ALL] = RO_INITIAL; // State::RO_INVALID state_machine_[RO_INVALID][SMI_READ_ONLY] = RO_INVALID; state_machine_[RO_INVALID][SMI_INVALID] = RO_INVALID; state_machine_[RO_INVALID][SMI_VALID] = RO_VALID; state_machine_[RO_INVALID][SMI_READ_WRITE] = INVALID; + state_machine_[RO_INVALID][SMI_UNDO_ALL] = RO_INITIAL; } @@ -255,11 +261,11 @@ NoRepeatedApplyReadOnlyPolicy::NoRepeatedApplyReadOnlyPolicy() { // Build the state output map outputs_[INITIAL] = CLOSE; - outputs_[VALID] = OKAY | APPLY | CANCEL; - outputs_[INVALID] = CANCEL; + outputs_[VALID] = UNDO_ALL | OKAY | APPLY | CANCEL; + outputs_[INVALID] = UNDO_ALL | CANCEL; outputs_[RO_INITIAL] = CLOSE; - outputs_[RO_VALID] = CANCEL; - outputs_[RO_INVALID] = CANCEL; + outputs_[RO_VALID] = UNDO_ALL | CANCEL; + outputs_[RO_INVALID] = UNDO_ALL | CANCEL; // Build the state machine one state at a time // NOTE: Since CANCEL and HIDE always go to INITIAL they are @@ -277,11 +283,13 @@ NoRepeatedApplyReadOnlyPolicy::NoRepeatedApplyReadOnlyPolicy() state_machine_[VALID][SMI_INVALID] = INVALID; state_machine_[VALID][SMI_OKAY] = INITIAL; state_machine_[VALID][SMI_APPLY] = INITIAL; + state_machine_[VALID][SMI_UNDO_ALL] = INITIAL; state_machine_[VALID][SMI_READ_ONLY] = RO_VALID; // State::INVALID state_machine_[INVALID][SMI_INVALID] = INVALID; state_machine_[INVALID][SMI_READ_WRITE] = INVALID; state_machine_[INVALID][SMI_VALID] = VALID; + state_machine_[INVALID][SMI_UNDO_ALL] = INITIAL; state_machine_[INVALID][SMI_READ_ONLY] = RO_INVALID; // State::RO_INITIAL state_machine_[RO_INITIAL][SMI_READ_ONLY] = RO_INITIAL; @@ -293,11 +301,13 @@ NoRepeatedApplyReadOnlyPolicy::NoRepeatedApplyReadOnlyPolicy() state_machine_[RO_VALID][SMI_READ_ONLY] = RO_VALID; state_machine_[RO_VALID][SMI_INVALID] = RO_INVALID; state_machine_[RO_VALID][SMI_READ_WRITE] = VALID; + state_machine_[RO_VALID][SMI_UNDO_ALL] = RO_INITIAL; // State::RO_INVALID state_machine_[RO_INVALID][SMI_INVALID] = RO_INVALID; state_machine_[RO_INVALID][SMI_READ_ONLY] = RO_INVALID; state_machine_[RO_INVALID][SMI_VALID] = RO_VALID; state_machine_[RO_INVALID][SMI_READ_WRITE] = INVALID; + state_machine_[RO_INVALID][SMI_UNDO_ALL] = RO_INITIAL; } @@ -329,13 +339,13 @@ OkApplyCancelReadOnlyPolicy::OkApplyCancelReadOnlyPolicy() { // Build the state output map outputs_[INITIAL] = CLOSE; - outputs_[VALID] = OKAY | APPLY | CANCEL; - outputs_[INVALID] = CANCEL; + outputs_[VALID] = UNDO_ALL | OKAY | APPLY | CANCEL; + outputs_[INVALID] = UNDO_ALL | CANCEL; outputs_[APPLIED] = OKAY | APPLY | CLOSE; outputs_[RO_INITIAL] = CLOSE; - outputs_[RO_VALID] = CANCEL; - outputs_[RO_INVALID] = CANCEL; - outputs_[RO_APPLIED] = CANCEL; + outputs_[RO_VALID] = UNDO_ALL | CANCEL; + outputs_[RO_INVALID] = UNDO_ALL | CANCEL; + outputs_[RO_APPLIED] = CLOSE; // Build the state machine one state at a time // NOTE: Since CANCEL and HIDE always go to INITIAL they are @@ -352,12 +362,14 @@ OkApplyCancelReadOnlyPolicy::OkApplyCancelReadOnlyPolicy() state_machine_[VALID][SMI_READ_WRITE] = VALID; state_machine_[VALID][SMI_INVALID] = INVALID; state_machine_[VALID][SMI_OKAY] = INITIAL; + state_machine_[VALID][SMI_UNDO_ALL] = INITIAL; state_machine_[VALID][SMI_APPLY] = APPLIED; state_machine_[VALID][SMI_READ_ONLY] = RO_VALID; // State::INVALID state_machine_[INVALID][SMI_INVALID] = INVALID; state_machine_[INVALID][SMI_READ_WRITE] = INVALID; state_machine_[INVALID][SMI_VALID] = VALID; + state_machine_[INVALID][SMI_UNDO_ALL] = INITIAL; state_machine_[INVALID][SMI_READ_ONLY] = RO_INVALID; // State::APPLIED state_machine_[APPLIED][SMI_APPLY] = APPLIED; @@ -376,11 +388,13 @@ OkApplyCancelReadOnlyPolicy::OkApplyCancelReadOnlyPolicy() state_machine_[RO_VALID][SMI_READ_ONLY] = RO_VALID; state_machine_[RO_VALID][SMI_INVALID] = RO_INVALID; state_machine_[RO_VALID][SMI_READ_WRITE] = VALID; + state_machine_[RO_VALID][SMI_UNDO_ALL] = RO_INITIAL; // State::RO_INVALID state_machine_[RO_INVALID][SMI_INVALID] = RO_INVALID; state_machine_[RO_INVALID][SMI_READ_ONLY] = RO_INVALID; state_machine_[RO_INVALID][SMI_VALID] = RO_VALID; state_machine_[RO_INVALID][SMI_READ_WRITE] = INVALID; + state_machine_[RO_INVALID][SMI_UNDO_ALL] = RO_INITIAL; // State::RO_APPLIED state_machine_[RO_APPLIED][SMI_READ_ONLY] = RO_APPLIED; state_machine_[RO_APPLIED][SMI_INVALID] = RO_INVALID; @@ -417,8 +431,8 @@ OkApplyCancelPolicy::OkApplyCancelPolicy() { // Build the state output map outputs_[INITIAL] = CLOSE; - outputs_[VALID] = OKAY | APPLY | CANCEL; - outputs_[INVALID] = CANCEL; + outputs_[VALID] = UNDO_ALL | OKAY | APPLY | CANCEL; + outputs_[INVALID] = UNDO_ALL | CANCEL; outputs_[APPLIED] = OKAY | APPLY | CLOSE; // Build the state machine one state at a time @@ -437,12 +451,14 @@ OkApplyCancelPolicy::OkApplyCancelPolicy() state_machine_[VALID][SMI_READ_WRITE] = VALID; state_machine_[VALID][SMI_INVALID] = INVALID; state_machine_[VALID][SMI_OKAY] = INITIAL; + state_machine_[VALID][SMI_UNDO_ALL] = INITIAL; state_machine_[VALID][SMI_APPLY] = APPLIED; // State::INVALID state_machine_[INVALID][SMI_INVALID] = INVALID; state_machine_[INVALID][SMI_READ_ONLY] = INVALID; state_machine_[INVALID][SMI_READ_WRITE] = INVALID; state_machine_[INVALID][SMI_VALID] = VALID; + state_machine_[INVALID][SMI_UNDO_ALL] = INITIAL; // State::APPLIED state_machine_[APPLIED][SMI_APPLY] = APPLIED; state_machine_[APPLIED][SMI_READ_ONLY] = APPLIED; @@ -481,8 +497,8 @@ NoRepeatedApplyPolicy::NoRepeatedApplyPolicy() { // Build the state output map outputs_[INITIAL] = CLOSE; - outputs_[VALID] = OKAY | APPLY | CANCEL; - outputs_[INVALID] = CANCEL; + outputs_[VALID] = UNDO_ALL | OKAY | APPLY | CANCEL; + outputs_[INVALID] = UNDO_ALL | CANCEL; // Build the state machine one state at a time // NOTE: Since CANCEL and HIDE always go to INITIAL they are @@ -501,11 +517,13 @@ NoRepeatedApplyPolicy::NoRepeatedApplyPolicy() state_machine_[VALID][SMI_INVALID] = INVALID; state_machine_[VALID][SMI_OKAY] = INITIAL; state_machine_[VALID][SMI_APPLY] = INITIAL; + state_machine_[VALID][SMI_UNDO_ALL] = INITIAL; // State::INVALID state_machine_[INVALID][SMI_INVALID] = INVALID; state_machine_[INVALID][SMI_READ_ONLY] = INVALID; state_machine_[INVALID][SMI_READ_WRITE] = INVALID; state_machine_[INVALID][SMI_VALID] = VALID; + state_machine_[INVALID][SMI_UNDO_ALL] = INITIAL; } diff --git a/src/frontends/xforms/ButtonController.h b/src/frontends/xforms/ButtonController.h index 158ca6c2a3..2add560b75 100644 --- a/src/frontends/xforms/ButtonController.h +++ b/src/frontends/xforms/ButtonController.h @@ -103,7 +103,7 @@ public: void hide() { input(ButtonPolicy::SMI_HIDE); } /// Passthrough function -- returns its input value - bool read_only(bool ro = true) + bool readOnly(bool ro = true) { if (ro) { input(ButtonPolicy::SMI_READ_ONLY); @@ -113,7 +113,7 @@ public: return ro; } /// - void read_write() + void readWrite() { read_only(false); } /// Passthrough function -- returns its input value bool valid(bool v = true) @@ -175,7 +175,7 @@ public: iter != read_only_.end(); ++iter) { fl_deactivate_object(*iter); - fl_set_object_lcol(undo_all_, + fl_set_object_lcol(*iter, FL_INACTIVE); } } else { @@ -183,8 +183,8 @@ public: iter = read_only_.begin(); iter != read_only_.end(); ++iter) { - fl_activate_object(undo_all_); - fl_set_object_lcol(undo_all_, + fl_activate_object(*iter); + fl_set_object_lcol(*iter, FL_BLACK); } } diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index 3f84108046..cff406f22f 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -89,7 +89,7 @@ void FormDocument::build() // the tabbed folder dialog_ = build_tabbed_document(); - // manage the restore, save, apply and cancel/close buttons + // manage the restore, ok, apply and cancel/close buttons bc_->setOK(dialog_->button_ok); bc_->setApply(dialog_->button_apply); bc_->setCancel(dialog_->button_cancel); @@ -116,6 +116,22 @@ void FormDocument::build() fl_set_input_return(paper_->input_head_sep, FL_RETURN_ALWAYS); fl_set_input_return(paper_->input_foot_skip, FL_RETURN_ALWAYS); + bc_->addReadOnly (paper_->choice_paperpackage); + bc_->addReadOnly (paper_->greoup_radio_orientation); + bc_->addReadOnly (paper_->radio_portrait); + bc_->addReadOnly (paper_->radio_landscape); + bc_->addReadOnly (paper_->choice_papersize2); + bc_->addReadOnly (paper_->push_use_geometry); + bc_->addReadOnly (paper_->input_custom_width); + bc_->addReadOnly (paper_->input_custom_height); + bc_->addReadOnly (paper_->input_top_margin); + bc_->addReadOnly (paper_->input_bottom_margin); + bc_->addReadOnly (paper_->input_left_margin); + bc_->addReadOnly (paper_->input_right_margin); + bc_->addReadOnly (paper_->input_head_height); + bc_->addReadOnly (paper_->input_head_sep); + bc_->addReadOnly (paper_->input_foot_skip); + // the document class form class_ = build_doc_class(); fl_clear_choice(class_->choice_doc_class); @@ -137,6 +153,22 @@ void FormDocument::build() fl_set_input_return(class_->input_doc_skip, FL_RETURN_ALWAYS); fl_set_input_return(class_->input_doc_spacing, FL_RETURN_ALWAYS); + bc_->addReadOnly (class_->radio_doc_indent); + bc_->addReadOnly (class_->radio_doc_skip); + bc_->addReadOnly (class_->choice_doc_class); + bc_->addReadOnly (class_->choice_doc_pagestyle); + bc_->addReadOnly (class_->choice_doc_fonts); + bc_->addReadOnly (class_->choice_doc_fontsize); + bc_->addReadOnly (class_->radio_doc_sides_one); + bc_->addReadOnly (class_->radio_doc_sides_two); + bc_->addReadOnly (class_->radio_doc_columns_one); + bc_->addReadOnly (class_->radio_doc_columns_two); + bc_->addReadOnly (class_->input_doc_extra); + bc_->addReadOnly (class_->input_doc_skip); + bc_->addReadOnly (class_->choice_doc_skip); + bc_->addReadOnly (class_->choice_doc_spacing); + bc_->addReadOnly (class_->input_doc_spacing); + // the document language form language_ = build_doc_language(); fl_addto_choice(language_->choice_inputenc, @@ -161,6 +193,9 @@ void FormDocument::build() _(" ``text'' | ''text'' | ,,text`` | ,,text'' |" " «text» | »text« ")); + bc_->addReadOnly (language_->choice_language); + bc_->addReadOnly (language_->choice_inputenc); + // the document options form options_ = build_doc_options(); fl_set_counter_bounds(options_->slider_secnumdepth,-2,5); @@ -172,7 +207,13 @@ void FormDocument::build() for (n=0; tex_graphics[n][0]; ++n) { fl_addto_choice(options_->choice_postscript_driver, tex_graphics[n]); } - + + bc_->addReadOnly (options_->slider_secnumdepth); + bc_->addReadOnly (options_->slider_tocdepth); + bc_->addReadOnly (options_->check_use_amsmath); + bc_->addReadOnly (options_->input_float_placement); + bc_->addReadOnly (options_->choice_postscript_driver); + // the document bullets form bullets_ = build_doc_bullet(); fl_addto_choice(bullets_->choice_bullet_size, @@ -500,15 +541,8 @@ void FormDocument::update() { if (!dialog_) return; - fl_hide_object(dialog_->text_warning); - EnableDocumentLayout(); - if (lv_->buffer()->isReadonly()) { - DisableDocumentLayout(); - fl_set_object_label(dialog_->text_warning, - _("Document is read-only." - " No changes to layout permitted.")); - fl_show_object(dialog_->text_warning); - } + + checkReadOnly(); BufferParams const & params = lv_->buffer()->params; @@ -787,6 +821,20 @@ void FormDocument::ChoiceClassCB(FL_OBJECT * ob, long) pre->bc_->valid(pre->CheckDocumentInput(ob,0)); } +void FormDocument::checkReadOnly() +{ + if (bc_->readOnly(lv_->buffer()->isReadonly())) { + combo_language->deactivate(); + fl_set_object_label(dialog_->text_warning, + _("Document is read-only." + " No changes to layout permitted.")); + fl_show_object(dialog_->text_warning); + } else { + combo_language->activate(); + fl_hide_object(dialog_->text_warning); + } +} + void FormDocument::checkMarginValues() { int allEmpty; @@ -1033,97 +1081,6 @@ void FormDocument::BulletBMTable(FL_OBJECT * ob, long /*data*/ ) param.temp_bullets[current_bullet_depth].c_str()); } -void FormDocument::EnableDocumentLayout() -{ - fl_activate_object (class_->radio_doc_indent); - fl_activate_object (class_->radio_doc_skip); - fl_activate_object (class_->choice_doc_class); - fl_activate_object (class_->choice_doc_pagestyle); - fl_activate_object (class_->choice_doc_fonts); - fl_activate_object (class_->choice_doc_fontsize); - fl_activate_object (class_->radio_doc_sides_one); - fl_activate_object (class_->radio_doc_sides_two); - fl_activate_object (class_->radio_doc_columns_one); - fl_activate_object (class_->radio_doc_columns_two); - fl_activate_object (class_->input_doc_extra); - fl_activate_object (class_->input_doc_skip); - fl_activate_object (class_->choice_doc_skip); - fl_activate_object (class_->choice_doc_spacing); - fl_activate_object (class_->input_doc_spacing); - - fl_activate_object (language_->choice_language); - combo_language->activate(); - fl_activate_object (language_->choice_language); - fl_activate_object (language_->choice_inputenc); - - fl_activate_object (options_->slider_secnumdepth); - fl_activate_object (options_->slider_tocdepth); - fl_activate_object (options_->check_use_amsmath); - fl_activate_object (options_->input_float_placement); - fl_activate_object (options_->choice_postscript_driver); - - fl_activate_object (paper_->choice_paperpackage); - fl_activate_object (paper_->greoup_radio_orientation); - fl_activate_object (paper_->radio_portrait); - fl_activate_object (paper_->radio_landscape); - fl_activate_object (paper_->choice_papersize2); - fl_activate_object (paper_->push_use_geometry); - fl_activate_object (paper_->input_custom_width); - fl_activate_object (paper_->input_custom_height); - fl_activate_object (paper_->input_top_margin); - fl_activate_object (paper_->input_bottom_margin); - fl_activate_object (paper_->input_left_margin); - fl_activate_object (paper_->input_right_margin); - fl_activate_object (paper_->input_head_height); - fl_activate_object (paper_->input_head_sep); - fl_activate_object (paper_->input_foot_skip); -} - -void FormDocument::DisableDocumentLayout() -{ - fl_deactivate_object (class_->radio_doc_indent); - fl_deactivate_object (class_->radio_doc_skip); - fl_deactivate_object (class_->choice_doc_class); - fl_deactivate_object (class_->choice_doc_pagestyle); - fl_deactivate_object (class_->choice_doc_fonts); - fl_deactivate_object (class_->choice_doc_fontsize); - fl_deactivate_object (class_->radio_doc_sides_one); - fl_deactivate_object (class_->radio_doc_sides_two); - fl_deactivate_object (class_->radio_doc_columns_one); - fl_deactivate_object (class_->radio_doc_columns_two); - fl_deactivate_object (class_->input_doc_extra); - fl_deactivate_object (class_->input_doc_skip); - fl_deactivate_object (class_->choice_doc_skip); - fl_deactivate_object (class_->choice_doc_spacing); - fl_deactivate_object (class_->input_doc_spacing); - - fl_deactivate_object (language_->choice_language); - combo_language->deactivate(); - fl_deactivate_object (language_->choice_inputenc); - - fl_deactivate_object (options_->slider_secnumdepth); - fl_deactivate_object (options_->slider_tocdepth); - fl_deactivate_object (options_->check_use_amsmath); - fl_deactivate_object (options_->input_float_placement); - fl_deactivate_object (options_->choice_postscript_driver); - - fl_deactivate_object (paper_->choice_paperpackage); - fl_deactivate_object (paper_->greoup_radio_orientation); - fl_deactivate_object (paper_->radio_portrait); - fl_deactivate_object (paper_->radio_landscape); - fl_deactivate_object (paper_->choice_papersize2); - fl_deactivate_object (paper_->push_use_geometry); - fl_deactivate_object (paper_->input_custom_width); - fl_deactivate_object (paper_->input_custom_height); - fl_deactivate_object (paper_->input_top_margin); - fl_deactivate_object (paper_->input_bottom_margin); - fl_deactivate_object (paper_->input_left_margin); - fl_deactivate_object (paper_->input_right_margin); - fl_deactivate_object (paper_->input_head_height); - fl_deactivate_object (paper_->input_head_sep); - fl_deactivate_object (paper_->input_foot_skip); -} - void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long) { ProhibitInput(lv_->view()); @@ -1152,15 +1109,8 @@ void FormDocument::UpdateLayoutDocument(BufferParams const & params) { if (!dialog_) return; - fl_hide_object(dialog_->text_warning); - EnableDocumentLayout(); - if (lv_->buffer()->isReadonly()) { - DisableDocumentLayout(); - fl_set_object_label(dialog_->text_warning, - _("Document is read-only." - " No changes to layout permitted.")); - fl_show_object(dialog_->text_warning); - } + + checkReadOnly(); class_update(params); paper_update(params); language_update(params); diff --git a/src/frontends/xforms/FormDocument.h b/src/frontends/xforms/FormDocument.h index e5b64bf23a..323b2ebc1b 100644 --- a/src/frontends/xforms/FormDocument.h +++ b/src/frontends/xforms/FormDocument.h @@ -83,10 +83,6 @@ public: }; private: - /// - void EnableDocumentLayout(); - /// - void DisableDocumentLayout(); /// bool CheckDocumentInput(FL_OBJECT * ob, long); /// @@ -102,6 +98,8 @@ private: /// void checkMarginValues(); /// + void checkReadOnly(); + /// void CheckChoiceClass(FL_OBJECT * ob, long); /// void UpdateLayoutDocument(BufferParams const & params); diff --git a/src/frontends/xforms/form_document.C b/src/frontends/xforms/form_document.C index db6da6a249..aecbb3b83f 100644 --- a/src/frontends/xforms/form_document.C +++ b/src/frontends/xforms/form_document.C @@ -68,7 +68,7 @@ FD_form_doc_paper * FormDocument::build_doc_paper() fdui->form = fl_bgn_form(FL_NO_BOX, 440, 345); fdui->form->u_vdata = this; - obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 345, ""); + obj = fl_add_box(FL_FLAT_BOX, 0, 0, 440, 345, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 230, 85, 200, 100, ""); fl_set_object_color(obj, FL_COL1, FL_COL1); fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT); @@ -189,7 +189,7 @@ FD_form_doc_class * FormDocument::build_doc_class() fdui->form = fl_bgn_form(FL_NO_BOX, 440, 345); fdui->form->u_vdata = this; - obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 345, ""); + obj = fl_add_box(FL_FLAT_BOX, 0, 0, 440, 345, ""); obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 300, 200, 120, 80, _("Separation")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lstyle(obj, FL_BOLD_STYLE); @@ -298,7 +298,7 @@ FD_form_doc_language * FormDocument::build_doc_language() fdui->form = fl_bgn_form(FL_NO_BOX, 440, 345); fdui->form->u_vdata = this; - obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 345, ""); + obj = fl_add_box(FL_FLAT_BOX, 0, 0, 440, 345, ""); obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 40, 120, 290, 110, _("Quote Style ")); fdui->choice_inputenc = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 70, 190, 30, idex(_("Encoding:|#D"))); fl_set_button_shortcut(obj, scex(_("Encoding:|#D")), 1); @@ -348,7 +348,7 @@ FD_form_doc_options * FormDocument::build_doc_options() fdui->form = fl_bgn_form(FL_NO_BOX, 440, 345); fdui->form->u_vdata = this; - obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 345, ""); + obj = fl_add_box(FL_FLAT_BOX, 0, 0, 440, 345, ""); fdui->input_float_placement = obj = fl_add_input(FL_NORMAL_INPUT, 155, 60, 120, 30, idex(_("Float Placement:|#L"))); fl_set_button_shortcut(obj, scex(_("Float Placement:|#L")), 1); fl_set_object_lsize(obj, FL_NORMAL_SIZE); @@ -393,7 +393,7 @@ FD_form_doc_bullet * FormDocument::build_doc_bullet() fdui->form = fl_bgn_form(FL_NO_BOX, 440, 345); fdui->form->u_vdata = this; fl_set_border_width(-1); - obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 345, ""); + obj = fl_add_box(FL_FLAT_BOX, 0, 0, 440, 345, ""); fl_set_border_width(-3); fdui->bmtable_bullet_panel = obj = fl_add_bmtable(1, 90, 105, 265, 180, ""); fl_set_object_callback(obj, BulletBMTableCB, 0); diff --git a/src/frontends/xforms/form_tabular.C b/src/frontends/xforms/form_tabular.C index b25f7d5fd3..51d53ae80c 100644 --- a/src/frontends/xforms/form_tabular.C +++ b/src/frontends/xforms/form_tabular.C @@ -63,7 +63,7 @@ FD_form_tabular_options * FormTabular::build_tabular_options() fdui->form = fl_bgn_form(FL_NO_BOX, 505, 227); fdui->form->u_vdata = this; - obj = fl_add_box(FL_UP_BOX, 0, 0, 505, 227, ""); + obj = fl_add_box(FL_FLAT_BOX, 0, 0, 505, 227, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 280, 20, 120, 75, ""); fl_set_object_color(obj, FL_COL1, FL_COL1); fdui->button_append_column = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 40, 120, 30, idex(_("Append Column|#A"))); @@ -121,7 +121,7 @@ FD_form_column_options * FormTabular::build_column_options() fdui->form = fl_bgn_form(FL_NO_BOX, 505, 227); fdui->form->u_vdata = this; - obj = fl_add_box(FL_UP_BOX, 0, 0, 505, 227, ""); + obj = fl_add_box(FL_FLAT_BOX, 0, 0, 505, 227, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 20, 20, 170, 105, ""); fl_set_object_color(obj, FL_COL1, FL_COL1); fl_set_object_lsize(obj, FL_NORMAL_SIZE); @@ -220,7 +220,7 @@ FD_form_cell_options * FormTabular::build_cell_options() fdui->form = fl_bgn_form(FL_NO_BOX, 505, 227); fdui->form->u_vdata = this; - obj = fl_add_box(FL_UP_BOX, 0, 0, 505, 227, ""); + obj = fl_add_box(FL_FLAT_BOX, 0, 0, 505, 227, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 335, 115, 155, 100, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 115, 180, 100, ""); fl_set_object_color(obj, FL_COL1, FL_COL1); @@ -331,7 +331,7 @@ FD_form_longtable_options * FormTabular::build_longtable_options() fdui->form = fl_bgn_form(FL_NO_BOX, 505, 227); fdui->form->u_vdata = this; - obj = fl_add_box(FL_UP_BOX, 0, 0, 505, 227, ""); + obj = fl_add_box(FL_FLAT_BOX, 0, 0, 505, 227, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 20, 100, 75, ""); obj = fl_add_text(FL_NORMAL_TEXT, 15, 10, 85, 20, _("Header")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); diff --git a/src/frontends/xforms/forms/form_document.C.patch b/src/frontends/xforms/forms/form_document.C.patch index 2368bc167f..58abaf2d86 100644 --- a/src/frontends/xforms/forms/form_document.C.patch +++ b/src/frontends/xforms/forms/form_document.C.patch @@ -14,7 +14,7 @@ fdui->form = fl_bgn_form(FL_NO_BOX, 440, 345); fdui->form->u_vdata = this; + fl_set_border_width(-1); - obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 345, ""); + obj = fl_add_box(FL_FLAT_BOX, 0, 0, 440, 345, ""); - fdui->bmtable_bullet_panel = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 90, 105, 260, 180, ""); - fl_set_object_boxtype(obj, FL_NO_BOX); - fl_set_pixmapbutton_file(obj, _("/nfs/sinco/source/lyx/lyx-devel/lib/images/psnfss2.xpm")); diff --git a/src/frontends/xforms/forms/form_document.fd b/src/frontends/xforms/forms/form_document.fd index 2e7fd4aad6..ca35a70931 100644 --- a/src/frontends/xforms/forms/form_document.fd +++ b/src/frontends/xforms/forms/form_document.fd @@ -147,9 +147,9 @@ Number of Objects: 28 -------------------- class: FL_BOX -type: UP_BOX +type: FLAT_BOX box: 0 0 440 345 -boxtype: FL_UP_BOX +boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE @@ -377,7 +377,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_portrait callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_CHECKBUTTON @@ -395,7 +395,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_landscape callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_END_GROUP @@ -467,7 +467,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: push_use_geometry callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_INPUT @@ -657,9 +657,9 @@ Number of Objects: 25 -------------------- class: FL_BOX -type: UP_BOX +type: FLAT_BOX box: 0 0 440 345 -boxtype: FL_UP_BOX +boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE @@ -743,7 +743,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_doc_fonts callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_CHOICE @@ -761,7 +761,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_doc_fontsize callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_CHOICE @@ -797,7 +797,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_doc_pagestyle callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_CHOICE @@ -833,7 +833,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_doc_extra callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_INPUT @@ -905,7 +905,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_doc_sides_one callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_CHECKBUTTON @@ -923,7 +923,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_doc_sides_two callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_END_GROUP @@ -977,7 +977,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_doc_columns_one callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_CHECKBUTTON @@ -995,7 +995,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_doc_columns_two callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_END_GROUP @@ -1049,7 +1049,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_doc_indent callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_CHECKBUTTON @@ -1067,7 +1067,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_doc_skip callback: C_FormDocumentInputCB -argument: +argument: 0 value: 1 -------------------- @@ -1114,9 +1114,9 @@ Number of Objects: 9 -------------------- class: FL_BOX -type: UP_BOX +type: FLAT_BOX box: 0 0 440 345 -boxtype: FL_UP_BOX +boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE @@ -1164,7 +1164,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_inputenc callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_CHOICE @@ -1182,7 +1182,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_quotes_language callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_BEGIN_GROUP @@ -1218,7 +1218,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_single callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_CHECKBUTTON @@ -1236,7 +1236,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_double callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_END_GROUP @@ -1272,7 +1272,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_language callback: C_FormDocumentInputCB -argument: +argument: 0 =============== FORM =============== Name: form_doc_options @@ -1282,9 +1282,9 @@ Number of Objects: 6 -------------------- class: FL_BOX -type: UP_BOX +type: FLAT_BOX box: 0 0 440 345 -boxtype: FL_UP_BOX +boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE @@ -1314,7 +1314,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_float_placement callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_COUNTER @@ -1332,7 +1332,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: slider_secnumdepth callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_COUNTER @@ -1350,7 +1350,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: slider_tocdepth callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_CHOICE @@ -1368,7 +1368,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: choice_postscript_driver callback: C_FormDocumentInputCB -argument: +argument: 0 -------------------- class: FL_CHECKBUTTON @@ -1386,7 +1386,7 @@ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: check_use_amsmath callback: C_FormDocumentInputCB -argument: +argument: 0 =============== FORM =============== Name: form_doc_bullet @@ -1396,9 +1396,9 @@ Number of Objects: 20 -------------------- class: FL_BOX -type: UP_BOX +type: FLAT_BOX box: 0 0 440 345 -boxtype: FL_UP_BOX +boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE diff --git a/src/frontends/xforms/forms/form_tabular.fd b/src/frontends/xforms/forms/form_tabular.fd index 62c1999092..8b2f61982f 100644 --- a/src/frontends/xforms/forms/form_tabular.fd +++ b/src/frontends/xforms/forms/form_tabular.fd @@ -129,9 +129,9 @@ Number of Objects: 11 -------------------- class: FL_BOX -type: UP_BOX +type: FLAT_BOX box: 0 0 505 227 -boxtype: FL_UP_BOX +boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE @@ -333,9 +333,9 @@ Number of Objects: 21 -------------------- class: FL_BOX -type: UP_BOX +type: FLAT_BOX box: 0 0 505 227 -boxtype: FL_UP_BOX +boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE @@ -717,9 +717,9 @@ Number of Objects: 26 -------------------- class: FL_BOX -type: UP_BOX +type: FLAT_BOX box: 0 0 505 227 -boxtype: FL_UP_BOX +boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE @@ -1191,9 +1191,9 @@ Number of Objects: 12 -------------------- class: FL_BOX -type: UP_BOX +type: FLAT_BOX box: 0 0 505 227 -boxtype: FL_UP_BOX +boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE diff --git a/src/lyx_gui_misc.C b/src/lyx_gui_misc.C index 32eeb878f9..449c9b6442 100644 --- a/src/lyx_gui_misc.C +++ b/src/lyx_gui_misc.C @@ -221,10 +221,11 @@ void updateAllVisibleBufferRelatedDialogs() if (fd_form_character->form_character->visible) { fl_hide_form(fd_form_character->form_character); } +#ifndef NEW_TABULAR if (fd_form_table->form_table->visible) { fl_hide_form(fd_form_table->form_table); } - +#endif #ifndef ALWAYS_CLOSE_MATH_PANELS // The math popups should be closed only if we switch // to a readonly buffer