From 7fa7dd11e6a50a4ded158ebc56a573e0ee2b297f Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Thu, 24 Oct 2002 09:48:56 +0000 Subject: [PATCH] (Rob Lahaye): small clean-up of the clean-ups already applied. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5488 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/xforms/ChangeLog | 17 +++++++++++ src/frontends/xforms/Dialogs_impl.h | 2 +- src/frontends/xforms/FormDocument.C | 39 +++++++++++------------- src/frontends/xforms/FormFloat.C | 18 ++++------- src/frontends/xforms/RadioButtonGroup.C | 6 ++++ src/frontends/xforms/forms/form_float.fd | 6 ++-- 6 files changed, 50 insertions(+), 38 deletions(-) diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 70965568e2..3ce4210202 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,20 @@ +2002-10-24 Rob Lahaye + + * FormFloat.C (input): fix the radio buttongroup behaviour. + + * RadioButtonGroup.C (init): Assert on ROUND3DBUTTON and RADIO_BUTTON + when adding object to the group. + + * forms/form_float.fd: use RADIO_BUTTON for the buttons in the radio + group. + + * FormDocument.C: remove redundant header files. + +2002-10-24 Angus Leeming + + * Dialogs_impl.h: set the policy of the BibtexDialog to + NoRepeatedApplyReadOnlyPolicy. + 2002-10-23 Rob Lahaye * forms/form_float.fd: prettify and implement gravity/resize policy diff --git a/src/frontends/xforms/Dialogs_impl.h b/src/frontends/xforms/Dialogs_impl.h index 1d476449ed..8436e33ac0 100644 --- a/src/frontends/xforms/Dialogs_impl.h +++ b/src/frontends/xforms/Dialogs_impl.h @@ -180,7 +180,7 @@ AboutlyxDialog; typedef GUI BibitemDialog; -typedef GUI +typedef GUI BibtexDialog; typedef GUI diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index ecba22a440..9ebd2c5adc 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -11,43 +11,38 @@ #include -#include FORMS_H_LOCATION -#include XPM_H_LOCATION - #ifdef __GNUG__ #pragma implementation #endif #include "FormDocument.h" #include "forms/form_document.h" -#include "Alert.h" -#include "lyxtextclasslist.h" -#include "combox.h" -#include "tex-strings.h" -#include "bufferparams.h" -#include "vspace.h" + #include "bmtable.h" -#include "language.h" -#include "frnt_lang.h" -#include "frontends/LyXView.h" -#include "lyxfunc.h" -#include "lyxrc.h" -#include "BufferView.h" +#include "checkedwidgets.h" +#include "combox.h" +#include "input_validators.h" // fl_unsigned_float_filter +#include "xforms_helpers.h" + #include "buffer.h" +#include "BufferView.h" #include "CutAndPaste.h" -#include "bufferview_funcs.h" -#include "xforms_helpers.h" -#include "checkedwidgets.h" #include "debug.h" -#include "input_validators.h" // fl_unsigned_float_filter -#include "helper_funcs.h" +#include "language.h" #include "lyx_main.h" // for user_lyxdir +#include "lyxrc.h" +#include "lyxtextclasslist.h" +#include "tex-strings.h" -#include "insets/insetquotes.h" +#include "controllers/frnt_lang.h" +#include "controllers/helper_funcs.h" + +#include "frontends/LyXView.h" +#include "frontends/Alert.h" #include "support/filetools.h" -#include "support/lstrings.h" +#include XPM_H_LOCATION #include FORMS_H_LOCATION #include diff --git a/src/frontends/xforms/FormFloat.C b/src/frontends/xforms/FormFloat.C index 8d60284976..4a86e9c647 100644 --- a/src/frontends/xforms/FormFloat.C +++ b/src/frontends/xforms/FormFloat.C @@ -188,18 +188,13 @@ void FormFloat::update() ButtonPolicy::SMInput FormFloat::input(FL_OBJECT * ob, long) { - bool alternatives = placement_.get() == ALTERNATIVES; + bool const alternatives = placement_.get() == ALTERNATIVES; bool const wide = fl_get_button(dialog_->check_wide); if (ob == dialog_->radio_default || ob == dialog_->radio_here_definitely || ob == dialog_->radio_alternatives) { - - // set radio button - placement_.set(ob); - alternatives = placement_.get() == ALTERNATIVES; - - // enable check buttons for Alternatives + // enable check buttons only for Alternatives setEnabled(dialog_->check_top, alternatives); setEnabled(dialog_->check_bottom, alternatives); setEnabled(dialog_->check_page, alternatives); @@ -207,14 +202,13 @@ ButtonPolicy::SMInput FormFloat::input(FL_OBJECT * ob, long) setEnabled(dialog_->check_here, alternatives && !wide); } else if (ob == dialog_->check_wide) { - // wide float doesn't allow 'Here, definitely!' and 'here' - setEnabled(dialog_->radio_here_definitely, !wide); - setEnabled(dialog_->check_here, alternatives && !wide); - - // flip to default, if 'Here, definitely!' was selected if (wide && placement_.get() == HERE_DEFINITELY) { + // wide float doesn't allow 'Here, definitely!' + // placement placement_.set(dialog_->radio_default); } + setEnabled(dialog_->check_here, alternatives && !wide); + setEnabled(dialog_->radio_here_definitely, !wide); } // enable force button, if Alternatives is selected and at least diff --git a/src/frontends/xforms/RadioButtonGroup.C b/src/frontends/xforms/RadioButtonGroup.C index 0d9531e2fd..e98b01f4ad 100644 --- a/src/frontends/xforms/RadioButtonGroup.C +++ b/src/frontends/xforms/RadioButtonGroup.C @@ -20,6 +20,7 @@ #include "RadioButtonGroup.h" #include FORMS_H_LOCATION +#include "support/LAssert.h" #include "debug.h" // for lyxerr #include "support/lyxfunctional.h" @@ -32,6 +33,11 @@ using std::endl; void RadioButtonGroup::init(FL_OBJECT * ob, size_type value) { + // Object must be a ROUND3DBUTTON (let all radio buttons look the same) + // and of type RADIO_BUTTON (otherwise it ain't work). + lyx::Assert(ob && ob->objclass == FL_ROUND3DBUTTON + && ob->type == FL_RADIO_BUTTON); + map.push_back(ButtonValuePair(ob, value)); } diff --git a/src/frontends/xforms/forms/form_float.fd b/src/frontends/xforms/forms/form_float.fd index 8feabdf8f4..7ce6f0692e 100644 --- a/src/frontends/xforms/forms/form_float.fd +++ b/src/frontends/xforms/forms/form_float.fd @@ -249,7 +249,7 @@ argument: -------------------- class: FL_ROUND3DBUTTON -type: PUSH_BUTTON +type: RADIO_BUTTON box: 10 85 200 25 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW @@ -267,7 +267,7 @@ argument: 0 -------------------- class: FL_ROUND3DBUTTON -type: PUSH_BUTTON +type: RADIO_BUTTON box: 10 55 200 25 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW @@ -285,7 +285,7 @@ argument: 0 -------------------- class: FL_ROUND3DBUTTON -type: PUSH_BUTTON +type: RADIO_BUTTON box: 10 25 200 25 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW -- 2.39.2