-/* form_document.C
- * FormDocument Interface Class Implementation
- */
+/* This file is part of
+ * ======================================================
+ *
+ * LyX, The Document Processor
+ *
+ * Copyright (C) 2000 The LyX Team.
+ *
+ * @author Jürgen Vigna
+ *
+ *======================================================*/
#include <config.h>
#include "buffer.h"
#include "Liason.h"
#include "CutAndPaste.h"
+#include "bufferview_funcs.h"
+#include "ButtonController.h"
#ifdef SIGC_CXX_NAMESPACES
using SigC::slot;
C_GENERICCB(FormDocument, OKCB)
C_GENERICCB(FormDocument, ApplyCB)
C_GENERICCB(FormDocument, CancelCB)
+C_GENERICCB(FormDocument, RestoreCB)
+C_GENERICCB(FormDocument, ChoiceClassCB)
+C_GENERICCB(FormDocument, BulletPanelCB)
+C_GENERICCB(FormDocument, BulletDepthCB)
+C_GENERICCB(FormDocument, InputBulletLaTeXCB)
+C_GENERICCB(FormDocument, ChoiceBulletSizeCB)
FormDocument::FormDocument(LyXView * lv, Dialogs * d)
: dialog_(0), paper_(0), class_(0), language_(0), options_(0),
bullets_(0), lv_(lv), d_(d), u_(0), h_(0),
- status(POPUP_UNMODIFIED)
+ status(POPUP_UNMODIFIED) ,
+ bc_(new ButtonController<PreferencesPolicy>(_("Cancel"), _("Close")))
{
// let the popup be shown
// This is a permanent connection so we won't bother
FormDocument::~FormDocument()
{
free();
+ delete bc_;
}
void FormDocument::build()
// the tabbed folder
dialog_ = build_tabbed_document();
+ // manage the restore, save, apply and cancel/close buttons
+ bc_->setOk(dialog_->button_ok);
+ bc_->setApply(dialog_->button_apply);
+ bc_->setCancel(dialog_->button_cancel);
+ bc_->setUndoAll(dialog_->button_restore);
+ bc_->refresh();
+
// the document paper form
paper_ = build_doc_paper();
fl_addto_choice(paper_->choice_papersize2,
fl_addto_choice(class_->choice_doc_skip,
_(" Smallskip | Medskip | Bigskip | Length "));
fl_set_input_return(class_->input_doc_skip, FL_RETURN_ALWAYS);
+ fl_set_input_return(class_->input_doc_spacing, FL_RETURN_ALWAYS);
// the document language form
language_ = build_doc_language();
" No changes to layout permitted."));
fl_show_object(dialog_->text_warning);
}
- class_update();
- paper_update();
- language_update();
- options_update();
- bullets_update();
+
+ BufferParams
+ const & params = lv_->buffer()->params;
+
+ class_update(params);
+ paper_update(params);
+ language_update(params);
+ options_update(params);
+ bullets_update(params);
}
-void FormDocument::class_update()
+void FormDocument::class_update(BufferParams const & params)
{
if (!class_)
return;
- BufferParams
- const & params = lv_->buffer()->params;
LyXTextClass
const & tclass = textclasslist.TextClass(params.textclass);
fl_set_input(class_->input_doc_extra, "");
}
-void FormDocument::language_update()
+void FormDocument::language_update(BufferParams const & params)
{
if (!language_)
return;
- BufferParams
- ¶ms = lv_->buffer()->params;
-
combo_language->select_text(params.language.c_str());
fl_set_choice_text(language_->choice_inputenc, params.inputenc.c_str());
fl_set_choice(language_->choice_quotes_language, params.quotes_language + 1);
fl_set_button(language_->radio_double, 1);
}
-void FormDocument::options_update()
+void FormDocument::options_update(BufferParams const & params)
{
if (!options_)
return;
- BufferParams
- ¶ms = lv_->buffer()->params;
-
fl_set_choice_text(options_->choice_postscript_driver,
params.graphicsDriver.c_str());
fl_set_button(options_->check_use_amsmath, params.use_amsmath);
fl_set_input(options_->input_float_placement, "");
}
-void FormDocument::paper_update()
+void FormDocument::paper_update(BufferParams const & params)
{
if (!paper_)
return;
- BufferParams
- ¶ms = lv_->buffer()->params;
fl_set_choice(paper_->choice_papersize2, params.papersize2 + 1);
fl_set_choice(paper_->choice_paperpackage, params.paperpackage + 1);
fl_set_focus_object(paper_->form, paper_->choice_papersize2);
}
-void FormDocument::bullets_update()
+void FormDocument::bullets_update(BufferParams const & params)
{
if (!bullets_ || ((XpmVersion<4) || (XpmVersion==4 && XpmRevision<7)))
return;
fl_activate_object (bullets_->input_bullet_latex);
}
- BufferParams
- ¶ms = lv_->buffer()->params;
-
fl_set_button(bullets_->radio_bullet_depth_1, 1);
fl_set_input(bullets_->input_bullet_latex,
params.user_defined_bullets[0].c_str());
// window manager is used to close the popup.
FormDocument * pre = (FormDocument*)form->u_vdata;
pre->hide();
+ pre->bc_->hide();
return FL_CANCEL;
}
-void FormDocument::CancelCB(FL_OBJECT * ob, long)
+void FormDocument::OKCB(FL_OBJECT * ob, long)
{
FormDocument * pre = (FormDocument*)ob->form->u_vdata;
- pre->cancel();
+ pre->apply();
pre->hide();
+ pre->bc_->ok();
}
void FormDocument::ApplyCB(FL_OBJECT * ob, long)
{
FormDocument * pre = (FormDocument*)ob->form->u_vdata;
pre->apply();
+ pre->bc_->apply();
}
-void FormDocument::OKCB(FL_OBJECT * ob, long)
+void FormDocument::CancelCB(FL_OBJECT * ob, long)
{
FormDocument * pre = (FormDocument*)ob->form->u_vdata;
- pre->apply();
+ pre->cancel();
pre->hide();
+ pre->bc_->cancel();
+}
+
+void FormDocument::RestoreCB(FL_OBJECT * ob, long)
+{
+ FormDocument * pre = static_cast<FormDocument*>(ob->form->u_vdata);
+ pre->update();
+ pre->bc_->undoAll();
}
void FormDocument::InputCB(FL_OBJECT * ob, long)
{
FormDocument * pre = (FormDocument*)ob->form->u_vdata;
- pre->CheckDocumentInput(ob,0);
+ pre->bc_->valid(pre->CheckDocumentInput(ob,0));
+}
+
+void FormDocument::ChoiceClassCB(FL_OBJECT * ob, long)
+{
+ FormDocument * pre = (FormDocument*)ob->form->u_vdata;
+ pre->CheckChoiceClass(ob,0);
+ pre->bc_->valid(pre->CheckDocumentInput(ob,0));
}
void FormDocument::checkMarginValues()
fl_set_button(paper_->push_use_geometry, 1);
}
-void FormDocument::CheckDocumentInput(FL_OBJECT * ob, long)
+bool FormDocument::CheckDocumentInput(FL_OBJECT * ob, long)
{
string str;
char val;
bool ok = true;
char const * input;
- ActivateDocumentButtons();
checkMarginValues();
if (ob == paper_->choice_papersize2) {
val = fl_get_choice(paper_->choice_papersize2)-1;
else if (fl_get_choice(class_->choice_doc_skip) != 4)
fl_set_input (class_->input_doc_skip, "");
- fprintf(stderr,"%d\n",fl_get_choice(class_->choice_doc_spacing));
+ input = fl_get_input(class_->input_doc_spacing);
if ((fl_get_choice(class_->choice_doc_spacing) == 4) && !*input)
ok = false;
else if (fl_get_choice(class_->choice_doc_spacing) != 4)
fl_set_input (class_->input_doc_spacing, "");
- if (!ok)
- DeactivateDocumentButtons();
+ return ok;
}
void FormDocument::ChoiceBulletSizeCB(FL_OBJECT * ob, long)
{
FormDocument * pre = (FormDocument*)ob->form->u_vdata;
pre->ChoiceBulletSize(ob,0);
+ pre->bc_->valid(pre->CheckDocumentInput(ob,0));
}
void FormDocument::ChoiceBulletSize(FL_OBJECT * ob, long /*data*/ )
{
FormDocument * pre = (FormDocument*)ob->form->u_vdata;
pre->InputBulletLaTeX(ob,0);
+ pre->bc_->valid(pre->CheckDocumentInput(ob,0));
}
void FormDocument::InputBulletLaTeX(FL_OBJECT *, long)
{
FormDocument * pre = (FormDocument*)ob->form->u_vdata;
pre->BulletBMTable(ob,0);
+ pre->bc_->valid(pre->CheckDocumentInput(ob,0));
}
void FormDocument::BulletBMTable(FL_OBJECT * ob, long /*data*/ )
param.temp_bullets[current_bullet_depth].c_str());
}
-void FormDocument::DeactivateDocumentButtons()
-{
- fl_deactivate_object(dialog_->button_ok);
- fl_deactivate_object(dialog_->button_apply);
- fl_set_object_lcol(dialog_->button_ok, FL_INACTIVE);
- fl_set_object_lcol(dialog_->button_apply, FL_INACTIVE);
-}
-
-void FormDocument::ActivateDocumentButtons()
-{
- fl_activate_object(dialog_->button_ok);
- fl_activate_object(dialog_->button_apply);
- fl_set_object_lcol(dialog_->button_ok, FL_BLACK);
- fl_set_object_lcol(dialog_->button_apply, FL_BLACK);
-}
-
void FormDocument::EnableDocumentLayout()
{
- ActivateDocumentButtons ();
fl_activate_object (class_->radio_doc_indent);
fl_activate_object (class_->radio_doc_skip);
fl_activate_object (class_->choice_doc_class);
void FormDocument::DisableDocumentLayout()
{
- DeactivateDocumentButtons ();
fl_deactivate_object (class_->radio_doc_indent);
fl_deactivate_object (class_->radio_doc_skip);
fl_deactivate_object (class_->choice_doc_class);
fl_deactivate_object (paper_->input_foot_skip);
}
-void FormDocument::SetDocumentClassChoice(vector<string> const & choices)
+void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long)
{
- vector<string>::const_iterator cit = choices.begin();
+ ProhibitInput(lv_->view());
+ if (textclasslist.Load(fl_get_choice(ob)-1)) {
+ if (AskQuestion(_("Should I set some parameters to"),
+ fl_get_choice_text(ob),
+ _("the defaults of this document class?"))) {
+ BufferParams & params = lv_->buffer()->params;
+
+ params.textclass = fl_get_choice(ob)-1;
+ params.useClassDefaults();
+ UpdateLayoutDocument(params);
+ }
+ } else {
+ // unable to load new style
+ WriteAlert(_("Conversion Errors!"),
+ _("Unable to switch to new document class."),
+ _("Reverting to original document class."));
+ fl_set_choice(class_->choice_doc_class,
+ lv_->view()->buffer()->params.textclass + 1);
+ }
+ AllowInput(lv_->view());
+}
- fl_clear_choice(class_->choice_doc_class);
- for (; cit != choices.end(); ++cit)
- fl_addto_choice(class_->choice_doc_class,(*cit).c_str());
+void FormDocument::UpdateLayoutDocument(BufferParams const & params)
+{
+ if (!dialog_)
+ return;
+ fl_hide_object(dialog_->text_warning);
+ EnableDocumentLayout();
+ if (lv_->buffer()->isReadonly()) {
+ DisableDocumentLayout();
+ fl_set_object_label(dialog_->text_warning,
+ _("Document is read-only."
+ " No changes to layout permitted."));
+ fl_show_object(dialog_->text_warning);
+ }
+ class_update(params);
+ paper_update(params);
+ language_update(params);
+ options_update(params);
+ bullets_update(params);
}
obj = fl_add_box(FL_UP_BOX, 0, 0, 465, 450, "");
fdui->tabbed_folder = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 20, 15, 435, 365, _("Tabbed folder"));
fl_set_object_resize(obj, FL_RESIZE_ALL);
- obj = fl_add_button(FL_NORMAL_BUTTON, 355, 410, 100, 30, idex(_("Cancel|^[")));
+ fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 355, 410, 100, 30, idex(_("Cancel|^[")));
fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, CancelCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentCancelCB, 0);
fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 245, 410, 100, 30, idex(_("Apply|#A")));
fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, ApplyCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentApplyCB, 0);
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 135, 410, 100, 30, _("OK"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, OKCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentOKCB, 0);
fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 20, 380, 435, 30, "");
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 410, 100, 30, idex(_("Restore|#R")));
+ fl_set_button_shortcut(obj, scex(_("Restore|#R")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentRestoreCB, 0);
fl_end_form();
fdui->form->fdui = fdui;
fl_set_button_shortcut(obj, scex(_("Special:|#S")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, InputCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
obj = fl_add_frame(FL_ENGRAVED_FRAME, 230, 205, 200, 130, "");
fl_set_object_color(obj, FL_COL1, FL_COL1);
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
fdui->radio_portrait = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 20, 90, 120, 30, idex(_("Portrait|#o")));
fl_set_button_shortcut(obj, scex(_("Portrait|#o")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->radio_landscape = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 20, 120, 120, 30, idex(_("Landscape|#L")));
fl_set_button_shortcut(obj, scex(_("Landscape|#L")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fl_end_group();
fdui->choice_papersize2 = obj = fl_add_choice(FL_NORMAL_CHOICE, 70, 15, 160, 30, idex(_("Papersize:|#P")));
fl_set_button_shortcut(obj, scex(_("Papersize:|#P")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, InputCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
obj = fl_add_text(FL_NORMAL_TEXT, 240, 75, 150, 20, _("Custom Papersize"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fdui->push_use_geometry = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 20, 45, 170, 30, idex(_("Use Geometry Package|#U")));
fl_set_button_shortcut(obj, scex(_("Use Geometry Package|#U")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->input_custom_width = obj = fl_add_input(FL_NORMAL_INPUT, 330, 100, 90, 30, idex(_("Width:|#W")));
fl_set_button_shortcut(obj, scex(_("Width:|#W")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, InputCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->input_custom_height = obj = fl_add_input(FL_NORMAL_INPUT, 330, 140, 90, 30, idex(_("Height:|#H")));
fl_set_button_shortcut(obj, scex(_("Height:|#H")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, InputCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->input_top_margin = obj = fl_add_input(FL_NORMAL_INPUT, 100, 175, 90, 30, idex(_("Top:|#T")));
fl_set_button_shortcut(obj, scex(_("Top:|#T")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, InputCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->input_bottom_margin = obj = fl_add_input(FL_NORMAL_INPUT, 100, 215, 90, 30, idex(_("Bottom:|#B")));
fl_set_button_shortcut(obj, scex(_("Bottom:|#B")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, InputCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->input_left_margin = obj = fl_add_input(FL_NORMAL_INPUT, 100, 255, 90, 30, idex(_("Left:|#e")));
fl_set_button_shortcut(obj, scex(_("Left:|#e")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, InputCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->input_right_margin = obj = fl_add_input(FL_NORMAL_INPUT, 100, 295, 90, 30, idex(_("Right:|#R")));
fl_set_button_shortcut(obj, scex(_("Right:|#R")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, InputCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->input_head_height = obj = fl_add_input(FL_NORMAL_INPUT, 330, 215, 90, 30, idex(_("Headheight:|#i")));
fl_set_button_shortcut(obj, scex(_("Headheight:|#i")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, InputCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->input_head_sep = obj = fl_add_input(FL_NORMAL_INPUT, 330, 255, 90, 30, idex(_("Headsep:|#d")));
fl_set_button_shortcut(obj, scex(_("Headsep:|#d")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, InputCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->input_foot_skip = obj = fl_add_input(FL_NORMAL_INPUT, 330, 295, 90, 30, idex(_("Footskip:|#F")));
fl_set_button_shortcut(obj, scex(_("Footskip:|#F")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, InputCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 10, 360, 420, 20, "");
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fl_set_button_shortcut(obj, scex(_("Fonts:|#F")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->choice_doc_fontsize = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 140, 160, 30, idex(_("Font Size:|#O")));
fl_set_button_shortcut(obj, scex(_("Font Size:|#O")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->choice_doc_class = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 20, 160, 30, idex(_("Class:|#C")));
fl_set_button_shortcut(obj, scex(_("Class:|#C")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, InputCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentChoiceClassCB, 0);
fdui->choice_doc_pagestyle = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 60, 160, 30, idex(_("Pagestyle:|#P")));
fl_set_button_shortcut(obj, scex(_("Pagestyle:|#P")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->choice_doc_spacing = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 290, 160, 30, idex(_("Spacing|#g")));
fl_set_button_shortcut(obj, scex(_("Spacing|#g")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, InputCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->input_doc_extra = obj = fl_add_input(FL_NORMAL_INPUT, 120, 185, 160, 30, idex(_("Extra Options:|#X")));
fl_set_button_shortcut(obj, scex(_("Extra Options:|#X")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->input_doc_skip = obj = fl_add_input(FL_NORMAL_INPUT, 220, 225, 60, 30, "");
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, InputCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->choice_doc_skip = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 225, 90, 30, idex(_("Default Skip:|#u")));
fl_set_button_shortcut(obj, scex(_("Default Skip:|#u")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, InputCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->group_doc_sides = fl_bgn_group();
fdui->radio_doc_sides_one = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 300, 30, 120, 30, idex(_("One|#n")));
fl_set_button_shortcut(obj, scex(_("One|#n")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->radio_doc_sides_two = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 300, 60, 120, 30, idex(_("Two|#T")));
fl_set_button_shortcut(obj, scex(_("Two|#T")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fl_end_group();
fdui->radio_doc_columns_one = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 300, 120, 110, 30, idex(_("One|#e")));
fl_set_button_shortcut(obj, scex(_("One|#e")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->radio_doc_columns_two = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 300, 150, 110, 30, idex(_("Two|#w")));
fl_set_button_shortcut(obj, scex(_("Two|#w")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fl_end_group();
fdui->radio_doc_indent = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 300, 210, 110, 30, idex(_("Indent|#I")));
fl_set_button_shortcut(obj, scex(_("Indent|#I")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->radio_doc_skip = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 300, 240, 110, 30, idex(_("Skip|#K")));
fl_set_button_shortcut(obj, scex(_("Skip|#K")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fl_set_button(obj, 1);
fl_end_group();
fdui->input_doc_spacing = obj = fl_add_input(FL_NORMAL_INPUT, 300, 290, 120, 30, "");
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, InputCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fl_end_form();
fdui->form->fdui = fdui;
fl_set_button_shortcut(obj, scex(_("Encoding:|#D")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->choice_quotes_language = obj = fl_add_choice(FL_NORMAL_CHOICE, 110, 140, 190, 30, idex(_("Type:|#T")));
fl_set_button_shortcut(obj, scex(_("Type:|#T")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fl_bgn_group();
fdui->radio_single = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 110, 180, 90, 30, idex(_("Single|#S")));
fl_set_button_shortcut(obj, scex(_("Single|#S")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->radio_double = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 210, 180, 90, 30, idex(_("Double|#D")));
fl_set_button_shortcut(obj, scex(_("Double|#D")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fl_end_group();
fdui->choice_language = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 35, 190, 30, idex(_("Language:|#L")));
fl_set_button_shortcut(obj, scex(_("Language:|#L")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fl_end_form();
fdui->form->fdui = fdui;
fdui->input_float_placement = obj = fl_add_input(FL_NORMAL_INPUT, 155, 60, 120, 30, idex(_("Float Placement:|#L")));
fl_set_button_shortcut(obj, scex(_("Float Placement:|#L")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->slider_secnumdepth = obj = fl_add_counter(FL_SIMPLE_COUNTER, 155, 110, 80, 30, _("Section number depth"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->slider_tocdepth = obj = fl_add_counter(FL_SIMPLE_COUNTER, 155, 150, 80, 30, _("Table of contents depth"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->choice_postscript_driver = obj = fl_add_choice(FL_NORMAL_CHOICE, 155, 205, 190, 30, idex(_("PS Driver:|#S")));
fl_set_button_shortcut(obj, scex(_("PS Driver:|#S")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fdui->check_use_amsmath = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 140, 250, 200, 30, idex(_("Use AMS Math|#M")));
fl_set_button_shortcut(obj, scex(_("Use AMS Math|#M")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormDocumentInputCB, 0);
fl_end_form();
fdui->form->fdui = fdui;
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_TOP);
- fl_set_object_callback(obj, ChoiceBulletSizeCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentChoiceBulletSizeCB, 0);
fdui->input_bullet_latex = obj = fl_add_input(FL_NORMAL_INPUT, 80, 300, 275, 30, idex(_("LaTeX|#L")));
fl_set_button_shortcut(obj, scex(_("LaTeX|#L")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lstyle(obj, FL_FIXED_STYLE);
- fl_set_object_callback(obj, InputBulletLaTeXCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentInputBulletLaTeXCB, 0);
fdui->radio_bullet_depth = fl_bgn_group();
fdui->radio_bullet_depth_1 = obj = fl_add_button(FL_RADIO_BUTTON, 105, 35, 55, 40, idex(_("1|#1")));
fl_set_button_shortcut(obj, scex(_("1|#1")), 1);
fl_set_object_lsize(obj, FL_LARGE_SIZE);
- fl_set_object_callback(obj, BulletDepthCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentBulletDepthCB, 0);
fl_set_button(obj, 1);
fdui->radio_bullet_depth_2 = obj = fl_add_button(FL_RADIO_BUTTON, 165, 35, 55, 40, idex(_("2|#2")));
fl_set_button_shortcut(obj, scex(_("2|#2")), 1);
fl_set_object_lsize(obj, FL_LARGE_SIZE);
- fl_set_object_callback(obj, BulletDepthCB, 1);
+ fl_set_object_callback(obj, C_FormDocumentBulletDepthCB, 1);
fdui->radio_bullet_depth_3 = obj = fl_add_button(FL_RADIO_BUTTON, 225, 35, 55, 40, idex(_("3|#3")));
fl_set_button_shortcut(obj, scex(_("3|#3")), 1);
fl_set_object_lsize(obj, FL_LARGE_SIZE);
- fl_set_object_callback(obj, BulletDepthCB, 2);
+ fl_set_object_callback(obj, C_FormDocumentBulletDepthCB, 2);
fdui->radio_bullet_depth_4 = obj = fl_add_button(FL_RADIO_BUTTON, 285, 35, 55, 40, idex(_("4|#4")));
fl_set_button_shortcut(obj, scex(_("4|#4")), 1);
fl_set_object_lsize(obj, FL_LARGE_SIZE);
- fl_set_object_callback(obj, BulletDepthCB, 3);
+ fl_set_object_callback(obj, C_FormDocumentBulletDepthCB, 3);
fl_end_group();
obj = fl_add_text(FL_NORMAL_TEXT, 105, 10, 85, 20, _("Bullet Depth"));
fl_set_button_shortcut(obj, scex(_("Standard|#S")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj, BulletPanelCB, 0);
+ fl_set_object_callback(obj, C_FormDocumentBulletPanelCB, 0);
fl_set_button(obj, 1);
fdui->radio_bullet_panel_maths = obj = fl_add_button(FL_RADIO_BUTTON, 15, 135, 65, 30, idex(_("Maths|#M")));
fl_set_button_shortcut(obj, scex(_("Maths|#M")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj, BulletPanelCB, 1);
+ fl_set_object_callback(obj, C_FormDocumentBulletPanelCB, 1);
fdui->radio_bullet_panel_ding2 = obj = fl_add_button(FL_RADIO_BUTTON, 15, 195, 65, 30, idex(_("Ding 2|#i")));
fl_set_button_shortcut(obj, scex(_("Ding 2|#i")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj, BulletPanelCB, 3);
+ fl_set_object_callback(obj, C_FormDocumentBulletPanelCB, 3);
fdui->radio_bullet_panel_ding3 = obj = fl_add_button(FL_RADIO_BUTTON, 15, 225, 65, 30, idex(_("Ding 3|#n")));
fl_set_button_shortcut(obj, scex(_("Ding 3|#n")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj, BulletPanelCB, 4);
+ fl_set_object_callback(obj, C_FormDocumentBulletPanelCB, 4);
fdui->radio_bullet_panel_ding4 = obj = fl_add_button(FL_RADIO_BUTTON, 15, 255, 65, 30, idex(_("Ding 4|#g")));
fl_set_button_shortcut(obj, scex(_("Ding 4|#g")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj, BulletPanelCB, 5);
+ fl_set_object_callback(obj, C_FormDocumentBulletPanelCB, 5);
fdui->radio_bullet_panel_ding1 = obj = fl_add_button(FL_RADIO_BUTTON, 15, 165, 65, 30, idex(_("Ding 1|#D")));
fl_set_button_shortcut(obj, scex(_("Ding 1|#D")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj, BulletPanelCB, 2);
+ fl_set_object_callback(obj, C_FormDocumentBulletPanelCB, 2);
fl_end_group();
fl_end_form();
Name: form_tabbed_document
Width: 465
Height: 450
-Number of Objects: 6
+Number of Objects: 7
--------------------
class: FL_BOX
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
-name:
-callback: CancelCB
+name: button_cancel
+callback: C_FormDocumentCancelCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_apply
-callback: ApplyCB
+callback: C_FormDocumentApplyCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_ok
-callback: OKCB
+callback: C_FormDocumentOKCB
argument: 0
--------------------
callback:
argument:
+--------------------
+class: FL_BUTTON
+type: NORMAL_BUTTON
+box: 10 410 100 30
+boxtype: FL_UP_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Restore|#R
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: button_restore
+callback: C_FormDocumentRestoreCB
+argument: 0
+
=============== FORM ===============
Name: form_doc_paper
Width: 440
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_paperpackage
-callback: InputCB
+callback: C_FormDocumentInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_portrait
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_landscape
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_papersize2
-callback: InputCB
+callback: C_FormDocumentInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: push_use_geometry
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_custom_width
-callback: InputCB
+callback: C_FormDocumentInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_custom_height
-callback: InputCB
+callback: C_FormDocumentInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_top_margin
-callback: InputCB
+callback: C_FormDocumentInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_bottom_margin
-callback: InputCB
+callback: C_FormDocumentInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_left_margin
-callback: InputCB
+callback: C_FormDocumentInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_right_margin
-callback: InputCB
+callback: C_FormDocumentInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_head_height
-callback: InputCB
+callback: C_FormDocumentInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_head_sep
-callback: InputCB
+callback: C_FormDocumentInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_foot_skip
-callback: InputCB
+callback: C_FormDocumentInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_doc_fonts
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_doc_fontsize
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_doc_class
-callback: InputCB
+callback: C_FormDocumentChoiceClassCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_doc_pagestyle
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_doc_spacing
-callback: InputCB
+callback: C_FormDocumentInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_doc_extra
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_doc_skip
-callback: InputCB
+callback: C_FormDocumentInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_doc_skip
-callback: InputCB
+callback: C_FormDocumentInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_doc_sides_one
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_doc_sides_two
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_doc_columns_one
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_doc_columns_two
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_doc_indent
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_doc_skip
-callback:
+callback: C_FormDocumentInputCB
argument:
value: 1
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_doc_spacing
-callback: InputCB
+callback: C_FormDocumentInputCB
argument: 0
=============== FORM ===============
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_inputenc
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_quotes_language
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_single
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_double
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_language
-callback:
+callback: C_FormDocumentInputCB
argument:
=============== FORM ===============
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_float_placement
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: slider_secnumdepth
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: slider_tocdepth
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_postscript_driver
-callback:
+callback: C_FormDocumentInputCB
argument:
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: check_use_amsmath
-callback:
+callback: C_FormDocumentInputCB
argument:
=============== FORM ===============
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_bullet_size
-callback: ChoiceBulletSizeCB
+callback: C_FormDocumentChoiceBulletSizeCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_bullet_latex
-callback: InputBulletLaTeXCB
+callback: C_FormDocumentInputBulletLaTeXCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_bullet_depth_1
-callback: BulletDepthCB
+callback: C_FormDocumentBulletDepthCB
argument: 0
value: 1
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_bullet_depth_2
-callback: BulletDepthCB
+callback: C_FormDocumentBulletDepthCB
argument: 1
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_bullet_depth_3
-callback: BulletDepthCB
+callback: C_FormDocumentBulletDepthCB
argument: 2
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_bullet_depth_4
-callback: BulletDepthCB
+callback: C_FormDocumentBulletDepthCB
argument: 3
--------------------
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: radio_bullet_panel_standard
-callback: BulletPanelCB
+callback: C_FormDocumentBulletPanelCB
argument: 0
value: 1
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: radio_bullet_panel_maths
-callback: BulletPanelCB
+callback: C_FormDocumentBulletPanelCB
argument: 1
--------------------
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: radio_bullet_panel_ding2
-callback: BulletPanelCB
+callback: C_FormDocumentBulletPanelCB
argument: 3
--------------------
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: radio_bullet_panel_ding3
-callback: BulletPanelCB
+callback: C_FormDocumentBulletPanelCB
argument: 4
--------------------
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: radio_bullet_panel_ding4
-callback: BulletPanelCB
+callback: C_FormDocumentBulletPanelCB
argument: 5
--------------------
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: radio_bullet_panel_ding1
-callback: BulletPanelCB
+callback: C_FormDocumentBulletPanelCB
argument: 2
--------------------