+2002-06-11 Edwin Leuven <leuven@fee.uva.nl>
+
+ * ControlParagraph.[Ch]: new paragraph controller
+ * GUI.h: add new controller
+ * Makefile.am: ditto
+
2002-06-10 Lars Gullik Bjønnes <larsbj@birdstep.com>
* GUI.h: do not include ButtonController.tmpl
--- /dev/null
+// -*- C++ -*-
+/**
+ * \file ControlParagraph.C
+ * Copyright 2002 The LyX Team.
+ * See the file COPYING.
+ *
+ * \author Edwin Leuven <leuven@fee.uva.nl>
+ */
+
+#include <config.h>
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include "ViewBase.h"
+#include "ButtonControllerBase.h"
+#include "ControlParagraph.h"
+#include "Dialogs.h"
+#include "Liason.h"
+#include "LyXView.h"
+#include "BufferView.h"
+#include "gettext.h"
+#include "buffer.h"
+#include "lyxtext.h"
+#include "lyxtextclasslist.h"
+#include "support/LAssert.h"
+
+#include <boost/bind.hpp>
+
+using Liason::setMinibuffer;
+
+
+ControlParagraph::ControlParagraph(LyXView & lv, Dialogs & d)
+ : ControlDialogBD(lv, d), pp_(0), ininset_(false)
+{
+ d_.showParagraph = boost::bind(&ControlParagraph::show, this);
+}
+
+ParagraphParameters & ControlParagraph::params()
+{
+ lyx::Assert(pp_.get());
+ return *pp_;
+}
+
+bool ControlParagraph::inInset() const
+{
+ return ininset_;
+}
+
+LyXAlignment ControlParagraph::alignPossible() const
+{
+ return alignpos_;
+}
+
+void ControlParagraph::apply()
+{
+ if (!lv_.view()->available())
+ return;
+
+ view().apply();
+
+ LyXText * text(lv_.view()->getLyXText());
+ text->setParagraph(lv_.view(),
+ pp_->lineTop(),
+ pp_->lineBottom(),
+ pp_->pagebreakTop(),
+ pp_->pagebreakBottom(),
+ pp_->spaceTop(),
+ pp_->spaceBottom(),
+ pp_->spacing(),
+ pp_->align(),
+ pp_->labelWidthString(),
+ pp_->noindent());
+
+ // Actually apply these settings
+ lv_.view()->update(text,
+ BufferView::SELECT |
+ BufferView::FITCUR |
+ BufferView::CHANGE);
+
+ lv_.buffer()->markDirty();
+
+ setMinibuffer(&lv_, _("Paragraph layout set"));
+}
+
+void ControlParagraph::setParams()
+{
+ if (!pp_.get())
+ pp_.reset(new ParagraphParameters());
+
+ /// get paragraph
+ Paragraph const * par_ = lv_.view()->getLyXText()->cursor.par();
+
+ /// Set the paragraph parameters
+ *pp_ = par_->params();
+
+ /// this needs to be done separately
+ pp_->labelWidthString(par_->getLabelWidthString());
+
+ /// alignment
+ LyXTextClass const & tclass =
+ textclasslist[lv_.view()->buffer()->params.textclass];
+ if (pp_->align() == LYX_ALIGN_LAYOUT)
+ pp_->align(tclass[par_->layout()].align);
+
+ /// is alignment possible
+ alignpos_ = tclass[par_->layout()].alignpossible;
+
+ /// is paragraph in inset
+ ininset_ = par_->inInset();
+}
--- /dev/null
+// -*- C++ -*-
+/**
+ * \file ControlParagraph.h
+ * Copyright 2002 The LyX Team.
+ * See the file COPYING.
+ *
+ * \author Edwin Leuven <leuven@fee.uva.nl>
+ */
+
+#ifndef CONTROLPARAGRAPH_H
+#define CONTROLPARAGRAPH_H
+
+#include <boost/scoped_ptr.hpp>
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#include "ControlDialog_impl.h"
+#include "ParagraphParameters.h"
+
+/** A controller for Paragraph dialogs.
+ */
+class ControlParagraph : public ControlDialogBD
+{
+public:
+ ///
+ ControlParagraph(LyXView &, Dialogs &);
+
+ ///
+ ParagraphParameters & params();
+ ///
+ bool inInset() const;
+ ///
+ LyXAlignment alignPossible() const;
+
+private:
+ /// Get changed parameters and Dispatch them to the kernel.
+ virtual void apply();
+ /// set the params before show or update.
+ virtual void setParams();
+
+ ///
+ boost::scoped_ptr<ParagraphParameters> pp_;
+ ///
+ bool ininset_;
+ ///
+ LyXAlignment alignpos_;
+};
+
+#endif // CONTROLPARAGRAPH_H
+
#include "ControlIndex.h"
#include "ControlLog.h"
#include "ControlMinipage.h"
+#include "ControlParagraph.h"
#include "ControlPreamble.h"
#include "ControlPrint.h"
#include "ControlRef.h"
: GUI<ControlFloat, GUIview, NoRepeatedApplyReadOnlyPolicy, GUIbc>(lv, d) {}
};
+/** Specialization for Paragraph dialog
+ */
+template <class GUIview, class GUIbc>
+class GUIParagraph : public GUI<ControlParagraph, GUIview,
+ OkApplyCancelReadOnlyPolicy, GUIbc>
+{
+public:
+ ///
+ GUIParagraph(LyXView & lv, Dialogs & d)
+ : GUI<ControlParagraph, GUIview,
+ OkApplyCancelReadOnlyPolicy, GUIbc>(lv, d) {}
+};
/** Specialization for Preamble dialog
*/
ControlLog.h \
ControlMinipage.C \
ControlMinipage.h \
+ ControlParagraph.C \
+ ControlParagraph.h \
ControlPreamble.C \
ControlPreamble.h \
ControlPrint.C \
+2002-06-11 Edwin Leuven <leuven@fee.uva.nl>
+
+ * FormParagraph.[Ch]: moved to mvc
+ * form_paragraph.[Ch]: idem
+ * forms/form_paragraph.fd: idem
+ * Dialogs.C: idem
+
2002-06-06 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* GUIRunTime.C (initialiseGraphics): condition the choice of
* xformsGImage.h: use FLIMAGE_H_LOCATION to include flimage.h.
2002-06-10 Lars Gullik Bjønnes <larsbj@birdstep.com>
-
+
* FormMathsPanel.C: do not include ButtonController.tmpl
* FormPreferences.C: ditto
* xformsBC.C: ditto
#include "form_include.h"
#include "form_index.h"
#include "form_minipage.h"
+#include "form_paragraph.h"
#include "form_preamble.h"
#include "form_print.h"
#include "form_ref.h"
#include "FormIndex.h"
#include "FormLog.h"
#include "FormMinipage.h"
+#include "FormParagraph.h"
#include "FormPreamble.h"
#include "FormPrint.h"
#include "FormRef.h"
#include "FormDocument.h"
#include "FormMathsPanel.h"
-#include "FormParagraph.h"
#include "FormPreferences.h"
#include "FormTabular.h"
NoRepeatedApplyReadOnlyPolicy, xformsBC>(*lv, *this));
add(new GUI<ControlFloat, FormFloat,
NoRepeatedApplyReadOnlyPolicy, xformsBC>(*lv, *this));
+ add(new GUI<ControlParagraph, FormParagraph,
+ OkApplyCancelReadOnlyPolicy, xformsBC>(*lv, *this));
add(new GUI<ControlPreamble, FormPreamble,
NoRepeatedApplyReadOnlyPolicy, xformsBC>(*lv, *this));
add(new GUI<ControlPrint, FormPrint,
add(new FormDocument(lv, this));
add(new FormMathsPanel(lv, this));
- add(new FormParagraph(lv, this));
add(new FormPreferences(lv, this));
add(new FormTabular(lv, this));
#include "FormParagraph.h"
#include "form_paragraph.h"
-#include "Dialogs.h"
-#include "Liason.h"
-#include "frontends/LyXView.h"
-#include "buffer.h"
-#include "lyxtext.h"
+#include "ControlParagraph.h"
#include "xforms_helpers.h"
#include "lyxrc.h" // to set the deafult length values
-#include "BufferView.h"
-#include "lyxtextclasslist.h"
-#include "Spacing.h"
-#include "ParagraphParameters.h"
#include "input_validators.h"
#include "helper_funcs.h"
+#include "gettext.h"
+#include "xformsBC.h"
+#include "layout.h" // LyXAlignment
#include "support/lstrings.h"
#include "support/LAssert.h"
-#include <boost/bind.hpp>
-
#include <functional>
-using Liason::setMinibuffer;
using std::vector;
using std::bind2nd;
using std::remove_if;
-
-FormParagraph::FormParagraph(LyXView * lv, Dialogs * d)
- : FormBaseBD(lv, d, _("Paragraph Layout")), par_(0)
-{
- // let the dialog be shown
- // This is a permanent connection so we won't bother
- // storing a copy because we won't be disconnecting.
- d->showParagraph = boost::bind(&FormParagraph::show, this);
-}
-
-
-void FormParagraph::connect()
-{
- cp_ = d_->updateParagraph
- .connect(boost::bind(&FormParagraph::changedParagraph, this));
- FormBaseBD::connect();
-}
-
-
-void FormParagraph::disconnect()
-{
- cp_.disconnect();
- FormBaseBD::disconnect();
-}
-
-
-Paragraph const * FormParagraph::getCurrentParagraph() const
-{
- return lv_->view()->getLyXText()->cursor.par();
-}
-
-
-void FormParagraph::changedParagraph()
-{
- /// Record the paragraph
- Paragraph const * const p = getCurrentParagraph();
- if (p == 0) // this is wrong as we don't set par_ here! /* || p == par_) */
- return;
-
- // For now, don't bother checking if the params are different.
-
- // Will the underlying paragraph accept our changes?
- Inset * const inset = p->inInset();
- bool const accept = !(inset && inset->forceDefaultParagraphs(inset));
- bc().valid(accept);
-
- if (!accept) {
- postWarning(_("Cannot apply paragraph settings to this inset!"));
- } else {
- clearMessage();
- }
-}
-
-
-void FormParagraph::redraw()
-{
- if (form() && form()->visible)
- fl_redraw_form(form());
-}
-
-
-FL_FORM * FormParagraph::form() const
-{
- if (dialog_.get())
- return dialog_->form;
- return 0;
-}
-
+typedef FormCB<ControlParagraph, FormDB<FD_form_paragraph> > base_class;
+
+FormParagraph::FormParagraph(ControlParagraph & c)
+ : base_class(c, _("Paragraph Layout"), false)
+{}
void FormParagraph::build()
{
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);
+ 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,
return space;
}
-
void validateVSpaceWidgets(FL_OBJECT * choice_type, FL_OBJECT * input_length)
{
// Paranoia check!
} // namespace anon
-
void FormParagraph::apply()
{
- if (!lv_->view()->available() || !dialog_.get())
- return;
+ if (!form()) return;
+ /* spacing */
// If a vspace kind is "Length" but there's no text in
// the input field, reset the kind to "None".
validateVSpaceWidgets(dialog_->choice_space_above,
dialog_->input_space_above);
- validateVSpaceWidgets(dialog_->choice_space_below,
- dialog_->input_space_below);
-
- bool const line_top = fl_get_button(dialog_->check_lines_top);
- bool const line_bottom = fl_get_button(dialog_->check_lines_bottom);
- bool const pagebreak_top = fl_get_button(dialog_->check_pagebreaks_top);
- bool const pagebreak_bottom = fl_get_button(dialog_->check_pagebreaks_bottom);
-
+
VSpace const space_top =
setVSpaceFromWidgets(dialog_->choice_space_above,
dialog_->input_space_above,
dialog_->choice_value_space_above,
dialog_->check_space_above);
+
+ controller().params().spaceTop(space_top);
+
+ validateVSpaceWidgets(dialog_->choice_space_below,
+ dialog_->input_space_below);
VSpace const space_bottom =
setVSpaceFromWidgets(dialog_->choice_space_below,
dialog_->input_space_below,
dialog_->choice_value_space_below,
dialog_->check_space_below);
+
+ controller().params().spaceBottom(space_bottom);
+ /* lines and pagebreaks */
+ bool const line_top = fl_get_button(dialog_->check_lines_top);
+ controller().params().lineTop(line_top);
+
+ bool const line_bottom = fl_get_button(dialog_->check_lines_bottom);
+ controller().params().lineBottom(line_bottom);
+
+ bool const pagebreak_top = fl_get_button(dialog_->check_pagebreaks_top);
+ controller().params().pagebreakTop(pagebreak_top);
+
+ bool const pagebreak_bottom = fl_get_button(dialog_->check_pagebreaks_bottom);
+ controller().params().pagebreakBottom(pagebreak_bottom);
+
+
+ /* alignment */
LyXAlignment align;
if (fl_get_button(dialog_->radio_align_left))
align = LYX_ALIGN_LEFT;
align = LYX_ALIGN_CENTER;
else
align = LYX_ALIGN_BLOCK;
-
+ controller().params().align(align);
+
+ /* label width */
string const labelwidthstring =
getStringFromInput(dialog_->input_labelwidth);
+ controller().params().labelWidthString(labelwidthstring);
+ /* indendation */
bool const noindent = fl_get_button(dialog_->check_noindent);
+ controller().params().noindent(noindent);
+ /* get spacing */
Spacing::Space linespacing = Spacing::Default;
string other;
switch (fl_get_choice(dialog_->choice_linespacing)) {
}
Spacing const spacing(linespacing, other);
-
- LyXText * text(lv_->view()->getLyXText());
- text->setParagraph(lv_->view(), line_top, line_bottom, pagebreak_top,
- pagebreak_bottom, space_top, space_bottom, spacing,
- align, labelwidthstring, noindent);
-
- // Actually apply these settings
- lv_->view()->update(text,
- BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE);
- lv_->buffer()->markDirty();
- setMinibuffer(lv_, _("Paragraph layout set"));
+ controller().params().spacing(spacing);
+
}
-
namespace {
void setWidgetsFromVSpace(VSpace const & space,
} // namespace anon
-
void FormParagraph::update()
{
if (!dialog_.get())
return;
- // Do this first; some objects may be de/activated subsequently.
- bc_.readOnly(lv_->buffer()->isReadonly());
-
- /// Record the paragraph
- par_ = getCurrentParagraph();
-
- fl_set_input(dialog_->input_labelwidth,
- par_->getLabelWidthString().c_str());
+ /* label width */
+ string labelwidth = controller().params().labelWidthString();
+ fl_set_input(dialog_->input_labelwidth, labelwidth.c_str());
setEnabled(dialog_->input_labelwidth,
- (par_->getLabelWidthString() != _("Senseless with this layout!")));
+ labelwidth != _("Senseless with this layout!"));
+ /* alignment */
fl_set_button(dialog_->radio_align_right, 0);
fl_set_button(dialog_->radio_align_left, 0);
fl_set_button(dialog_->radio_align_center, 0);
fl_set_button(dialog_->radio_align_block, 0);
-
- LyXTextClass const & tclass =
- textclasslist[lv_->view()->buffer()->params.textclass];
-
- int align = par_->getAlign();
- if (align == LYX_ALIGN_LAYOUT)
- align = tclass[par_->layout()].align;
+
+ LyXAlignment align = controller().params().align();
switch (align) {
case LYX_ALIGN_RIGHT:
break;
}
- LyXAlignment alignpos = tclass[par_->layout()].alignpossible;
+ LyXAlignment alignpos = controller().alignPossible();
setEnabled(dialog_->radio_align_block, bool(alignpos & LYX_ALIGN_BLOCK));
setEnabled(dialog_->radio_align_center, bool(alignpos & LYX_ALIGN_CENTER));
setEnabled(dialog_->radio_align_right, bool(alignpos & LYX_ALIGN_RIGHT));
// no inset-text-owned paragraph may have pagebreaks
- setEnabled(dialog_->check_pagebreaks_top, !par_->inInset());
- setEnabled(dialog_->check_pagebreaks_bottom, !par_->inInset());
+ bool ininset = controller().inInset();
+ setEnabled(dialog_->check_pagebreaks_top, !ininset);
+ setEnabled(dialog_->check_pagebreaks_bottom, !ininset);
+ /* lines, pagebreaks and indent */
fl_set_button(dialog_->check_lines_top,
- par_->params().lineTop());
+ controller().params().lineTop());
fl_set_button(dialog_->check_lines_bottom,
- par_->params().lineBottom());
+ controller().params().lineBottom());
fl_set_button(dialog_->check_pagebreaks_top,
- par_->params().pagebreakTop());
+ controller().params().pagebreakTop());
fl_set_button(dialog_->check_pagebreaks_bottom,
- par_->params().pagebreakBottom());
+ controller().params().pagebreakBottom());
fl_set_button(dialog_->check_noindent,
- par_->params().noindent());
+ controller().params().noindent());
+ /* linespacing */
int linespacing;
- Spacing const space = par_->params().spacing();
+ Spacing const space = controller().params().spacing();
switch (space.getSpace()) {
default: linespacing = 1; break;
setEnabled(dialog_->input_linespacing, false);
}
- setWidgetsFromVSpace(par_->params().spaceTop(),
+ /* vspace top */
+ setWidgetsFromVSpace(controller().params().spaceTop(),
dialog_->choice_space_above,
dialog_->input_space_above,
dialog_->choice_value_space_above,
dialog_->check_space_above);
- setWidgetsFromVSpace(par_->params().spaceBottom(),
+ /* vspace bottom */
+ setWidgetsFromVSpace(controller().params().spaceBottom(),
dialog_->choice_space_below,
dialog_->input_space_below,
dialog_->choice_value_space_below,
dialog_->check_space_below);
+ /* no indent */
fl_set_button(dialog_->check_noindent,
- par_->params().noindent());
+ controller().params().noindent());
}
-
namespace {
void synchronizeSpaceWidgets(FL_OBJECT * choice_type,
FL_OBJECT * input_length,
- FL_OBJECT * choice_length,
- bool readonly)
+ FL_OBJECT * choice_length)
{
// Paranoia check!
lyx::Assert(choice_type && choice_type->objclass == FL_CHOICE &&
setEnabled(choice_length, false);
} else {
- setEnabled(input_length, !readonly);
- setEnabled(choice_length, !readonly);
+ setEnabled(input_length, true);
+ setEnabled(choice_length, true);
string const length = getStringFromInput(input_length);
} // namespace anon
-
-bool FormParagraph::input(FL_OBJECT * ob, long)
+ButtonPolicy::SMInput FormParagraph::input(FL_OBJECT * ob, long)
{
clearMessage();
//
// "Synchronize" the choices and input fields, making it
// impossible to commit senseless data.
-
if (ob == dialog_->choice_space_above) {
synchronizeSpaceWidgets(dialog_->choice_space_above,
dialog_->input_space_above,
- dialog_->choice_value_space_above,
- lv_->buffer()->isReadonly());
+ dialog_->choice_value_space_above);
}
if (ob == dialog_->choice_space_below) {
synchronizeSpaceWidgets(dialog_->choice_space_below,
dialog_->input_space_below,
- dialog_->choice_value_space_below,
- lv_->buffer()->isReadonly());
+ dialog_->choice_value_space_below);
}
// Display a warning if the input is senseless
if (choice_spacing == 5 && int(spacing) == 0)
valid = false;
- return valid;
+ return ButtonPolicy::SMI_VALID;
}
+
+
// -*- C++ -*-
/**
- * \file Tooltips.h
- * Copyright 2000-2001 the LyX Team
- * Read the file COPYING
+ * \file FormParagraph.h
+ * Copyright 2001 The LyX Team.
+ * See the file COPYING.
*
* \author Jürgen Vigna, jug@sad.it
*/
#pragma interface
#endif
-#include "FormBaseDeprecated.h"
+#include "FormBase.h"
-#include <boost/scoped_ptr.hpp>
-#include <boost/signals/connection.hpp>
-
-class Paragraph;
struct FD_form_paragraph;
+class ControlParagraph;
/** This class provides an XForms implementation of the FormParagraph dialog.
*/
-class FormParagraph : public FormBaseBD {
+class FormParagraph
+ : public FormCB<ControlParagraph, FormDB<FD_form_paragraph> > {
public:
///
- FormParagraph(LyXView *, Dialogs *);
+ FormParagraph(ControlParagraph &);
private:
- /// Pointer to the actual instantiation of the ButtonController.
- virtual xformsBC & bc();
- /** Redraw the form (on receipt of a Signal indicating, for example,
- that the xforms colours have been re-mapped). */
- virtual void redraw();
/// Build the dialog
virtual void build();
/// Apply from dialog
virtual void apply();
/// Update the dialog
virtual void update();
+
/// Filter the inputs on callback from xforms
- virtual bool input(FL_OBJECT * ob, long);
- /// Connect signals
- virtual void connect();
- /// Disconnect signals
- virtual void disconnect();
- ///
- void changedParagraph();
- ///
- Paragraph const * getCurrentParagraph() const;
- ///
- virtual FL_FORM * form() const;
+ virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
/// Fdesign generated method
FD_form_paragraph * build_paragraph();
-
- /// Real GUI implementation.
- boost::scoped_ptr<FD_form_paragraph> dialog_;
-
- /// The ButtonController
- ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_;
-
- /// Changed Paragraph connection.
- boost::signals::connection cp_;
-
- /// The current Paragraph
- Paragraph const * par_;
};
-
-inline
-xformsBC & FormParagraph::bc()
-{
- return bc_;
-}
#endif
}
fl_set_object_color(obj, FL_COL1, FL_YELLOW);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Left|#f");
fdui->radio_align_left = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 15, 60, 80, 30, idex(_(dummy)));
}
fl_set_object_color(obj, FL_COL1, FL_YELLOW);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Block|#c");
fdui->radio_align_block = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 115, 30, 80, 30, idex(_(dummy)));
}
fl_set_object_color(obj, FL_COL1, FL_YELLOW);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Center|#n");
fdui->radio_align_center = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 115, 60, 80, 30, idex(_(dummy)));
}
fl_set_object_color(obj, FL_COL1, FL_YELLOW);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
fl_end_group();
obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 240, 20, 120, 75, _("Lines"));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Below|#E");
fdui->check_lines_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 245, 60, 120, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 370, 20, 120, 75, _("Page breaks"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Below|#l");
fdui->check_pagebreaks_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 375, 60, 120, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 110, 480, 105, _("Vertical spaces"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
}
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
fdui->input_space_above = obj = fl_add_input(FL_NORMAL_INPUT, 190, 130, 90, 30, "");
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Keep|#K");
fdui->check_space_above = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 375, 130, 40, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Below:|#w");
fdui->choice_space_below = obj = fl_add_choice(FL_NORMAL_CHOICE, 80, 170, 100, 30, idex(_(dummy)));
}
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
fdui->input_space_below = obj = fl_add_input(FL_NORMAL_INPUT, 190, 170, 90, 30, "");
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Keep|#p");
fdui->check_space_below = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 375, 170, 40, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 230, 345, 55, _("Line spacing"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
}
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
fdui->input_linespacing = obj = fl_add_input(FL_NORMAL_INPUT, 190, 245, 155, 30, "");
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 300, 480, 50, _("Label Width"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_West, FL_East);
fl_set_object_resize(obj, FL_RESIZE_X);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 365, 230, 125, 55, _("Indent"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Restore|#R");
fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 360, 100, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedRestoreCB, 0);
+ fl_set_object_callback(obj, C_FormBaseRestoreCB, 0);
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 200, 360, 90, 30, _("OK"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedOKCB, 0);
+ fl_set_object_callback(obj, C_FormBaseOKCB, 0);
{
char const * const dummy = N_("Apply|#A");
fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 300, 360, 90, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedApplyCB, 0);
+ fl_set_object_callback(obj, C_FormBaseApplyCB, 0);
{
char const * const dummy = N_("Cancel|^[");
fdui->button_close = obj = fl_add_button(FL_NORMAL_BUTTON, 400, 360, 90, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0);
+ fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 395, 480, 1, "");
fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 10, 405, 480, 35, "");
fl_set_object_boxtype(obj, FL_NO_BOX);
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fdui->choice_value_space_above = obj = fl_add_choice(FL_NORMAL_CHOICE, 290, 130, 65, 30, "");
fl_set_object_boxtype(obj, FL_FRAME_BOX);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
fdui->choice_value_space_below = obj = fl_add_choice(FL_NORMAL_CHOICE, 290, 170, 65, 30, "");
fl_set_object_boxtype(obj, FL_FRAME_BOX);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
fl_end_form();
fdui->form->fdui = fdui;
#define FD_form_paragraph_h_
/** Callbacks, globals and object handlers **/
-extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long);
-extern "C" void C_FormBaseDeprecatedRestoreCB(FL_OBJECT *, long);
-extern "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT *, long);
-extern "C" void C_FormBaseDeprecatedApplyCB(FL_OBJECT *, long);
-extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseInputCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseRestoreCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseOKCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseApplyCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
/**** Forms and Objects ****/
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
-name:
+name:
callback:
argument:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_align_right
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_align_left
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_align_block
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_align_center
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: check_lines_top
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: check_lines_bottom
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: check_pagebreaks_top
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: check_pagebreaks_bottom
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_space_above
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_space_above
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: check_space_above
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_space_below
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_space_below
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: check_space_below
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_linespacing
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_linespacing
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_X
gravity: FL_West FL_East
name: input_labelwidth
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: check_noindent
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_restore
-callback: C_FormBaseDeprecatedRestoreCB
+callback: C_FormBaseRestoreCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_ok
-callback: C_FormBaseDeprecatedOKCB
+callback: C_FormBaseOKCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_apply
-callback: C_FormBaseDeprecatedApplyCB
+callback: C_FormBaseApplyCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_close
-callback: C_FormBaseDeprecatedCancelCB
+callback: C_FormBaseCancelCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_value_space_above
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_value_space_below
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
==============================