* converter.h (Get): changed argument type from int to
FormatList::size_type to avoid unnecessary conversion.
+ * bufferview_funcs.C (ToggleAndShow): check state of LyXText pointer
+ before using it.
+
2001-06-07 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* gettext.h: include LString.h even when --disable-nls is on.
return;
}
LyXText * text = bv->getLyXText();
+ if (!text)
+ return;
bv->hideCursor();
bv->update(text, BufferView::SELECT|BufferView::FITCUR);
+2001-06-12 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * ControlCharacter.C (apply): test that font_ exists, thereby preventing
+ crash when the Font button on the Toolbar is pressed.
+
+ * GUI.h: change policy of Character button controller to
+ OkApplyCancelReadOnlyPolicy.
+
2001-06-11 Lars Gullik Bjønnes <larsbj@birdstep.com>
* ControlToc.C (getContents): don't add anything to the list if it
void ControlCharacter::apply()
{
- if (!lv_.view()->available())
+ if (!(font_ && lv_.view()->available()))
return;
view().apply();
template <class GUIview, class GUIbc>
class GUICharacter : public GUI<ControlCharacter, GUIview,
- NoRepeatedApplyReadOnlyPolicy, GUIbc>
+ OkApplyCancelReadOnlyPolicy, GUIbc>
{
public:
///
GUICharacter(LyXView & lv, Dialogs & d)
: GUI<ControlCharacter, GUIview,
- NoRepeatedApplyReadOnlyPolicy, GUIbc>(lv, d) {}
+ OkApplyCancelReadOnlyPolicy, GUIbc>(lv, d) {}
};
(Converters::GetTo): get the contents of "to" not "from"! Thus fix bug
that disabled addition of new converters.
+ * FormCharacter.C (input, update): new methods. Activate the Apply
+ button when any of the input fileds are not IGNORE.
+
2001-06-11 Lars Gullik Bjønnes <larsbj@birdstep.com>
* FormToc.C (input): change test slightly.
void FormCharacter::apply()
{
+ if (!form()) return;
+
int pos = fl_get_choice(dialog_->choice_family);
controller().setFamily(family_[pos-1]);
bool const toggleall = fl_get_button(dialog_->check_toggle_all);
controller().setToggleAll(toggleall);
}
+
+
+void FormCharacter::update()
+{
+ if (input(0,0) == ButtonPolicy::SMI_VALID)
+ bc().valid(); // so that the user can press Ok
+}
+
+
+ButtonPolicy::SMInput FormCharacter::input(FL_OBJECT *, long)
+{
+ ButtonPolicy::SMInput activate = ButtonPolicy::SMI_NOOP;
+
+ int pos = fl_get_choice(dialog_->choice_family);
+ if (family_[pos-1] != LyXFont::IGNORE_FAMILY)
+ activate = ButtonPolicy::SMI_VALID;
+
+ pos = fl_get_choice(dialog_->choice_series);
+ if (series_[pos-1] != LyXFont::IGNORE_SERIES)
+ activate = ButtonPolicy::SMI_VALID;
+
+ pos = fl_get_choice(dialog_->choice_shape);
+ if (shape_[pos-1] != LyXFont::IGNORE_SHAPE)
+ activate = ButtonPolicy::SMI_VALID;
+
+ pos = fl_get_choice(dialog_->choice_size);
+ if (size_[pos-1] != LyXFont::IGNORE_SIZE)
+ activate = ButtonPolicy::SMI_VALID;
+
+ pos = fl_get_choice(dialog_->choice_bar);
+ if (bar_[pos-1] != character::IGNORE)
+ activate = ButtonPolicy::SMI_VALID;
+
+ pos = fl_get_choice(dialog_->choice_color);
+ if (color_[pos-1] != LColor::ignore)
+ activate = ButtonPolicy::SMI_VALID;
+
+ string const language = combo_language2_->getline();
+ if (language != _("No change"))
+ activate = ButtonPolicy::SMI_VALID;
+
+ return activate;
+}
/// Build the dialog
virtual void build();
- /// Nothing to update...
- virtual void update() {}
+ /// Update the dialog.
+ virtual void update();
+
+ /// Filter the inputs on callback from xforms
+ virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
/** Callback method (used only to activate Apply button when
combox is changed */