- return 0;
- bv->buffer()->makeLinuxDocFile(name, false);
-
- // CHECK remove this once we have a proper geometry class
-
- BufferParams::PAPER_SIZE ps =
- static_cast<BufferParams::PAPER_SIZE>(bv->buffer()->params.papersize);
- switch (ps) {
- case BufferParams::PAPER_A4PAPER:
- add_flags = "-p a4";
- break;
- case BufferParams::PAPER_USLETTER:
- add_flags = "-p letter";
- break;
- default: /* nothing to be done yet ;-) */ break;
- }
-
- ProhibitInput(bv);
-
- Systemcalls one;
- switch (flag) {
- case 0: /* TeX output asked */
- bv->owner()->getMiniBuffer()->Set(_("Converting LinuxDoc SGML to TeX file..."));
- s2 = lyxrc.linuxdoc_to_latex_command + ' ' + add_flags + " -o tex " + ' ' + name;
- if (one.startscript(Systemcalls::System, s2))
- errorcode = 1;
- break;
- case 1: /* dvi output asked */
- bv->owner()->getMiniBuffer()->Set(_("Converting LinuxDoc SGML to dvi file..."));
- s2 = lyxrc.linuxdoc_to_latex_command + ' ' + add_flags + " -o dvi " + ' ' + name;
- if (one.startscript(Systemcalls::System, s2)) {
- errorcode = 1;
- }
- break;
- default: /* unknown output */
- break;
- }
-
- AllowInput(bv);
-
- bv->buffer()->redraw();
- return errorcode;
-}
-
-
-/*
- * SGML DocBook support:
- * (flag == 1) make dvi output
- */
-int RunDocBook(int flag, string const & filename)
-{
- /* generate a path-less extension name */
- string name = OnlyFilename(ChangeExtension (filename, ".sgml"));
- string path = OnlyPath (filename);
- if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) {
- path = current_view->buffer()->tmppath;
- }
- Path p(path);
-
- if (!current_view->available())
- return 0;
-
- current_view->buffer()->makeDocBookFile(name, false);
-
- // Shall this code go or should it stay? (Lgb)
- // This code is a placeholder for future implementation. (Jose')
-// string add_flags;
-// LYX_PAPER_SIZE ps = (LYX_PAPER_SIZE) current_view->buffer()->params.papersize;
-// switch (ps) {
-// case BufferParams::PAPER_A4PAPER: add_flags = "-p a4"; break;
-// case BufferParams::PAPER_USLETTER: add_flags = "-p letter"; break;
-// default: /* nothing to be done yet ;-) */ break;
-// }
- ProhibitInput(current_view);
-
- int errorcode = 0;
- Systemcalls one;
- switch (flag) {
- case 1: /* dvi output asked */
- {
- current_view->owner()->getMiniBuffer()->Set(_("Converting DocBook SGML to dvi file..."));
- string s2 = lyxrc.docbook_to_dvi_command + ' ' + name;
- if (one.startscript(Systemcalls::System, s2)) {
- errorcode = 1;
- }
- }
- break;
- default: /* unknown output */
- break;
- }
-
- AllowInput(current_view);
-
- current_view->buffer()->redraw();
- return errorcode;
-}
-
-
-void MenuLayoutCharacter()
-{
- static int ow = -1, oh;
-
- if (fd_form_character->form_character->visible) {
- fl_raise_form(fd_form_character->form_character);
- } else {
- fl_show_form(fd_form_character->form_character,
- FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER,
- _("Character Style"));
- if (ow < 0) {
- ow = fd_form_character->form_character->w;
- oh = fd_form_character->form_character->h;
- }
- fl_set_form_minsize(fd_form_character->form_character, ow, oh);
- }
-}
-
-
-inline
-void DeactivateParagraphButtons ()
-{
- fl_deactivate_object (fd_form_paragraph->button_ok);
- fl_deactivate_object (fd_form_paragraph->button_apply);
- fl_set_object_lcol (fd_form_paragraph->button_ok, FL_INACTIVE);
- fl_set_object_lcol (fd_form_paragraph->button_apply, FL_INACTIVE);
-}
-
-
-inline
-void ActivateParagraphButtons ()
-{
- fl_activate_object (fd_form_paragraph->button_ok);
- fl_activate_object (fd_form_paragraph->button_apply);
- fl_set_object_lcol (fd_form_paragraph->button_ok, FL_BLACK);
- fl_set_object_lcol (fd_form_paragraph->button_apply, FL_BLACK);
-}
-
-
-inline
-void DisableParagraphLayout ()
-{
- DeactivateParagraphButtons();
- fl_deactivate_object (fd_form_paragraph->input_labelwidth);
- fl_deactivate_object (fd_form_paragraph->check_lines_top);
- fl_deactivate_object (fd_form_paragraph->check_lines_bottom);
- fl_deactivate_object (fd_form_paragraph->check_pagebreaks_top);
- fl_deactivate_object (fd_form_paragraph->check_pagebreaks_bottom);
- fl_deactivate_object (fd_form_paragraph->check_noindent);
- fl_deactivate_object (fd_form_paragraph->group_radio_alignment);
- fl_deactivate_object (fd_form_paragraph->radio_align_right);
- fl_deactivate_object (fd_form_paragraph->radio_align_left);
- fl_deactivate_object (fd_form_paragraph->radio_align_block);
- fl_deactivate_object (fd_form_paragraph->radio_align_center);
- fl_deactivate_object (fd_form_paragraph->input_space_above);
- fl_deactivate_object (fd_form_paragraph->input_space_below);
- fl_deactivate_object (fd_form_paragraph->choice_space_above);
- fl_deactivate_object (fd_form_paragraph->choice_space_below);
- fl_deactivate_object (fd_form_paragraph->check_space_above);
- fl_deactivate_object (fd_form_paragraph->check_space_below);
-}
-
-
-inline
-void EnableParagraphLayout ()
-{
- ActivateParagraphButtons();
- fl_activate_object (fd_form_paragraph->input_labelwidth);
- fl_activate_object (fd_form_paragraph->check_lines_top);
- fl_activate_object (fd_form_paragraph->check_lines_bottom);
- fl_activate_object (fd_form_paragraph->check_pagebreaks_top);
- fl_activate_object (fd_form_paragraph->check_pagebreaks_bottom);
- fl_activate_object (fd_form_paragraph->check_noindent);
- fl_activate_object (fd_form_paragraph->group_radio_alignment);
- fl_activate_object (fd_form_paragraph->radio_align_right);
- fl_activate_object (fd_form_paragraph->radio_align_left);
- fl_activate_object (fd_form_paragraph->radio_align_block);
- fl_activate_object (fd_form_paragraph->radio_align_center);
- fl_activate_object (fd_form_paragraph->input_space_above);
- fl_activate_object (fd_form_paragraph->input_space_below);
- fl_activate_object (fd_form_paragraph->choice_space_above);
- fl_activate_object (fd_form_paragraph->choice_space_below);
- fl_activate_object (fd_form_paragraph->check_space_above);
- fl_activate_object (fd_form_paragraph->check_space_below);
-}
-
-
-bool UpdateLayoutParagraph()
-{
- if (!current_view->available()) {
- if (fd_form_paragraph->form_paragraph->visible)
- fl_hide_form(fd_form_paragraph->form_paragraph);
- return false;
- }
-
- Buffer * buf = current_view->buffer();
- LyXText * text = 0;
- if (current_view->the_locking_inset)
- text = current_view->the_locking_inset->getLyXText(current_view);
- if (!text)
- text = current_view->text;
-
- fl_set_input(fd_form_paragraph->input_labelwidth,
- text->cursor.par()->GetLabelWidthString().c_str());
- fl_set_button(fd_form_paragraph->radio_align_right, 0);
- fl_set_button(fd_form_paragraph->radio_align_left, 0);
- fl_set_button(fd_form_paragraph->radio_align_center, 0);
- fl_set_button(fd_form_paragraph->radio_align_block, 0);
-
- int align = text->cursor.par()->GetAlign();
- if (align == LYX_ALIGN_LAYOUT)
- align = textclasslist.Style(buf->params.textclass,
- text->cursor.par()->GetLayout()).align;
-
- switch (align) {
- case LYX_ALIGN_RIGHT:
- fl_set_button(fd_form_paragraph->radio_align_right, 1);
- break;
- case LYX_ALIGN_LEFT:
- fl_set_button(fd_form_paragraph->radio_align_left, 1);
- break;
- case LYX_ALIGN_CENTER:
- fl_set_button(fd_form_paragraph->radio_align_center, 1);
- break;
- default:
- fl_set_button(fd_form_paragraph->radio_align_block, 1);
- break;
- }
-
- fl_set_button(fd_form_paragraph->check_lines_top,
- text->cursor.par()->FirstPhysicalPar()->line_top);
- fl_set_button(fd_form_paragraph->check_lines_bottom,
- text->cursor.par()->FirstPhysicalPar()->line_bottom);
- fl_set_button(fd_form_paragraph->check_pagebreaks_top,
- text->cursor.par()->FirstPhysicalPar()->pagebreak_top);
- fl_set_button(fd_form_paragraph->check_pagebreaks_bottom,
- text->cursor.par()->FirstPhysicalPar()->pagebreak_bottom);
- fl_set_button(fd_form_paragraph->check_noindent,
- text->cursor.par()->FirstPhysicalPar()->noindent);
- fl_set_input (fd_form_paragraph->input_space_above, "");
-
- switch (text->cursor.par()->FirstPhysicalPar()->added_space_top.kind()) {
- case VSpace::NONE:
- fl_set_choice (fd_form_paragraph->choice_space_above, 1);
- break;
- case VSpace::DEFSKIP:
- fl_set_choice (fd_form_paragraph->choice_space_above, 2);
- break;
- case VSpace::SMALLSKIP:
- fl_set_choice (fd_form_paragraph->choice_space_above, 3);
- break;
- case VSpace::MEDSKIP:
- fl_set_choice (fd_form_paragraph->choice_space_above, 4);
- break;
- case VSpace::BIGSKIP:
- fl_set_choice (fd_form_paragraph->choice_space_above, 5);
- break;
- case VSpace::VFILL:
- fl_set_choice (fd_form_paragraph->choice_space_above, 6);
- break;
- case VSpace::LENGTH:
- fl_set_choice (fd_form_paragraph->choice_space_above, 7);
- fl_set_input (fd_form_paragraph->input_space_above,
- text->cursor.par()->FirstPhysicalPar()->added_space_top.length().asString().c_str());
- break;
- }
- fl_set_button (fd_form_paragraph->check_space_above,
- text->cursor.par()->FirstPhysicalPar()->added_space_top.keep());
- fl_set_input (fd_form_paragraph->input_space_below, "");
- switch (text->cursor.par()->FirstPhysicalPar()->added_space_bottom.kind()) {
- case VSpace::NONE:
- fl_set_choice (fd_form_paragraph->choice_space_below,
- 1);
- break;
- case VSpace::DEFSKIP:
- fl_set_choice (fd_form_paragraph->choice_space_below,
- 2);
- break;
- case VSpace::SMALLSKIP:
- fl_set_choice (fd_form_paragraph->choice_space_below,
- 3);
- break;
- case VSpace::MEDSKIP:
- fl_set_choice (fd_form_paragraph->choice_space_below,
- 4);
- break;
- case VSpace::BIGSKIP:
- fl_set_choice (fd_form_paragraph->choice_space_below,
- 5);
- break;
- case VSpace::VFILL:
- fl_set_choice (fd_form_paragraph->choice_space_below,
- 6);
- break;
- case VSpace::LENGTH:
- fl_set_choice (fd_form_paragraph->choice_space_below,
- 7);
- fl_set_input (fd_form_paragraph->input_space_below,
- text->cursor.par()->FirstPhysicalPar()->added_space_bottom.length().asString().c_str());
- break;
- }
- fl_set_button (fd_form_paragraph->check_space_below,
- text->cursor.par()->FirstPhysicalPar()->added_space_bottom.keep());
-
- fl_set_button(fd_form_paragraph->check_noindent,
- text->cursor.par()->FirstPhysicalPar()->noindent);
-
- if (current_view->buffer()->isReadonly()) {
- DisableParagraphLayout();
- } else {
- EnableParagraphLayout();
- }
- return true;
-}
-
-
-void MenuLayoutParagraph()
-{
- if (UpdateLayoutParagraph()) {
- if (fd_form_paragraph->form_paragraph->visible) {
- fl_raise_form(fd_form_paragraph->form_paragraph);
- } else {
- fl_show_form(fd_form_paragraph->form_paragraph,
- FL_PLACE_MOUSE, FL_FULLBORDER,
- _("Paragraph Environment"));
- }
- }
-}
-
-
-inline
-void DeactivateDocumentButtons ()
-{
- fl_deactivate_object (fd_form_document->button_ok);
- fl_deactivate_object (fd_form_document->button_apply);
- fl_set_object_lcol (fd_form_document->button_ok, FL_INACTIVE);
- fl_set_object_lcol (fd_form_document->button_apply, FL_INACTIVE);
-}
-
-
-inline
-void ActivateDocumentButtons ()
-{
- fl_activate_object (fd_form_document->button_ok);
- fl_activate_object (fd_form_document->button_apply);
- fl_set_object_lcol (fd_form_document->button_ok, FL_BLACK);
- fl_set_object_lcol (fd_form_document->button_apply, FL_BLACK);
-}
-
-
-inline
-void DisableDocumentLayout ()
-{
- DeactivateDocumentButtons ();
- fl_deactivate_object (fd_form_document->group_radio_separation);
- fl_deactivate_object (fd_form_document->radio_indent);
- fl_deactivate_object (fd_form_document->radio_skip);
- fl_deactivate_object (fd_form_document->choice_class);
- fl_deactivate_object (fd_form_document->choice_pagestyle);
- fl_deactivate_object (fd_form_document->choice_fonts);
- fl_deactivate_object (fd_form_document->choice_fontsize);
- fl_deactivate_object (fd_form_document->input_float_placement);
- fl_deactivate_object (fd_form_document->choice_postscript_driver);
- fl_deactivate_object (fd_form_document->choice_inputenc);
- fl_deactivate_object (fd_form_document->group_radio_sides);
- fl_deactivate_object (fd_form_document->radio_sides_one);
- fl_deactivate_object (fd_form_document->radio_sides_two);
- fl_deactivate_object (fd_form_document->group_radio_columns);
- fl_deactivate_object (fd_form_document->radio_columns_one);
- fl_deactivate_object (fd_form_document->radio_columns_two);
- fl_deactivate_object (fd_form_document->input_extra);
- fl_deactivate_object (fd_form_document->choice_language);
- combo_language->deactivate();
- fl_deactivate_object (fd_form_document->input_default_skip);
- fl_deactivate_object (fd_form_document->choice_default_skip);
- fl_deactivate_object (fd_form_document->slider_secnumdepth);
- fl_deactivate_object (fd_form_document->slider_tocdepth);
- fl_deactivate_object (fd_form_document->choice_spacing);
- fl_deactivate_object (fd_form_document->input_spacing);
- fl_deactivate_object (fd_form_document->check_use_amsmath);
-}
-
-
-inline
-void EnableDocumentLayout ()
-{
- ActivateDocumentButtons ();
- fl_activate_object (fd_form_document->group_radio_separation);
- fl_activate_object (fd_form_document->radio_indent);
- fl_activate_object (fd_form_document->radio_skip);
- fl_activate_object (fd_form_document->choice_class);
- fl_activate_object (fd_form_document->choice_pagestyle);
- fl_activate_object (fd_form_document->choice_fonts);
- fl_activate_object (fd_form_document->choice_fontsize);
- fl_activate_object (fd_form_document->input_float_placement);
- fl_activate_object (fd_form_document->choice_postscript_driver);
- fl_activate_object (fd_form_document->choice_inputenc);
- fl_activate_object (fd_form_document->group_radio_sides);
- fl_activate_object (fd_form_document->radio_sides_one);
- fl_activate_object (fd_form_document->radio_sides_two);
- fl_activate_object (fd_form_document->group_radio_columns);
- fl_activate_object (fd_form_document->radio_columns_one);
- fl_activate_object (fd_form_document->radio_columns_two);
- fl_activate_object (fd_form_document->input_extra);
- fl_activate_object (fd_form_document->choice_language);
- combo_language->activate();
- fl_activate_object (fd_form_document->input_default_skip);
- fl_activate_object (fd_form_document->choice_default_skip);
- fl_activate_object (fd_form_document->slider_secnumdepth);
- fl_activate_object (fd_form_document->slider_tocdepth);
- fl_activate_object (fd_form_document->choice_spacing);
- fl_activate_object (fd_form_document->input_spacing);
- fl_activate_object (fd_form_document->check_use_amsmath);
-}
-
-
-bool UpdateLayoutDocument(BufferParams * params)
-{
- if (!current_view->available()) {
- if (fd_form_document->form_document->visible)
- fl_hide_form(fd_form_document->form_document);
- return false;
- }
-
- if (params == 0)
- params = ¤t_view->buffer()->params;
- LyXTextClass const & tclass = textclasslist.TextClass(params->textclass);
-
- fl_set_choice_text(fd_form_document->choice_class,
- textclasslist.DescOfClass(params->textclass).c_str());
- combo_language->select_text(params->language.c_str());
-
- fl_set_choice_text(fd_form_document->choice_fonts,
- params->fonts.c_str());
- fl_set_choice_text(fd_form_document->choice_inputenc,
- params->inputenc.c_str());
- fl_set_choice_text(fd_form_document->choice_postscript_driver,
- params->graphicsDriver.c_str());
-
- // ale970405+lasgoutt970513
- fl_clear_choice(fd_form_document->choice_fontsize);
- fl_addto_choice(fd_form_document->choice_fontsize, "default");
- fl_addto_choice(fd_form_document->choice_fontsize,
- tclass.opt_fontsize().c_str());
- fl_set_choice(fd_form_document->choice_fontsize,
- tokenPos(tclass.opt_fontsize(), '|', params->fontsize) + 2);
-
- // ale970405+lasgoutt970513
- fl_clear_choice(fd_form_document->choice_pagestyle);
- fl_addto_choice(fd_form_document->choice_pagestyle, "default");
- fl_addto_choice(fd_form_document->choice_pagestyle,
- tclass.opt_pagestyle().c_str());
-
- fl_set_choice(fd_form_document->choice_pagestyle,
- tokenPos(tclass.opt_pagestyle(), '|', params->pagestyle) + 2);
-
- fl_set_button(fd_form_document->radio_indent, 0);
- fl_set_button(fd_form_document->radio_skip, 0);
-
-
- fl_set_button(fd_form_document->check_use_amsmath, params->use_amsmath);
-
- if (params->paragraph_separation == BufferParams::PARSEP_INDENT)
- fl_set_button(fd_form_document->radio_indent, 1);
- else
- fl_set_button(fd_form_document->radio_skip, 1);
-
- switch (params->getDefSkip().kind()) {
- case VSpace::SMALLSKIP:
- fl_set_choice (fd_form_document->choice_default_skip, 1);
- break;
- case VSpace::MEDSKIP:
- fl_set_choice (fd_form_document->choice_default_skip, 2);
- break;
- case VSpace::BIGSKIP:
- fl_set_choice (fd_form_document->choice_default_skip, 3);
- break;
- case VSpace::LENGTH:
- fl_set_choice (fd_form_document->choice_default_skip, 4);
- fl_set_input (fd_form_document->input_default_skip,
- params->getDefSkip().asLyXCommand().c_str());
- break;
- default:
- fl_set_choice (fd_form_document->choice_default_skip, 2);
- break;
- }
-
- fl_set_button(fd_form_document->radio_sides_one, 0);
- fl_set_button(fd_form_document->radio_sides_two, 0);
-
- switch (params->sides) {
- case LyXTextClass::OneSide:
- fl_set_button(fd_form_document->radio_sides_one, 1);
- break;
- case LyXTextClass::TwoSides:
- fl_set_button(fd_form_document->radio_sides_two, 1);
- break;
- }
-
- fl_set_button(fd_form_document->radio_columns_one, 0);
- fl_set_button(fd_form_document->radio_columns_two, 0);
-
- if (params->columns == 2)
- fl_set_button(fd_form_document->radio_columns_two, 1);
- else
- fl_set_button(fd_form_document->radio_columns_one, 1);
-
- fl_set_input(fd_form_document->input_spacing, "");
- switch (params->spacing.getSpace()) {
- case Spacing::Default: // nothing bad should happen with this
- case Spacing::Single:
- {
- // \singlespacing
- fl_set_choice(fd_form_document->choice_spacing, 1);
- break;
- }
- case Spacing::Onehalf:
- {
- // \onehalfspacing
- fl_set_choice(fd_form_document->choice_spacing, 2);
- break;
- }
- case Spacing::Double:
- {
- // \ doublespacing
- fl_set_choice(fd_form_document->choice_spacing, 3);
- break;
- }
- case Spacing::Other:
- {
- fl_set_choice(fd_form_document->choice_spacing, 4);
- //char sval[20];
- //sprintf(sval, "%g", params->spacing.getValue());
-#ifdef HAVE_SSTREAM
- std::ostringstream sval;
- sval << params->spacing.getValue(); // setw?
- fl_set_input(fd_form_document->input_spacing,
- sval.str().c_str());
-#else
- char tval[20];
- ostrstream sval(tval, 20);
- sval << params->spacing.getValue() << '\0'; // setw?
- fl_set_input(fd_form_document->input_spacing, sval.str());
-#endif
- break;
- }
- }
-
-
- fl_set_counter_value(fd_form_document->slider_secnumdepth,
- params->secnumdepth);
- fl_set_counter_value(fd_form_document->slider_tocdepth,
- params->tocdepth);
- if (!params->float_placement.empty()) { // buffer local (Lgb)
- fl_set_input(fd_form_document->input_float_placement,
- params->float_placement.c_str());
- } else {
- fl_set_input(fd_form_document->input_float_placement, "");
- }
- if (!params->options.empty())
- fl_set_input(fd_form_document->input_extra,
- params->options.c_str());
- else
- fl_set_input(fd_form_document->input_extra, "");
-
- if (current_view->buffer()->isSGML()) {
- // bullets not used in SGML derived documents
- fl_deactivate_object(fd_form_document->button_bullets);
- fl_set_object_lcol(fd_form_document->button_bullets,
- FL_INACTIVE);
- } else {
- fl_activate_object(fd_form_document->button_bullets);
- fl_set_object_lcol(fd_form_document->button_bullets,
- FL_BLACK);
- }
-
- if (current_view->buffer()->isReadonly()) {
- DisableDocumentLayout();
- } else {
- EnableDocumentLayout();
- }
-
- return true;
-}
-
-
-void MenuLayoutDocument()
-{
- if (UpdateLayoutDocument()) {
- if (fd_form_document->form_document->visible) {
- fl_raise_form(fd_form_document->form_document);
- } else {
- fl_show_form(fd_form_document->form_document,
- FL_PLACE_MOUSE, FL_FULLBORDER,
- _("Document Layout"));
- }
- }
-}
-
-
-bool UpdateLayoutQuotes()
-{
- bool update = true;
- if (!current_view->available()
- || current_view->buffer()->isReadonly())
- update = false;
-
- if (update) {
- fl_set_choice(fd_form_quotes->choice_quotes_language,
- current_view->buffer()->params.quotes_language + 1);
- fl_set_button(fd_form_quotes->radio_single, 0);
- fl_set_button(fd_form_quotes->radio_double, 0);
-
- if (current_view->buffer()->params.quotes_times == InsetQuotes::SingleQ)
- fl_set_button(fd_form_quotes->radio_single, 1);
- else
- fl_set_button(fd_form_quotes->radio_double, 1);
- } else if (fd_form_quotes->form_quotes->visible) {
- fl_hide_form(fd_form_quotes->form_quotes);
- }
- return update;
-}
-
-
-void MenuLayoutQuotes()
-{
- if (UpdateLayoutQuotes()) {
- if (fd_form_quotes->form_quotes->visible) {
- fl_raise_form(fd_form_quotes->form_quotes);
- } else {
- fl_show_form(fd_form_quotes->form_quotes,
- FL_PLACE_MOUSE, FL_FULLBORDER,
- _("Quotes"));
- }
- }
-}
-
-
-bool UpdateLayoutPreamble()
-{
- bool update = true;
- if (!current_view->available())
- update = false;
-
- if (update) {
- fl_set_input(fd_form_preamble->input_preamble,
- current_view->buffer()->params.preamble.c_str());
-
- if (current_view->buffer()->isReadonly()) {
- fl_deactivate_object(fd_form_preamble->input_preamble);
- fl_deactivate_object(fd_form_preamble->button_ok);
- fl_deactivate_object(fd_form_preamble->button_apply);
- fl_set_object_lcol(fd_form_preamble->button_ok, FL_INACTIVE);
- fl_set_object_lcol(fd_form_preamble->button_apply, FL_INACTIVE);
- }
- else {
- fl_activate_object(fd_form_preamble->input_preamble);
- fl_activate_object(fd_form_preamble->button_ok);
- fl_activate_object(fd_form_preamble->button_apply);
- fl_set_object_lcol(fd_form_preamble->button_ok, FL_BLACK);
- fl_set_object_lcol(fd_form_preamble->button_apply, FL_BLACK);
- }
- } else if (fd_form_preamble->form_preamble->visible) {
- fl_hide_form(fd_form_preamble->form_preamble);
- }
- return update;
-}
-
-
-void MenuLayoutPreamble()
-{
- static int ow = -1, oh;
-
- if (UpdateLayoutPreamble()) {
- if (fd_form_preamble->form_preamble->visible) {
- fl_raise_form(fd_form_preamble->form_preamble);
- } else {
- fl_show_form(fd_form_preamble->form_preamble,
- FL_PLACE_MOUSE | FL_FREE_SIZE,
- FL_FULLBORDER,
- _("LaTeX Preamble"));
- if (ow < 0) {
- ow = fd_form_preamble->form_preamble->w;
- oh = fd_form_preamble->form_preamble->h;
- }
- fl_set_form_minsize(fd_form_preamble->form_preamble,
- ow, oh);
- }
- }
-}
-
-
-void MenuLayoutSave()
-{
- if (!current_view->available())