-namespace {
-
-void setWidgetsFromVSpace(VSpace const & space,
- 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);
-
- fl_set_input(input_length, "");
- setEnabled(input_length, false);
- setEnabled(choice_length, false);
-
- switch (space.kind()) {
- case VSpace::NONE:
- fl_set_choice(choice_type, 1);
- break;
- case VSpace::DEFSKIP:
- fl_set_choice(choice_type, 2);
- break;
- case VSpace::SMALLSKIP:
- fl_set_choice(choice_type, 3);
- break;
- case VSpace::MEDSKIP:
- fl_set_choice(choice_type, 4);
- break;
- case VSpace::BIGSKIP:
- fl_set_choice(choice_type, 5);
- break;
- case VSpace::VFILL:
- fl_set_choice(choice_type, 6);
- break;
- case VSpace::LENGTH:
- {
- fl_set_choice(choice_type, 7);
-
- setEnabled(input_length, true);
- setEnabled(choice_length, true);
-
- bool const metric = lyxrc.default_papersize > 3;
- string const default_unit = metric ? "cm" : "in";
- string const length = space.length().asString();
-
- updateWidgetsFromLengthString(input_length, choice_length,
- length, default_unit);
- break;
- }
- }
-
- fl_set_button(check_keep, space.keep());
-}
-
-} // namespace anon
-
-