+2003-12-15 Angus Leeming <leeming@lyx.org>
+
+ * Color.h (NamedColor): store both the LyX and the GUI name.
+
+ * FormPreferences.h: Remove unused structs SortColorsByName,
+ SortColorsByColor. Remove unused #include "xforms_helpers.h".
+
+ * Dialogs2.C: add #include "xforms_helpers.h".
+
+ * FormPreferences.C: when manipulating the colors of the GUI use the
+ LyX name, rather than the translated GUI name, to identify the
+ associated LColor::color.
+
2003-12-14 Angus Leeming <leeming@lyx.org>
* FormBranch.C: use the List interface to BranchList, simplifying the
#include <config.h>
#include "FormPreferences.h"
-#include "ControlPrefs.h"
#include "forms/form_preferences.h"
#include "FormColorpicker.h"
#include "forms_gettext.h"
#include "input_validators.h"
#include "xformsBC.h"
+#include "xforms_helpers.h"
-#include "controllers/helper_funcs.h" // getSecond
+#include "controllers/ControlPrefs.h"
#include "controllers/frnt_lang.h"
+#include "controllers/helper_funcs.h" // getSecond
#include "buffer.h"
#include "converter.h"
// Now do the same for the LyX LColors...
for (vector<NamedColor>::const_iterator cit = lyxColorDB.begin();
cit != lyxColorDB.end(); ++cit) {
- LColor::color lc = lcolor.getFromGUIName(cit->getname());
+ LColor::color lc = lcolor.getFromLyXName(cit->lyxname);
if (lc == LColor::inherit) continue;
// Create a valid X11 name of the form "#rrggbb"
xformsColorDB.clear();
XformsColor xcol;
- xcol.name = _("GUI background");
+ xcol.lyxname = "GUI background";
+ xcol.guiname = _("GUI background");
xcol.colorID = FL_COL1;
fl_getmcolor(FL_COL1, &xcol.r, &xcol.g, &xcol.b);
xformsColorDB.push_back(xcol);
- xcol.name = _("GUI text");
+ xcol.lyxname = "GUI text";
+ xcol.guiname = _("GUI text");
xcol.colorID = FL_BLACK;
fl_getmcolor(FL_BLACK, &xcol.r, &xcol.g, &xcol.b);
xformsColorDB.push_back(xcol);
- xcol.name = _("GUI selection");
+ xcol.lyxname = "GUI selection";
+ xcol.guiname = _("GUI selection");
xcol.colorID = FL_YELLOW;
fl_getmcolor(FL_YELLOW, &xcol.r, &xcol.g, &xcol.b);
xformsColorDB.push_back(xcol);
- xcol.name = _("GUI pointer");
+ xcol.lyxname = "GUI pointer";
+ xcol.guiname = _("GUI pointer");
xcol.colorID = GUI_COLOR_CURSOR;
fl_getmcolor(GUI_COLOR_CURSOR, &xcol.r, &xcol.g, &xcol.b);
}
// Finally, push the color onto the database
- NamedColor ncol(lcolor.getGUIName(lc), col);
+ NamedColor ncol(lcolor.getLyXName(lc), lcolor.getGUIName(lc), col);
lyxColorDB.push_back(ncol);
}
fl_clear_browser(colbr);
for (vector<XformsColor>::const_iterator cit = xformsColorDB.begin();
cit != xformsColorDB.end(); ++cit) {
- fl_addto_browser(colbr, cit->getname().c_str());
+ fl_addto_browser(colbr, cit->guiname.c_str());
}
for (vector<NamedColor>::const_iterator cit = lyxColorDB.begin();
cit != lyxColorDB.end(); ++cit) {
- fl_addto_browser(colbr, cit->getname().c_str());
+ fl_addto_browser(colbr, cit->guiname.c_str());
}
// just to be safe...
#define FORMPREFERENCES_H
#include "FormBase.h"
-#include "xforms_helpers.h" // XformColor
#include "lyx_forms.h"
class ControlPrefs;
class Dialogs;
+class FormColorpicker;
class LyXRC;
class LyXView;
class NamedColor;
class RGBColor;
-class FormColorpicker;
+class XformsColor;
struct FD_preferences;
struct FD_preferences_colors;
ScreenFonts screen_fonts_;
///
SpellOptions spelloptions_;
-
- /** A couple of helper structs to enable colors to be sorted by name
- and by color */
- ///
- struct SortColorsByName {
- ///
- int operator()(NamedColor const & a, NamedColor const & b) const
- { return (a.getname() < b.getname()); }
- };
- ///
- struct SortColorsByColor {
- ///
- SortColorsByColor(RGBColor c) : col(c) {}
- ///
- int operator()(RGBColor const &, RGBColor const &) const;
- ///
- RGBColor col;
- };
};
#endif // FORMPREFERENCES_H