-
- string units = getStringFromVector(units_vec, "|");
-
- fl_addto_choice(dialog_->choice_value_space_above, units.c_str());
- fl_addto_choice(dialog_->choice_value_space_below, units.c_str());
-
- // Manage the ok, apply, restore and cancel/close buttons
- bc().setOK(dialog_->button_ok);
- bc().setApply(dialog_->button_apply);
- bc().setCancel(dialog_->button_close);
- bc().setRestore(dialog_->button_restore);
-
- bc().addReadOnly(dialog_->radio_align_right);
- bc().addReadOnly(dialog_->radio_align_left);
- bc().addReadOnly(dialog_->radio_align_block);
- bc().addReadOnly(dialog_->radio_align_center);
- bc().addReadOnly(dialog_->check_lines_top);
- bc().addReadOnly(dialog_->check_lines_bottom);
- bc().addReadOnly(dialog_->check_pagebreaks_top);
- bc().addReadOnly(dialog_->check_pagebreaks_bottom);
- bc().addReadOnly(dialog_->choice_space_above);
- bc().addReadOnly(dialog_->input_space_above);
- bc().addReadOnly(dialog_->check_space_above);
- bc().addReadOnly(dialog_->choice_space_below);
- bc().addReadOnly(dialog_->input_space_below);
- bc().addReadOnly(dialog_->check_space_below);
- bc().addReadOnly(dialog_->choice_linespacing);
- bc().addReadOnly(dialog_->input_linespacing);
- bc().addReadOnly(dialog_->check_noindent);
- bc().addReadOnly(dialog_->input_labelwidth);
-}
-
-namespace {
-
-VSpace setVSpaceFromWidgets(FL_OBJECT * choice_type,
- FL_OBJECT * input_length,
- FL_OBJECT * choice_length,
- FL_OBJECT * check_keep)
-{
- // Paranoia check!
- lyx::Assert(choice_type && choice_type->objclass == FL_CHOICE &&
- input_length && input_length->objclass == FL_INPUT &&
- choice_length && choice_length->objclass == FL_CHOICE &&
- check_keep && check_keep->objclass == FL_CHECKBUTTON);
-
- VSpace space;
-
- switch (fl_get_choice(choice_type)) {
- case 1:
- space = VSpace(VSpace::NONE);
- break;
- case 2:
- space = VSpace(VSpace::DEFSKIP);
- break;
- case 3:
- space = VSpace(VSpace::SMALLSKIP);
- break;
- case 4:
- space = VSpace(VSpace::MEDSKIP);
- break;
- case 5:
- space = VSpace(VSpace::BIGSKIP);
- break;
- case 6:
- space = VSpace(VSpace::VFILL);
- break;
- case 7:
- {
- string const length =
- getLengthFromWidgets(input_length, choice_length);
- space = VSpace(LyXGlueLength(length));
- break;
- }
- }
-
- if (fl_get_button(check_keep))
- space.setKeep(true);
-
- return space;
-}
-
-void validateVSpaceWidgets(FL_OBJECT * choice_type, FL_OBJECT * input_length)
-{
- // Paranoia check!
- lyx::Assert(choice_type && choice_type->objclass == FL_CHOICE &&
- input_length && input_length->objclass == FL_INPUT);
-
- if (fl_get_choice(choice_type) != 7)
- return;
-
- // If a vspace kind is "Length" but there's no text in
- // the input field, reset the kind to "None".
- string const input = rtrim(getString(input_length));
- if (input.empty())
- fl_set_choice(choice_type, 1);