+2001-03-20 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * language.h (Languages): added size_type and size().
+
2001-03-20 Lars Gullik Bjønnes <larsbj@trylle.birdstep.com>
* buffer.C (parseSingleLyXformat2Token): Try to give a bit better
*
* LyX, The Document Processor
*
- * Copyright 2000 The LyX Team.
+ * Copyright 2000-2001 The LyX Team.
*
* ======================================================
*
*
* LyX, The Document Processor
*
- * Copyright 2000 The LyX Team.
+ * Copyright 2000-2001 The LyX Team.
*
* ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-2000 The LyX Team.
+ * Copyright 1995-2001 The LyX Team.
*
* This file Copyright 2000
* Allan Rae
+2001-03-21 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * ControlCharacter.[Ch]: new files; controller for the character popup.
+
+ * ControlCitation.[Ch] (getStringFromVector, getVectorFromString):
+ moved to new files helper_funcs.[Ch].
+
+ * helper_funcs.[Ch]: new files. Some useful helper functions and
+ functors.
+
+ * Makefile.am: added new files.
+
2001-03-20 Angus Leeming <a.leeming@ic.ac.uk>
* ControlCitation.C (getBibkeyInfo): parse non-BibTeX entries correctly.
*
* LyX, The Document Processor
*
- * Copyright 2000 The LyX Team.
+ * Copyright 2001 The LyX Team.
*
* ======================================================
*
*
* LyX, The Document Processor
*
- * Copyright 2000 The LyX Team.
+ * Copyright 2001 The LyX Team.
*
* ======================================================
*
#endif
#include "DialogBase.h" // This can go eventually
+#include "ButtonController.h"
-class ButtonControllerBase;
class Dialogs;
class LyXView;
class ViewBase;
LyXView & lv_;
};
+#include "ViewBase.h"
#endif // CONTROLBASE_H
#endif
#include "ControlCommand.h"
-#include "ButtonController.h"
-#include "ViewBase.h"
/** A controller for Bibitem dialogs.
*/
#endif
#include "ControlCommand.h"
-#include "ButtonController.h"
-#include "ViewBase.h"
/** A controller for Bibtex dialogs.
*/
--- /dev/null
+/**
+ * \file ControlCharacter.C
+ * Copyright 2001 The LyX Team.
+ * See the file COPYING.
+ *
+ * \author Angus Leeming, a.leeming@.ac.uk
+ */
+
+#include <vector>
+
+#ifdef __GNUG_
+#pragma implementation
+#endif
+
+#include <config.h>
+
+#include "ControlCharacter.h"
+#include "bufferview_funcs.h"
+#include "Dialogs.h"
+#include "Liason.h"
+#include "LyXView.h"
+#include "buffer.h"
+#include "lyxtext.h"
+#include "language.h"
+
+using Liason::setMinibuffer;
+using SigC::slot;
+using std::vector;
+
+ControlCharacter::ControlCharacter(LyXView & lv, Dialogs & d)
+ : ControlConnectBD(lv, d), font_(0), toggleall_(false)
+{
+ d.showLayoutCharacter.connect(slot(this, &ControlCharacter::show));
+ d.setUserFreeFont.connect(slot(this, &ControlCharacter::apply));
+}
+
+
+void ControlCharacter::show()
+{
+ if (!lv_.view()->available()) return;
+
+ if (font_) delete font_;
+ font_ = new LyXFont(LyXFont::ALL_IGNORE);
+
+ bc().readOnly(isReadonly());
+ view().show();
+}
+
+
+void ControlCharacter::update()
+{
+ if (!lv_.view()->available()) return;
+
+ if (font_) delete font_;
+ font_ = new LyXFont(LyXFont::ALL_IGNORE);
+
+ bc().readOnly(isReadonly());
+ view().update();
+}
+
+
+void ControlCharacter::hide()
+{
+ if (font_) {
+ delete font_;
+ font_ = 0;
+ }
+
+ disconnect();
+ view().hide();
+}
+
+
+void ControlCharacter::apply()
+{
+ if (!lv_.view()->available())
+ return;
+
+ view().apply();
+
+ ToggleAndShow(lv_.view(), *font_, toggleall_);
+ lv_.view()->setState();
+ lv_.buffer()->markDirty();
+ setMinibuffer(&lv_, _("Character set"));
+}
+
+
+void ControlCharacter::setFamily(LyXFont::FONT_FAMILY val)
+{
+ font_->setFamily(val);
+}
+
+void ControlCharacter::setSeries(LyXFont::FONT_SERIES val)
+{
+ font_->setSeries(val);
+}
+
+void ControlCharacter::setShape(LyXFont::FONT_SHAPE val)
+{
+ font_->setShape(val);
+}
+
+void ControlCharacter::setSize(LyXFont::FONT_SIZE val)
+{
+ font_->setSize(val);
+}
+
+void ControlCharacter::setBar(ControlCharacter::FONT_STATE val)
+{
+ switch (val) {
+ case IGNORE:
+ font_->setEmph(LyXFont::IGNORE);
+ font_->setUnderbar(LyXFont::IGNORE);
+ font_->setNoun(LyXFont::IGNORE);
+ font_->setLatex(LyXFont::IGNORE);
+ break;
+
+ case EMPH_TOGGLE:
+ font_->setEmph(LyXFont::TOGGLE);
+ break;
+
+ case UNDERBAR_TOGGLE:
+ font_->setUnderbar(LyXFont::TOGGLE);
+ break;
+
+ case NOUN_TOGGLE:
+ font_->setNoun(LyXFont::TOGGLE);
+ break;
+
+ case LATEX_TOGGLE:
+ font_->setLatex(LyXFont::TOGGLE);
+ break;
+
+ case INHERIT:
+ font_->setEmph(LyXFont::INHERIT);
+ font_->setUnderbar(LyXFont::INHERIT);
+ font_->setNoun(LyXFont::INHERIT);
+ font_->setLatex(LyXFont::INHERIT);
+ break;
+ }
+}
+
+void ControlCharacter::setColor(LColor::color val)
+{
+ switch (val) {
+ case LColor::ignore:
+ case LColor::none:
+ case LColor::black:
+ case LColor::white:
+ case LColor::red:
+ case LColor::green:
+ case LColor::blue:
+ case LColor::cyan:
+ case LColor::magenta:
+ case LColor::yellow:
+ case LColor::inherit:
+ font_->setColor(val);
+ break;
+
+ default:
+ break;
+ }
+}
+
+
+void ControlCharacter::setLanguage(string const & val)
+{
+ if (val == _("No change"))
+ font_->setLanguage(ignore_language);
+
+ else if ( val == _("Reset"))
+ font_->setLanguage(lv_.buffer()->params.language);
+
+ else
+ font_->setLanguage(languages.getLanguage(val));
+}
+
+void ControlCharacter::setToggleAll(bool t)
+{
+ toggleall_ = t;
+}
+
+
+vector<ControlCharacter::FamilyPair> const getFamilyData()
+{
+ vector<ControlCharacter::FamilyPair> family(5);
+
+ ControlCharacter::FamilyPair pr;
+ pr.first = _("No change"); pr.second = LyXFont::IGNORE_FAMILY;
+ family[0] = pr;
+ pr.first = _("Roman"); pr.second = LyXFont::ROMAN_FAMILY;
+ family[1] = pr;
+ pr.first = _("Sans Serif"); pr.second = LyXFont::SANS_FAMILY;
+ family[2] = pr;
+ pr.first = _("Typewriter"); pr.second = LyXFont::TYPEWRITER_FAMILY;
+ family[3] = pr;
+ pr.first = _("Reset"); pr.second = LyXFont::INHERIT_FAMILY;
+ family[4] = pr;
+
+ return family;
+}
+
+
+vector<ControlCharacter::SeriesPair> const getSeriesData()
+{
+ vector<ControlCharacter::SeriesPair> series(4);
+
+ ControlCharacter::SeriesPair pr;
+ pr.first = _("No change"); pr.second = LyXFont::IGNORE_SERIES;
+ series[0] = pr;
+ pr.first = _("Medium"); pr.second = LyXFont::MEDIUM_SERIES;
+ series[1] = pr;
+ pr.first = _("Bold"); pr.second = LyXFont::BOLD_SERIES;
+ series[2] = pr;
+ pr.first = _("Reset"); pr.second = LyXFont::INHERIT_SERIES;
+ series[3] = pr;
+
+ return series;
+}
+
+
+vector<ControlCharacter::ShapePair> const getShapeData()
+{
+ vector<ControlCharacter::ShapePair> shape(6);
+
+ ControlCharacter::ShapePair pr;
+ pr.first = _("No change"); pr.second = LyXFont::IGNORE_SHAPE;
+ shape[0] = pr;
+ pr.first = _("Upright"); pr.second = LyXFont::UP_SHAPE;
+ shape[1] = pr;
+ pr.first = _("Italic"); pr.second = LyXFont::ITALIC_SHAPE;
+ shape[2] = pr;
+ pr.first = _("Slanted"); pr.second = LyXFont::SLANTED_SHAPE;
+ shape[3] = pr;
+ pr.first = _("Small Caps"); pr.second = LyXFont::SMALLCAPS_SHAPE;
+ shape[4] = pr;
+ pr.first = _("Reset"); pr.second = LyXFont::INHERIT_SHAPE;
+ shape[5] = pr;
+
+ return shape;
+}
+
+
+vector<ControlCharacter::SizePair> const getSizeData()
+{
+ vector<ControlCharacter::SizePair> size(14);
+
+ ControlCharacter::SizePair pr;
+ pr.first = _("No change"); pr.second = LyXFont::IGNORE_SIZE;
+ size[0] = pr;
+ pr.first = _("Tiny"); pr.second = LyXFont::SIZE_TINY;
+ size[1] = pr;
+ pr.first = _("Smallest"); pr.second = LyXFont::SIZE_SCRIPT;
+ size[2] = pr;
+ pr.first = _("Smaller"); pr.second = LyXFont::SIZE_FOOTNOTE;
+ size[3] = pr;
+ pr.first = _("Small"); pr.second = LyXFont::SIZE_SMALL;
+ size[4] = pr;
+ pr.first = _("Normal"); pr.second = LyXFont::SIZE_NORMAL;
+ size[5] = pr;
+ pr.first = _("Large"); pr.second = LyXFont::SIZE_LARGE;
+ size[6] = pr;
+ pr.first = _("Larger"); pr.second = LyXFont::SIZE_LARGER;
+ size[7] = pr;
+ pr.first = _("Largest"); pr.second = LyXFont::SIZE_LARGEST;
+ size[8] = pr;
+ pr.first = _("Huge"); pr.second = LyXFont::SIZE_HUGE;
+ size[9] = pr;
+ pr.first = _("Huger"); pr.second = LyXFont::SIZE_HUGER;
+ size[10] = pr;
+ pr.first = _("Increase"); pr.second = LyXFont::INCREASE_SIZE;
+ size[11] = pr;
+ pr.first = _("Decrease"); pr.second = LyXFont::DECREASE_SIZE;
+ size[12] = pr;
+ pr.first = _("Reset"); pr.second = LyXFont::INHERIT_SIZE;
+ size[13] = pr;
+
+ return size;
+}
+
+
+vector<ControlCharacter::BarPair> const getBarData()
+{
+ vector<ControlCharacter::BarPair> bar(6);
+
+ ControlCharacter::BarPair pr;
+ pr.first = _("No change"); pr.second = ControlCharacter::IGNORE;
+ bar[0] = pr;
+ pr.first = _("Emph"); pr.second = ControlCharacter::EMPH_TOGGLE;
+ bar[1] = pr;
+ pr.first = _("Underbar"); pr.second = ControlCharacter::UNDERBAR_TOGGLE;
+ bar[2] = pr;
+ pr.first = _("Noun"); pr.second = ControlCharacter::NOUN_TOGGLE;
+ bar[3] = pr;
+ pr.first = _("LaTeX mode"); pr.second = ControlCharacter::LATEX_TOGGLE;
+ bar[4] = pr;
+ pr.first = _("Reset"); pr.second = ControlCharacter::INHERIT;
+ bar[5] = pr;
+
+ return bar;
+}
+
+
+vector<ControlCharacter::ColorPair> const getColorData()
+{
+ vector<ControlCharacter::ColorPair> color(11);
+
+ ControlCharacter::ColorPair pr;
+ pr.first = _("No change"); pr.second = LColor::ignore;
+ color[0] = pr;
+ pr.first = _("No color"); pr.second = LColor::none;
+ color[1] = pr;
+ pr.first = _("Black"); pr.second = LColor::black;
+ color[2] = pr;
+ pr.first = _("White"); pr.second = LColor::white;
+ color[3] = pr;
+ pr.first = _("Red"); pr.second = LColor::red;
+ color[4] = pr;
+ pr.first = _("Green"); pr.second = LColor::green;
+ color[5] = pr;
+ pr.first = _("Blue"); pr.second = LColor::blue;
+ color[6] = pr;
+ pr.first = _("Cyan"); pr.second = LColor::cyan;
+ color[7] = pr;
+ pr.first = _("Magenta"); pr.second = LColor::magenta;
+ color[8] = pr;
+ pr.first = _("Yellow"); pr.second = LColor::yellow;
+ color[9] = pr;
+ pr.first = _("Reset"); pr.second = LColor::inherit;
+ color[10] = pr;
+
+ return color;
+}
+
+
+vector<string> const getLanguageData()
+{
+ vector<string> langs(languages.size() + 2);
+
+ langs[0] = _("No change");
+ langs[1] = _("Reset");
+
+ vector<string>::size_type i = 1;
+ for (Languages::const_iterator cit = languages.begin();
+ cit != languages.end(); ++cit) {
+ langs[++i] = cit->second.lang();
+ }
+
+ return langs;
+}
--- /dev/null
+/**
+ * \file ControlCharacter.h
+ * Copyright 2001 The LyX Team.
+ * See the file COPYING.
+ *
+ * \author Angus Leeming, a.leeming@.ac.uk
+ */
+
+#ifndef CONTROLCHARACTER_H
+#define CONTROLCHARACTER_H
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#include "ControlConnections.h"
+#include "lyxfont.h"
+#include "LColor.h"
+
+/** A controller for Character dialogs.
+ */
+class ControlCharacter : public ControlConnectBD
+{
+public:
+ ///
+ enum FONT_STATE {
+ ///
+ IGNORE,
+ ///
+ EMPH_TOGGLE,
+ ///
+ UNDERBAR_TOGGLE,
+ ///
+ NOUN_TOGGLE,
+ ///
+ LATEX_TOGGLE,
+ ///
+ INHERIT
+ };
+
+ ///
+ typedef std::pair<string, LyXFont::FONT_FAMILY> FamilyPair;
+ ///
+ typedef std::pair<string, LyXFont::FONT_SERIES> SeriesPair;
+ ///
+ typedef std::pair<string, LyXFont::FONT_SHAPE> ShapePair;
+ ///
+ typedef std::pair<string, LyXFont::FONT_SIZE> SizePair;
+ ///
+ typedef std::pair<string, FONT_STATE> BarPair;
+ ///
+ typedef std::pair<string, LColor::color> ColorPair;
+
+ ///
+ ControlCharacter(LyXView &, Dialogs &);
+
+ ///
+ void setFamily(LyXFont::FONT_FAMILY);
+ ///
+ void setSeries(LyXFont::FONT_SERIES);
+ ///
+ void setShape(LyXFont::FONT_SHAPE);
+ ///
+ void setSize(LyXFont::FONT_SIZE);
+ ///
+ void setBar(FONT_STATE);
+ ///
+ void setColor(LColor::color);
+ ///
+ void setLanguage(string const &);
+ ///
+ void setToggleAll(bool);
+
+protected:
+ /// Get changed parameters and Dispatch them to the kernel.
+ virtual void apply();
+ /// Show the dialog.
+ virtual void show();
+ /// Update the dialog.
+ virtual void update();
+ /// Hide the dialog.
+ virtual void hide();
+
+private:
+ LyXFont * font_;
+ bool toggleall_;
+};
+
+/// Helper functions
+std::vector<ControlCharacter::FamilyPair> const getFamilyData();
+///
+std::vector<ControlCharacter::SeriesPair> const getSeriesData();
+///
+std::vector<ControlCharacter::ShapePair> const getShapeData();
+///
+std::vector<ControlCharacter::SizePair> const getSizeData();
+///
+std::vector<ControlCharacter::BarPair> const getBarData();
+///
+std::vector<ControlCharacter::ColorPair> const getColorData();
+///
+std::vector<string> const getLanguageData();
+
+/** This class instantiates and makes available the GUI-specific
+ ButtonController and View.
+ */
+template <class GUIview, class GUIbc>
+class GUICharacter : public ControlCharacter {
+public:
+ ///
+ GUICharacter(LyXView &, Dialogs &);
+ ///
+ virtual ButtonControllerBase & bc() { return bc_; }
+ ///
+ virtual ViewBase & view() { return view_; }
+
+private:
+ ///
+ ButtonController<NoRepeatedApplyReadOnlyPolicy, GUIbc> bc_;
+ ///
+ GUIview view_;
+};
+
+template <class GUIview, class GUIbc>
+GUICharacter<GUIview, GUIbc>::GUICharacter(LyXView & lv, Dialogs & d)
+ : ControlCharacter(lv, d),
+ view_(*this)
+{}
+
+#endif // CONTROLCHARACTER_H
*
* LyX, The Document Processor
*
- * Copyright 2000 The LyX Team.
+ * Copyright 2001 The LyX Team.
*
* ======================================================
*
#include "ControlCitation.h"
#include "buffer.h"
-#include "ButtonController.h"
#include "Dialogs.h"
#include "LyXView.h"
-#include "ViewBase.h"
+#include "helper_funcs.h"
#include "support/lstrings.h"
#include "support/LRegex.h"
}
-string const getStringFromVector(vector<string> const & vec, char delim)
-{
- string str;
- for (vector<string>::size_type i=0; i<vec.size(); ++i) {
- if (i > 0) str += tostr(delim);
- str += vec[i];
- }
- return str;
-}
-
-vector<string> const getVectorFromString(string const & str, char delim)
-{
- vector<string> vec;
- string keys(str);
- string tmp;
- keys = frontStrip(split(keys, tmp, delim));
- while (!tmp.empty()) {
- vec.push_back(tmp);
- keys = frontStrip(split(keys, tmp, delim));
- }
- return vec;
-}
-
vector<string>::const_iterator
searchKeys(ControlCitation const & controller,
vector<string> const & keys,
ControlCitation::Direction dir,
bool caseSensitive)
{
- vector<string> searchwords = getVectorFromString(expr, ' ');
+ vector<string> searchwords = getVectorFromString(expr, " ");
// Loop over all keys from start...
for (vector<string>::const_iterator it = start;
*
* LyX, The Document Processor
*
- * Copyright 2000 The LyX Team.
+ * Copyright 2001 The LyX Team.
*
* ======================================================
*
#endif
#include "ControlCommand.h"
-#include "ButtonController.h"
-#include "ViewBase.h"
/** A controller for Citation dialogs. All citation-specific functionality
should go in here.
/** Helper functions, of possible use to all frontends
*/
-/** Multiple citation keys are stored in InsetCommandParams::contents as a
- comma-separated string. These two functions convert to/from a vector. */
-string const getStringFromVector(std::vector<string> const &, char delim=',');
-///
-std::vector<string> const getVectorFromString(string const &, char delim=',');
-
/** Search a BibTeX info field for the given key and return the
associated field. */
string const parseBibTeX(string data, string const & findkey);
#include "ControlCommand.h"
#include "BufferView.h"
-#include "ButtonController.h"
#include "Dialogs.h"
#include "lyxfunc.h"
#include "LyXView.h"
#include "support/LAssert.h"
-#include "ViewBase.h"
ControlCommand::ControlCommand(LyXView & lv, Dialogs & d, kb_action ac)
: ControlConnectInset<InsetCommand>(lv, d),
*
* LyX, The Document Processor
*
- * Copyright 2000 The LyX Team.
+ * Copyright 2001 The LyX Team.
*
* ======================================================
*
#include "insets/insetcommand.h"
#include "commandtags.h" // kb_action
-class Dialogs;
-class LyXView;
-
/** The Inset dialog controller. Connects/disconnects signals, launches
GUI-dependent View and returns the output from this View to the kernel.
*/
*
* LyX, The Document Processor
*
- * Copyright 2000 The LyX Team.
+ * Copyright 2001 The LyX Team.
*
* ======================================================
*
#include "ControlConnections.h"
#include "Dialogs.h"
-#include "ViewBase.h"
#include "insets/lyxinset.h"
using SigC::slot;
*
* LyX, The Document Processor
*
- * Copyright 2000 The LyX Team.
+ * Copyright 2001 The LyX Team.
*
* ======================================================
*
#endif
#include <config.h>
-#include "ButtonController.h"
#include "ControlLog.h"
#include "LyXView.h"
#include "Dialogs.h"
#include "lyxrc.h"
-#include "ViewBase.h"
using std::make_pair;
using SigC::slot;
*
* ======================================================
*
- * \file ControlVCLog.h
+ * \file ControlVCLog.C
* \author John Levon, moz@compsoc.man.ac.uk
* \author Angus Leeming <a.leeming@ic.ac.uk>
*/
#endif
#include <config.h>
-#include "buffer.h"
-#include "ButtonController.h"
#include "ControlVCLog.h"
+#include "buffer.h"
#include "LyXView.h"
#include "Dialogs.h"
#include "lyxrc.h"
-#include "ViewBase.h"
using SigC::slot;
ControlBibitem.h \
ControlBibtex.C \
ControlBibtex.h \
+ ControlCharacter.C \
+ ControlCharacter.h \
ControlCitation.C \
ControlCitation.h \
ControlCommand.C \
ControlLog.h \
ControlVCLog.C \
ControlVCLog.h \
- ViewBase.h
+ ViewBase.h \
+ helper_funcs.C \
+ helper_funcs.h
# just copied from old lyx repository
dist-hook:
*
* LyX, The Document Processor
*
- * Copyright 2000 The LyX Team.
+ * Copyright 2001 The LyX Team.
*
* ======================================================
*
--- /dev/null
+/* This file is part of
+ * ======================================================
+ *
+ * LyX, The Document Processor
+ *
+ * Copyright 2001 The LyX Team.
+ *
+ * ======================================================
+ *
+ * \file helper_funcs.C
+ * \author Angus Leeming <a.leeming@ic.ac.uk>
+ */
+
+#include <vector>
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include <config.h>
+#include "LString.h"
+#include "helper_funcs.h"
+
+using std::vector;
+
+string const getStringFromVector(vector<string> const & vec,
+ string const & delim)
+{
+ string str;
+ for (vector<string>::size_type i=0; i<vec.size(); ++i) {
+ if (i > 0) str += delim;
+ str += vec[i];
+ }
+ return str;
+}
+
+vector<string> const getVectorFromString(string const & str,
+ string const & delim)
+{
+ vector<string> vec;
+ string keys(str);
+
+ for(;;) {
+ string::size_type const idx = keys.find(delim);
+ if (idx == string::npos) break;
+
+ vec.push_back(keys.substr(0, idx));
+
+ string::size_type const start = idx + delim.size();
+ keys = keys.substr(start);
+ }
+
+ return vec;
+}
+
--- /dev/null
+// -*- C++ -*-
+/* This file is part of
+ * ======================================================
+ *
+ * LyX, The Document Processor
+ *
+ * Copyright 2001 The LyX Team.
+ *
+ * ======================================================
+ *
+ * \file ControlCitation.h
+ * \author Angus Leeming <a.leeming@ic.ac.uk>
+ */
+
+#ifndef HELPERFUNCS_H
+#define HELPERFUNCS_H
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+/** Functions to convert a string to/from a vector. */
+
+///
+string const
+getStringFromVector(std::vector<string> const & vec, string const & delim=",");
+
+///
+std::vector<string> const
+getVectorFromString(string const & str, string const & delim=",");
+
+/** Functions to extract vectors of the first and second elems from a
+ vector<pair<A,B> >
+*/
+
+///
+template <class A, class B>
+std::vector<A> const getFirst(std::vector<std::pair<A,B> > const & pairVec)
+{
+ typedef std::vector<std::pair<A,B> > PV;
+
+ std::vector<A> first(pairVec.size());
+
+ for (PV::size_type i = 0; i < pairVec.size(); ++i) {
+ first[i] = pairVec[i].first;
+ }
+
+ return first;
+}
+///
+template <class A, class B>
+std::vector<B> const getSecond(std::vector<std::pair<A,B> > const & pairVec)
+{
+ typedef std::vector<std::pair<A,B> > PV;
+
+ std::vector<B> second(pairVec.size());
+
+ for (PV::size_type i = 0; i < pairVec.size(); ++i) {
+ second[i] = pairVec[i].second;
+ }
+
+ return second;
+}
+
+
+template<class Pair>
+struct firster {
+ typedef typename Pair::first_type first_type;
+ first_type const & operator()(Pair const & p) { return p.first; }
+};
+
+template<class Pair>
+struct seconder {
+ typedef typename Pair::second_type second_type;
+ second_type const & operator()(Pair const & p) { return p.second; }
+};
+
+template<class Pair>
+typename Pair::first_type const getFirst(std::vector<Pair> const & pr)
+{
+ std::vector<typename Pair::first_type> tmp(pr.size);
+ std::transform(pr.begin(), pr.end(), tmp.begin(), firster<Pair>());
+ return tmp;
+}
+
+template<class Pair>
+typename Pair::second_type const getSecond(std::vector<Pair> const & pr)
+{
+ std::vector<typename Pair::second_type> tmp(pr.size);
+ std::transform(pr.begin(), pr.end(), tmp.begin(), seconder<Pair>());
+ return tmp;
+}
+
+
+
+#endif // HELPERFUNCS_H
+
+2001-03-21 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * FormCharacter.[Ch]:
+ * forms/form_character.fd: implemented controller-view split.
+
+ * Dialogs.C: associated changes.
+
+ * FormBase.C (input): changed return to SMI_VALID.
+
+ * FormCitation.C (updateBrowser): ensure that the keys are stripped of
+ any surrounding whitespace.
+
2001-03-20 Angus Leeming <a.leeming@ic.ac.uk>
* FormBase.[Ch] (input): no longer pure virtual. Has defualt state of
#include "Dialogs.h"
+#include "xformsBC.h"
+
#include "ControlBibitem.h"
#include "ControlBibtex.h"
+#include "ControlCharacter.h"
#include "ControlCitation.h"
#include "ControlLog.h"
#include "ControlVCLog.h"
-#include "xformsBC.h"
-#include "form_bibitem.h" // needed for clean destructtion of boost::scoped ptr
+#include "combox.h" // needed for clean destructtion of boost::scoped ptr
+#include "form_bibitem.h"
#include "form_bibtex.h"
#include "form_browser.h"
+#include "form_character.h"
#include "form_citation.h"
#include "FormBibitem.h"
#include "FormBibtex.h"
+#include "FormCharacter.h"
#include "FormCitation.h"
#include "FormLog.h"
#include "FormVCLog.h"
-#include "FormCharacter.h"
#include "FormCopyright.h"
#include "FormCredits.h"
#include "FormDocument.h"
{
splash_.reset(new FormSplash(lv, this));
- add(new GUICitation<FormCitation, xformsBC>(*lv, *this));
add(new GUIBibitem<FormBibitem, xformsBC>(*lv, *this));
add(new GUIBibtex<FormBibtex, xformsBC>(*lv, *this));
+ add(new GUICharacter<FormCharacter, xformsBC>(*lv, *this));
+ add(new GUICitation<FormCitation, xformsBC>(*lv, *this));
add(new GUILog<FormLog, xformsBC>(*lv, *this));
add(new GUIVCLog<FormVCLog, xformsBC>(*lv, *this));
- add(new FormCharacter(lv, this));
add(new FormCopyright(lv, this));
add(new FormCredits(lv, this));
add(new FormDocument(lv, this));
ButtonPolicy::SMInput FormBase::input(FL_OBJECT *, long)
{
- return ButtonPolicy::SMI_NOOP;
+ return ButtonPolicy::SMI_VALID;
}
#endif
#include <config.h>
+#include "xformsBC.h"
#include "ControlBibitem.h"
#include "FormBibitem.h"
#include "form_bibitem.h"
#include "gettext.h"
-#include "xformsBC.h"
#include "support/lstrings.h" // compare
typedef FormCB<ControlBibitem, FormDB<FD_form_bibitem> > base_class;
#endif
#include <config.h>
+#include "xformsBC.h"
#include "ControlBibtex.h"
#include "FormBibtex.h"
#include "form_bibtex.h"
#include "gettext.h"
-#include "xformsBC.h"
#include "debug.h"
typedef FormCB<ControlBibtex, FormDB<FD_form_bibtex> > base_class;
* Copyright 2001 The LyX Team.
* See the file COPYING.
*
- * \author Edwin Leuven, leuven@fee.uva.nl
+ * \author Edwin Leuven, leuven@fee.uva.nl
+ * \author Angus Leeming, a.leeming@ic.ac.uk
*/
-#include <config.h>
-
-#include FORMS_H_LOCATION
+#include <vector>
#ifdef __GNUG_
#pragma implementation
#endif
+#include <config.h>
+
+#include "xformsBC.h"
+#include "ControlCharacter.h"
#include "FormCharacter.h"
#include "form_character.h"
-#include "bufferview_funcs.h"
-#include "Dialogs.h"
-#include "Liason.h"
-#include "LyXView.h"
-#include "buffer.h"
-#include "lyxtext.h"
-#include "language.h"
+#include "gettext.h"
#include "combox.h"
+#include "helper_funcs.h"
-using Liason::setMinibuffer;
-using SigC::slot;
+using std::vector;
+using std::back_inserter;
+using std::transform;
-FormCharacter::FormCharacter(LyXView * lv, Dialogs * d)
- : FormBaseBD(lv, d, _("Character Layout"))
-{
- // let the popup be shown
- // This is a permanent connection so we won't bother
- // storing a copy because we won't be disconnecting.
- d->showLayoutCharacter.connect(slot(this, &FormCharacter::show));
- // for LFUN_FREE
- d->setUserFreeFont.connect(slot(this, &FormCharacter::apply));
-}
+typedef FormCB<ControlCharacter, FormDB<FD_form_character> > base_class;
+FormCharacter::FormCharacter(ControlCharacter & c)
+ : base_class(c, _("Character Layout"))
+{}
-FL_FORM * FormCharacter::form() const
+
+void FormCharacter::ComboInputCB(int, void * v, Combox * combox)
{
- if (dialog_.get())
- return dialog_->form;
- return 0;
+ FormCharacter * pre = static_cast<FormCharacter*>(v);
+ pre->InputCB(reinterpret_cast<FL_OBJECT *>(combox), 0);
}
-
void FormCharacter::build()
{
- dialog_.reset(build_character());
-
- // Manage the ok, apply and cancel/close buttons
- bc().setApply(dialog_->button_apply);
- bc().setCancel(dialog_->button_close);
- bc().refresh();
- bc().addReadOnly (dialog_->check_toggle_all);
-
- fl_addto_choice(dialog_->choice_family,
- _(" No change %l| Roman | Sans Serif | Typewriter %l| Reset "));
- fl_addto_choice(dialog_->choice_series,
- _(" No change %l| Medium | Bold %l| Reset "));
- fl_addto_choice(dialog_->choice_shape,
- _(" No change %l| Upright | Italic | Slanted | Small Caps "
- "%l| Reset "));
- fl_addto_choice(dialog_->choice_size,
- _(" No change %l| Tiny | Smallest | Smaller | Small "
- "| Normal | Large | Larger | Largest | Huge | Huger "
- "%l| Increase | Decrease | Reset "));
- fl_addto_choice(dialog_->choice_bar,
- _(" No change %l| Emph | Underbar | Noun | LaTeX mode %l| Reset "));
- fl_addto_choice(dialog_->choice_color,
- _(" No change %l| No color | Black | White | Red | Green "
- "| Blue | Cyan | Magenta | Yellow %l| Reset "));
- fl_addto_choice(dialog_->choice_language,
- _(" English %l| German | French "));
-
- // insert default language box manually
- fl_addto_form(dialog_->form);
- FL_OBJECT * ob = dialog_->choice_language;
- combo_language2_.reset(new Combox(FL_COMBOX_DROPLIST));
- combo_language2_->add(ob->x, ob->y, ob->w, ob->h, 250);
- combo_language2_->shortcut("#L", 1);
- fl_end_form();
-
- // build up the combox entries
- combo_language2_->addline(_("No change"));
- combo_language2_->addline(_("Reset"));
- for (Languages::const_iterator cit = languages.begin();
- cit != languages.end(); ++cit) {
- combo_language2_->addto((*cit).second.lang());
- }
+ dialog_.reset(build_character());
+
+ vector<ControlCharacter::FamilyPair> const family = getFamilyData();
+ vector<ControlCharacter::SeriesPair> const series = getSeriesData();
+ vector<ControlCharacter::ShapePair> const shape = getShapeData();
+ vector<ControlCharacter::SizePair> const size = getSizeData();
+ vector<ControlCharacter::BarPair> const bar = getBarData();
+ vector<ControlCharacter::ColorPair> const color = getColorData();
+ vector<string> const language = getLanguageData();
+
+ // Store the enums for later
+ family_ = getSecond(family);
+ series_ = getSecond(series);
+ shape_ = getSecond(shape);
+ size_ = getSecond(size);
+ bar_ = getSecond(bar);
+ color_ = getSecond(color);
+
+ // create a string of entries " entry1 | entry2 | entry3 | entry4 "
+ // with which to initialise the xforms choice object.
+ string choice = " " + getStringFromVector(getFirst(family), " | ") +" ";
+ fl_addto_choice(dialog_->choice_family, choice.c_str());
+
+ choice = " " + getStringFromVector(getFirst(series), " | ") + " ";
+ fl_addto_choice(dialog_->choice_series, choice.c_str());
+
+ choice = " " + getStringFromVector(getFirst(shape), " | ") + " ";
+ fl_addto_choice(dialog_->choice_shape, choice.c_str());
+
+ choice = " " + getStringFromVector(getFirst(size), " | ") + " ";
+ fl_addto_choice(dialog_->choice_size, choice.c_str());
+
+ choice = " " + getStringFromVector(getFirst(bar), " | ") + " ";
+ fl_addto_choice(dialog_->choice_bar, choice.c_str());
+
+ choice = " " + getStringFromVector(getFirst(color), " | ") + " ";
+ fl_addto_choice(dialog_->choice_color, choice.c_str());
+
+ // xforms appears to need this to prevent a crash...
+ // fl_addto_choice(dialog_->choice_language,
+ // _(" English %l| German | French "));
+
+ // insert default language box manually
+ fl_addto_form(dialog_->form);
+ FL_OBJECT * ob = dialog_->choice_language;
+ combo_language2_.reset(new Combox(FL_COMBOX_DROPLIST));
+ combo_language2_->add(ob->x, ob->y, ob->w, ob->h, 250);
+ combo_language2_->shortcut("#L", 1);
+ combo_language2_->setcallback(ComboInputCB, this);
+ fl_end_form();
+
+ // build up the combox entries
+ for (vector<string>::const_iterator cit = language.begin();
+ cit != language.end(); ++cit) {
+ combo_language2_->addto(*cit);
+ }
+ combo_language2_->select_text(*language.begin());
+
+ // Manage the ok, apply and cancel/close buttons
+ bc().setApply(dialog_->button_apply);
+ bc().setCancel(dialog_->button_close);
+ bc().refresh();
+ bc().addReadOnly(dialog_->check_toggle_all);
}
void FormCharacter::apply()
{
- if (!lv_->view()->available() || !dialog_.get())
- return;
-
- LyXFont font(LyXFont::ALL_IGNORE);
-
- int pos = fl_get_choice(dialog_->choice_family);
- switch (pos) {
- case 1: font.setFamily(LyXFont::IGNORE_FAMILY); break;
- case 2: font.setFamily(LyXFont::ROMAN_FAMILY); break;
- case 3: font.setFamily(LyXFont::SANS_FAMILY); break;
- case 4: font.setFamily(LyXFont::TYPEWRITER_FAMILY); break;
- case 5: font.setFamily(LyXFont::INHERIT_FAMILY); break;
- }
-
- pos = fl_get_choice(dialog_->choice_series);
- switch (pos) {
- case 1: font.setSeries(LyXFont::IGNORE_SERIES); break;
- case 2: font.setSeries(LyXFont::MEDIUM_SERIES); break;
- case 3: font.setSeries(LyXFont::BOLD_SERIES); break;
- case 4: font.setSeries(LyXFont::INHERIT_SERIES); break;
- }
-
- pos = fl_get_choice(dialog_->choice_shape);
- switch (pos) {
- case 1: font.setShape(LyXFont::IGNORE_SHAPE); break;
- case 2: font.setShape(LyXFont::UP_SHAPE); break;
- case 3: font.setShape(LyXFont::ITALIC_SHAPE); break;
- case 4: font.setShape(LyXFont::SLANTED_SHAPE); break;
- case 5: font.setShape(LyXFont::SMALLCAPS_SHAPE); break;
- case 6: font.setShape(LyXFont::INHERIT_SHAPE); break;
- }
-
- pos = fl_get_choice(dialog_->choice_size);
- switch (pos) {
- case 1: font.setSize(LyXFont::IGNORE_SIZE); break;
- case 2: font.setSize(LyXFont::SIZE_TINY); break;
- case 3: font.setSize(LyXFont::SIZE_SCRIPT); break;
- case 4: font.setSize(LyXFont::SIZE_FOOTNOTE); break;
- case 5: font.setSize(LyXFont::SIZE_SMALL); break;
- case 6: font.setSize(LyXFont::SIZE_NORMAL); break;
- case 7: font.setSize(LyXFont::SIZE_LARGE); break;
- case 8: font.setSize(LyXFont::SIZE_LARGER); break;
- case 9: font.setSize(LyXFont::SIZE_LARGEST); break;
- case 10: font.setSize(LyXFont::SIZE_HUGE); break;
- case 11: font.setSize(LyXFont::SIZE_HUGER); break;
- case 12: font.setSize(LyXFont::INCREASE_SIZE); break;
- case 13: font.setSize(LyXFont::DECREASE_SIZE); break;
- case 14: font.setSize(LyXFont::INHERIT_SIZE); break;
- }
-
- pos = fl_get_choice(dialog_->choice_bar);
- switch (pos) {
- case 1: font.setEmph(LyXFont::IGNORE);
- font.setUnderbar(LyXFont::IGNORE);
- font.setNoun(LyXFont::IGNORE);
- font.setLatex(LyXFont::IGNORE);
- break;
- case 2: font.setEmph(LyXFont::TOGGLE); break;
- case 3: font.setUnderbar(LyXFont::TOGGLE); break;
- case 4: font.setNoun(LyXFont::TOGGLE); break;
- case 5: font.setLatex(LyXFont::TOGGLE); break;
- case 6: font.setEmph(LyXFont::INHERIT);
- font.setUnderbar(LyXFont::INHERIT);
- font.setNoun(LyXFont::INHERIT);
- font.setLatex(LyXFont::INHERIT);
- break;
- }
-
- pos = fl_get_choice(dialog_->choice_color);
- switch (pos) {
- case 1: font.setColor(LColor::ignore); break;
- case 2: font.setColor(LColor::none); break;
- case 3: font.setColor(LColor::black); break;
- case 4: font.setColor(LColor::white); break;
- case 5: font.setColor(LColor::red); break;
- case 6: font.setColor(LColor::green); break;
- case 7: font.setColor(LColor::blue); break;
- case 8: font.setColor(LColor::cyan); break;
- case 9: font.setColor(LColor::magenta); break;
- case 10: font.setColor(LColor::yellow); break;
- case 11: font.setColor(LColor::inherit); break;
- }
+ int pos = fl_get_choice(dialog_->choice_family);
+ controller().setFamily(family_[pos-1]);
+
+ pos = fl_get_choice(dialog_->choice_series);
+ controller().setSeries(series_[pos-1]);
- int const choice = combo_language2_->get();
- if (choice == 1)
- font.setLanguage(ignore_language);
- else if (choice == 2)
- font.setLanguage(lv_->buffer()->params.language);
- else
- font.setLanguage(languages.getLanguage(combo_language2_->getline()));
+ pos = fl_get_choice(dialog_->choice_shape);
+ controller().setShape(shape_[pos-1]);
+ pos = fl_get_choice(dialog_->choice_size);
+ controller().setSize(size_[pos-1]);
- bool toggleall = fl_get_button(dialog_->check_toggle_all);
- ToggleAndShow(lv_->view(), font, toggleall);
- lv_->view()->setState();
- lv_->buffer()->markDirty();
- setMinibuffer(lv_, _("Character set"));
-}
+ pos = fl_get_choice(dialog_->choice_bar);
+ controller().setBar(bar_[pos-1]);
+
+ pos = fl_get_choice(dialog_->choice_color);
+ controller().setColor(color_[pos-1]);
+ controller().setLanguage(combo_language2_->getline());
-void FormCharacter::update()
-{
- if (!dialog_.get())
- return;
-
- bc().readOnly(lv_->buffer()->isReadonly());
+ bool const toggleall = fl_get_button(dialog_->check_toggle_all);
+ controller().setToggleAll(toggleall);
}
* See the file COPYING.
*
* \author Edwin Leuven, leuven@fee.uva.nl
+ * \author Angus Leeming, a.leeming@.ac.uk
*/
#ifndef FORM_CHARACTER_H
#pragma interface
#endif
-#include "FormBaseDeprecated.h"
+#include "FormBase.h"
+#include "lyxfont.h" // for LyXFont enums
+#include "ControlCharacter.h" // for ControlCharacter enum
+#include "LColor.h" // for LColor enum
class Combox;
struct FD_form_character;
* The character dialog allows users to change the character settings
* in their documents.
*/
-class FormCharacter : public FormBaseBD {
+class FormCharacter
+ : public FormCB<ControlCharacter, FormDB<FD_form_character> > {
public:
///
- FormCharacter(LyXView *, Dialogs *);
+ FormCharacter(ControlCharacter &);
private:
-
- /// Pointer to the actual instantiation of the ButtonController.
- virtual xformsBC & bc();
/// Build the popup
virtual void build();
/// Apply from popup
virtual void apply();
- /// Update the popup.
- virtual void update();
-
- /// Pointer to the actual instantiation of the xform's form
- virtual FL_FORM * form() const;
+ /// Nothing to update...
+ virtual void update() {}
- ///
+ /** Callback method (used only to activate Apply button when
+ combox is changed */
+ static void ComboInputCB(int, void *, Combox *);
+
+ /// Type definition from the fdesign produced header file.
FD_form_character * build_character();
- /// Real GUI implementation.
- boost::scoped_ptr<FD_form_character> dialog_;
-
///
boost::scoped_ptr<Combox> combo_language2_;
-
- /// The ButtonController
- ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_;
+ ///
+ std::vector<LyXFont::FONT_FAMILY> family_;
+ ///
+ std::vector<LyXFont::FONT_SERIES> series_;
+ ///
+ std::vector<LyXFont::FONT_SHAPE> shape_;
+ ///
+ std::vector<LyXFont::FONT_SIZE> size_;
+ ///
+ std::vector<ControlCharacter::FONT_STATE> bar_;
+ ///
+ std::vector<LColor::color> color_;
};
-
-inline
-xformsBC & FormCharacter::bc()
-{
- return bc_;
-}
#endif
#include "support/lstrings.h"
#include "xforms_helpers.h"
#include "xformsBC.h"
+#include "helper_funcs.h"
using std::find;
using std::max;
{
fl_clear_browser(browser);
- for (vector<string>::size_type i = 0; i < keys.size(); ++i)
- fl_add_browser_line(browser, keys[i].c_str());
+ for (vector<string>::const_iterator it = keys.begin();
+ it < keys.end(); ++it) {
+ string key = frontStrip(strip(*it));
+ fl_add_browser_line(browser, key.c_str());
+ }
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Series:|#S");
fdui->choice_series = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 55, 191, 30, idex(_(dummy)));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Shape:|#H");
fdui->choice_shape = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 95, 191, 30, idex(_(dummy)));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Size:|#Z");
fdui->choice_size = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 275, 191, 30, idex(_(dummy)));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Misc:|#M");
fdui->choice_bar = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 335, 190, 30, idex(_(dummy)));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Apply|#A");
fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 60, 375, 80, 30, idex(_(dummy)));
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj, C_FormBaseDeprecatedApplyCB, 0);
+ fl_set_object_callback(obj, C_FormBaseApplyCB, 0);
{
char const * const dummy = N_("Cancel|#N");
fdui->button_close = obj = fl_add_button(FL_RETURN_BUTTON, 175, 375, 80, 30, idex(_(dummy)));
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0);
+ fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
{
char const * const dummy = N_("Color:|#C");
fdui->choice_color = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 135, 191, 30, idex(_(dummy)));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Toggle on all these|#T");
fdui->check_toggle_all = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 30, 215, 255, 25, idex(_(dummy)));
}
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fl_set_object_callback(obj, C_FormBaseDeprecatedInputCB, 0);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
fdui->choice_language = obj = fl_add_choice(FL_DROPLIST_CHOICE, 95, 175, 190, 30, _("Language:"));
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
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, 10, 265, 280, 45, _("These are never toggled"));
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
#define FD_form_character_h_
/** Callbacks, globals and object handlers **/
-extern "C" void C_FormBaseDeprecatedInputCB(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_FormBaseApplyCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
/**** Forms and Objects ****/
resize: FL_RESIZE_X
gravity: FL_NorthWest FL_NorthEast
name: choice_family
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_X
gravity: FL_NorthWest FL_NorthEast
name: choice_series
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_X
gravity: FL_NorthWest FL_NorthEast
name: choice_shape
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_X
gravity: FL_NorthWest FL_NorthEast
name: choice_size
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_X
gravity: FL_NorthWest FL_NorthEast
name: choice_bar
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: button_apply
-callback: C_FormBaseDeprecatedApplyCB
+callback: C_FormBaseApplyCB
argument: 0
--------------------
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: button_close
-callback: C_FormBaseDeprecatedCancelCB
+callback: C_FormBaseCancelCB
argument: 0
--------------------
resize: FL_RESIZE_X
gravity: FL_NorthWest FL_NorthEast
name: choice_color
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_X
gravity: FL_NorthWest FL_NorthEast
name: check_toggle_all
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
resize: FL_RESIZE_X
gravity: FL_NorthWest FL_NorthEast
name: choice_language
-callback: C_FormBaseDeprecatedInputCB
+callback: C_FormBaseInputCB
argument: 0
--------------------
///
typedef LanguageList::const_iterator const_iterator;
///
+ typedef LanguageList::size_type size_type;
+ ///
void read(string const & filename);
///
void setDefaults();
///
Language const * getLanguage(string const & language) const;
///
+ size_type size() const {
+ return languagelist.size();
+ }
+ ///
const_iterator begin() const {
return languagelist.begin();
}
extern Languages languages;
extern Language const * default_language;
extern Language const * english_language;
-extern Language const *ignore_language;
+extern Language const * ignore_language;
#endif