]> git.lyx.org Git - lyx.git/commitdiff
Martin's changes to the Note inset.
authorAngus Leeming <leeming@lyx.org>
Wed, 30 Jul 2003 21:47:18 +0000 (21:47 +0000)
committerAngus Leeming <leeming@lyx.org>
Wed, 30 Jul 2003 21:47:18 +0000 (21:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7456 a592a061-630c-0410-9148-cb99ea01b6c8

12 files changed:
po/POTFILES.in
src/ChangeLog
src/LColor.C
src/LColor.h
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlNote.C
src/frontends/controllers/ControlNote.h
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormNote.C
src/frontends/xforms/FormNote.h
src/insets/ChangeLog
src/insets/insetnote.C

index 87864eb78a9c19373b71ea7ee61e8fbd9678bc2c..ef8ddaab7f6e44a86ff34a8702e9eaa4768ef25d 100644 (file)
@@ -21,6 +21,7 @@ src/frontends/controllers/ControlDocument.C
 src/frontends/controllers/ControlExternal.C
 src/frontends/controllers/ControlGraphics.C
 src/frontends/controllers/ControlInclude.C
+src/frontends/controllers/ControlNote.C
 src/frontends/controllers/ControlPreamble.C
 src/frontends/controllers/ControlPrefs.C
 src/frontends/controllers/ControlPrint.C
index ff1b01b7b4d948878318524a646988a05d83217d..82ed28ad5fd21a363d94bfab2550b6708d52ab88 100644 (file)
@@ -1,3 +1,6 @@
+2003-07-30  Martin Vermeer  <martin.vermeer@hut.fi>
+
+        * LColor.[Ch]: Add comment and greyedout logical colors.
 
 2003-07-30  André Pönitz  <poenitz@gmx.net>
 
index 836f7744c6d70e390aa40dfc68b9006aa9398a1d..0ea92a1e12052691ead27d79b74317a9ca6ea450 100644 (file)
@@ -87,6 +87,10 @@ LColor::LColor()
        { preview, N_("previewed snippet"), "preview", "black", "preview" },
        { note, N_("note"), "note", "yellow", "note" },
        { notebg, N_("note background"), "notebg", "yellow", "notebg" },
+       { comment, N_("comment"), "comment", "magenta", "comment" },
+       { commentbg, N_("comment background"), "commentbg", "linen", "commentbg" },
+       { greyedout, N_("greyedout inset"), "greyedout", "red", "greyedout" },
+       { greyedoutbg, N_("greyedout inset background"), "greyedoutbg", "linen", "greyedoutbg" },
        { depthbar, N_("depth bar"), "depthbar", "IndianRed", "depthbar" },
        { language, N_("language"), "language", "Blue", "language" },
        { command, N_("command inset"), "command", "black", "command" },
index 43405264c94b5ed4924062c21450a77516fbb34b..8b7f669e1ee0fe9058585ba48f3fe830c65a9da9 100644 (file)
@@ -78,6 +78,14 @@ public:
                note,
                /// Background color of notes
                notebg,
+               /// Text color for comments
+               comment,
+               /// Background color of comments
+               commentbg,
+               /// Text color for greyedout inset
+               greyedout,
+               /// Background color of greyedout inset
+               greyedoutbg,
 
 
                /// Color for the depth bars in the margin
index 588a6c09242775d884683a7b15ddcd89d9e9b934..b8a2db993d174b4bd887942f89da9769b31dfe7a 100644 (file)
@@ -1,3 +1,7 @@
+2003-07-30  Martin Vermeer  <martin.vermeer@hut.fi>
+
+        * ControlNote.[Ch]: add i18n support.
+       
 2003-07-27  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * ControlToc.C (goTo): adjust for lyx::toc
index 4a50523e39e5c6a7e2f2f414109e244946bcd2c8..99f6b4424c7abe9d776cfa26b7bd1db91d74b938 100644 (file)
 #include "funcrequest.h"
 #include "insets/insetnote.h"
 #include "debug.h"
+#include "gettext.h"
+
+
+using std::vector;
+
 
 ControlNote::ControlNote(Dialog & parent)
        : Dialog::Controller(parent)
@@ -36,9 +41,21 @@ void ControlNote::clearParams()
        params_.reset();
 }
 
+
 void ControlNote::dispatchParams()
 {
        string const lfun = InsetNoteMailer::params2string(string("note"), params());
        kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
 }
 
+
+void note_gui_tokens(vector<string> & ids, vector<string> & gui_names)
+{
+       char const * const ids_[] = {"Note", "Comment", "Greyedout"};
+       size_t const ids_size = sizeof(ids_) / sizeof(char *);
+       ids = vector<string>(ids_, ids_ + ids_size);
+       gui_names.clear();
+       gui_names.push_back(_("LyX Note"));
+       gui_names.push_back(_("Comment"));
+       gui_names.push_back(_("Greyed Out"));
+}
index 8bde9717ad0a2bbd5651ad1f608506713bfc1132..5cbc8ab69b78749396891d07b72eb7164d439914 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "Dialog.h"
 #include "debug.h"
+#include <vector>
 
 class InsetNoteParams;
 
@@ -40,4 +41,7 @@ private:
        boost::scoped_ptr<InsetNoteParams> params_;
 };
 
+///
+void note_gui_tokens(std::vector<string> &, std::vector<string> &);
+
 #endif // CONTROLNOTE_H
index 4f2f6881e4f6922b8a6a3c92c3db8ca67c7faa2c..40636a981cc7dc40c85a4e2e7977f1d4ab4dba4c 100644 (file)
@@ -1,3 +1,8 @@
+2003-07-30  Martin Vermeer  <martin.vermeer@hut.fi>
+
+       (with help from Juergen Spitzmueller)
+        * FormNote.[Ch]: add i18n support to the dialog.
+
 2003-07-27  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * FormToc.C (updateType): adjust for lyx::toc
index 6fa17eceee46791d84f00ccc6afeea4f5148bc5e..40bbc96f1f3fef61f822d62cc848bdd87819bbe6 100644 (file)
 #include "insets/insetnote.h"
 #include "debug.h"
 
+#include <vector>
+
+using std::vector;
+
+
 typedef FormController<ControlNote, FormView<FD_note> > base_class;
 
 FormNote::FormNote(Dialog & parent)
@@ -27,20 +32,22 @@ FormNote::FormNote(Dialog & parent)
 {}
 
 
-string const FormNote::predefineds() const
-{
-       return _("Note|Comment|Greyedout");
-}
-
-
 void FormNote::build()
 {
        dialog_.reset(build_note(this));
 
-       fl_addto_choice(dialog_->choice_type, predefineds().c_str());
-       string str = _("Note: LyX internal only\n"
+       note_gui_tokens(ids_, gui_names_);
+
+       for (int i = 0; i < 3; ++i) {   
+       }
+       
+       for (int i = 0; i < 3; ++i) {   
+               fl_addto_choice(dialog_->choice_type, gui_names_[i].c_str());
+       }
+
+       string str = _("Lyx Note: LyX internal only\n"
                       "Comment: Export to LaTeX but don't print\n"
-                      "Greyedout: Print as grey text");
+                      "Greyed Out: Print as grey text");
        tooltips().init(dialog_->choice_type, str);
 
        bcview().setOK(dialog_->button_ok);
@@ -52,12 +59,16 @@ void FormNote::build()
 void FormNote::update()
 {
        string type(controller().params().type);
-       fl_set_choice_text(dialog_->choice_type, type.c_str());
+       for (int i = 0; i < 3; ++i) {   
+       if (type == ids_[i])
+               fl_set_choice_text(dialog_->choice_type, gui_names_[i].c_str());
+       }
 }
 
 
 void FormNote::apply()
 {
-       controller().params().type = fl_get_choice_text(dialog_->choice_type);
+       int i = fl_get_choice(dialog_->choice_type);
+       controller().params().type = ids_[i - 1];
 }
 
index 406105dc093a1749e5a558f51601628f8f1d6000..c65fbf648b2c9915b76438d1332076058623ff55 100644 (file)
@@ -33,7 +33,9 @@ private:
        /// Update dialog before showing it
        virtual void update();
        ///
-       string const predefineds() const;
+       std::vector<string> ids_;
+       ///
+       std::vector<string> gui_names_;
 };
 
 #endif // FORMNOTE_H
index 8c31b752dc1ef060f9c4b57c3534a2130ccc190b..edb40a0f6696f235ada97b4ad11e373d7d14717a 100644 (file)
@@ -1,3 +1,8 @@
+2003-07-30  Martin Vermeer  <martin.vermeer@hut.fi>
+
+       (with help from Juergen Spitzmueller)
+        * insetnote.C: add add i18n support. Use Prefs-definable
+       colours for Comment and Greyedout.
 
 2003-07-30  André Pönitz  <poenitz@gmx.net>
 
index 92a79b09f7d93cdd122b9b8010ac4daa732e5626..ec347dc3553e588fd34856676c1e9a3820bef9d3 100644 (file)
@@ -41,7 +41,7 @@ InsetNote::InsetNote(BufferParams const & bp, string const & label)
 {
        params_.type = label;
        init();
-       setLabel(label);
+       setButtonLabel();
 }
 
 
@@ -91,13 +91,18 @@ void InsetNote::setButtonLabel()
        font.decSize();
        font.decSize();
 
-       setLabel(params_.type);
-       if (params_.type == "Note" || params_.type == "Comment") {
+       if (params_.type == "Note") {
+               setLabel(_("LyX Note"));
                font.setColor(LColor::note);
                setBackgroundColor(LColor::notebg);
+       } else if (params_.type == "Comment") {
+               setLabel(_("Comment"));
+               font.setColor(LColor::comment);
+               setBackgroundColor(LColor::commentbg);
        } else {
-               font.setColor(LColor::red);
-               setBackgroundColor(LColor::background);
+               setLabel(_("Greyed Out"));
+               font.setColor(LColor::greyedout);
+               setBackgroundColor(LColor::greyedoutbg);
        }
        setLabelFont(font);
 }