}
+void FormParagraph::redraw()
+{
+ if( form() && form()->visible )
+ fl_redraw_form( form() );
+ else
+ return;
+
+ FL_FORM * outer_form = fl_get_active_folder(dialog_->tabbed_folder);
+ if (outer_form && outer_form->visible)
+ fl_redraw_form( outer_form );
+}
+
+
FL_FORM * FormParagraph::form() const
{
if (dialog_) return dialog_->form;
// the tabbed folder
dialog_ = build_tabbed_paragraph();
- // manage the restore, ok, apply and cancel/close buttons
+ // Workaround dumb xforms sizing bug
+ minw_ = form()->w;
+ minh_ = form()->h;
+
+ // Manage the ok, apply, restore and cancel/close buttons
bc_.setOK(dialog_->button_ok);
bc_.setApply(dialog_->button_apply);
bc_.setCancel(dialog_->button_cancel);
}
-// we can safely ignore the parameter because we can always update
-void FormParagraph::update(bool)
+void FormParagraph::update()
{
if (!dialog_)
return;
par->pextra_width.c_str());
fl_set_input(extra_->input_pextra_widthp,
par->pextra_widthp.c_str());
- switch(par->pextra_alignment) {
+ switch (par->pextra_alignment) {
case LyXParagraph::MINIPAGE_ALIGN_TOP:
fl_set_button(extra_->radio_pextra_top, 1);
break;
//
// "Synchronize" the choices and input fields, making it
// impossible to commit senseless data.
- if (ob == general_->choice_space_above) {
- if (fl_get_choice (general_->choice_space_above) != 7)
- fl_set_input (general_->input_space_above, "");
- } else if (ob == general_->choice_space_below) {
- if (fl_get_choice (general_->choice_space_below) != 7)
- fl_set_input (general_->input_space_below, "");
- }
+
+ if (fl_get_choice (general_->choice_space_above) != 7)
+ fl_set_input (general_->input_space_above, "");
+
+ if (fl_get_choice (general_->choice_space_below) != 7)
+ fl_set_input (general_->input_space_below, "");
+
//
// then the extra form
//
- else if (ob == extra_->radio_pextra_indent) {
+ if (ob == extra_->radio_pextra_indent) {
int n = fl_get_button(extra_->radio_pextra_indent);
if (n) {
fl_set_button(extra_->radio_pextra_minipage, 0);
// first the general form
//
string input = fl_get_input (general_->input_space_above);
+ bool invalid = false;
- if (input.empty()) {
- fl_set_choice (general_->choice_space_above, 1);
- } else if (isValidGlueLength (input)) {
- fl_set_choice (general_->choice_space_above, 7);
- } else {
- fl_set_choice (general_->choice_space_above, 7);
- fl_set_object_label(dialog_->text_warning,
- _("Warning: Invalid Length (valid example: 10mm)"));
- fl_show_object(dialog_->text_warning);
- ret = false;
- }
-
+ if (fl_get_choice(general_->choice_space_above)==7)
+ invalid = !input.empty() && !isValidGlueLength(input);
+
input = fl_get_input (general_->input_space_below);
-
- if (input.empty()) {
- fl_set_choice (general_->choice_space_below, 1);
- } else if (isValidGlueLength(input)) {
- fl_set_choice (general_->choice_space_below, 7);
- } else {
- fl_set_choice (general_->choice_space_below, 7);
- fl_set_object_label(dialog_->text_warning,
- _("Warning: Invalid Length (valid example: 10mm)"));
- fl_show_object(dialog_->text_warning);
- ret = false;
+
+ if (fl_get_choice(general_->choice_space_below)==7)
+ invalid = invalid || (!input.empty() && !isValidGlueLength(input));
+
+ if (ob == general_->input_space_above || ob == general_->input_space_below) {
+ if (invalid) {
+ fl_set_object_label(dialog_->text_warning,
+ _("Warning: Invalid Length (valid example: 10mm)"));
+ fl_show_object(dialog_->text_warning);
+ return false;
+ } else {
+ fl_hide_object(dialog_->text_warning);
+ return true;
+ }
}
+
//
// then the extra form
//